Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS builds #2876

Open
Firstyear opened this issue Jul 28, 2024 · 1 comment
Open

MacOS builds #2876

Firstyear opened this issue Jul 28, 2024 · 1 comment

Comments

@Firstyear
Copy link
Contributor

configure.ac contains the following test

# Check all tools used by make install
AS_IF([test "$HOSTOS" = "Linux" && test "x$systemd_sysusers" != "xyes"],
    [ AC_CHECK_PROG(useradd, useradd, yes)
      AC_CHECK_PROG(groupadd, groupadd, yes)
      AC_CHECK_PROG(adduser, adduser, yes)
      AC_CHECK_PROG(addgroup, addgroup, yes)
      AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
         [AC_MSG_ERROR([addgroup or groupadd are needed.])])
      AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
         [AC_MSG_ERROR([adduser or useradd are needed.])])])

This condition is impossible to satisfy on macos as none of these group managament commands are available. Additionally, this isn't needed for vendoring/bundled of the library such as in a development workflow.

I would propose a --disable-useradd feature which allows this check to be skipped when not required.

@tie
Copy link

tie commented Aug 2, 2024

I would propose a --disable-useradd feature which allows this check to be skipped when not required.

These programs are already optional (i.e. Makefile considers errors non-fatal) and I think that configure.ac should be using AC_MSG_WARN instead of AC_MSG_ERROR.

tpm2-tss/Makefile.am

Lines 987 to 988 in 6c46325

@echo "call make_tss_user_and_group"
@$(call make_tss_user_and_group) || echo "WARNING Failed to create the tss user and group"

See also NixOS/nixpkgs#317786 (comment)

diff --git a/configure.ac b/configure.ac
index e2d579b8..0eac4ff3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -672,9 +672,9 @@ AS_IF([test "$HOSTOS" = "Linux" && test "x$systemd_sysusers" != "xyes"],
       AC_CHECK_PROG(adduser, adduser, yes)
       AC_CHECK_PROG(addgroup, addgroup, yes)
       AS_IF([test "x$addgroup" != "xyes" && test "x$groupadd" != "xyes" ],
-         [AC_MSG_ERROR([addgroup or groupadd are needed.])])
+         [AC_MSG_WARN([addgroup or groupadd are needed.])])
       AS_IF([test "x$adduser" != "xyes" && test "x$useradd" != "xyes" ],
-         [AC_MSG_ERROR([adduser or useradd are needed.])])])
+         [AC_MSG_WARN([adduser or useradd are needed.])])])
 
 AC_SUBST([PATH])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants