Hi Paul, > * modules/acl-tests (test_copy_acl_LDADD): Add > $(FILE_HAS_ACL_LIB), since qcopy-acl depends on file-has-acl. > Although this suggests that QCOPY_ACL_LIB should contain > FILE_HAS_ACL_LIB, I’m not sure whether that’s the right course of > action
Yes, when a unit test has a link error, the first questions should be "what additional libraries are needed?" and "from which variable do I get them?". But then, the next question should be: "which updates are needed in the 'Link:' sections of various modules"? Here, after the qcopy-acl change yesterday, the following modules need to link with $(FILE_HAS_ACL_LIB), at least conditionally: * qcopy-acl * The dependents of qcopy-acl: $ ./gnulib-tool --extract-dependents qcopy-acl acl copy-file qacl supersede > and anyway this is good enough for coreutils. But it missed the modules acl, copy-file, qacl, supersede, which are used by other packages 'gettext', 'sed', 'recutils', etc. Since the variable $(QCOPY_ACL_LIB) is meant to contain all the link dependencies of module 'qcopy-acl', it is this variable that needs to be updated. This automatically takes care of the dependents. 2025-05-10 Bruno Haible <br...@clisp.org> qcopy-acl: Update link dependencies after yesterday's change. * m4/acl.m4 (gl_QCOPY_ACL): Require gl_FILE_HAS_ACL. (QCOPY_ACL_LIB): Conditionally add $FILE_HAS_ACL_LIB. * modules/acl-tests (Makefile.am): Revert last change. diff --git a/m4/acl.m4 b/m4/acl.m4 index 50066da214..2dd33497ef 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 -# serial 36 +# serial 37 dnl Copyright (C) 2002, 2004-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -230,10 +230,11 @@ AC_DEFUN([gl_FILE_HAS_ACL] AC_DEFUN([gl_QCOPY_ACL], [ AC_REQUIRE([gl_FUNC_ACL]) + AC_REQUIRE([gl_FILE_HAS_ACL]) AC_CHECK_HEADERS_ONCE([linux/xattr.h]) gl_FUNC_XATTR if test "$use_xattr" = yes; then - QCOPY_ACL_LIB="$LIB_XATTR" + QCOPY_ACL_LIB="$LIB_XATTR $FILE_HAS_ACL_LIB" else QCOPY_ACL_LIB="$LIB_ACL" fi diff --git a/modules/acl-tests b/modules/acl-tests index c77ca16361..5add9405bc 100644 --- a/modules/acl-tests +++ b/modules/acl-tests @@ -26,5 +26,5 @@ TESTS += \ TESTS_ENVIRONMENT += USE_ACL=$(USE_ACL) check_PROGRAMS += test-set-mode-acl test-copy-acl test-sameacls test_set_mode_acl_LDADD = $(LDADD) $(LIB_ACL) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV) -test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) $(QCOPY_ACL_LIB) $(FILE_HAS_ACL_LIB) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV) +test_copy_acl_LDADD = $(LDADD) $(LIB_ACL) $(QCOPY_ACL_LIB) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV) test_sameacls_LDADD = $(LDADD) $(LIB_ACL) @LIBINTL@ $(MBRTOWC_LIB)