From adbf7ce2c2b03ce5ee25d4c68f9bb247b0dcbc2b Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 30 May 2024 14:48:04 -0400 Subject: [PATCH] bootstrap: Use gnulib-tool from PATH if available. Some distributions such as GNU Guix include in their package for gnulib a 'gnulib-tool' command under their $bindir prefix (e.g. '/bin') for users to use, along the unmodified full sources. The idea is that any wrapping or distribution modifications for the *execution* of the script at run time is done on these commands, while the rest of the source should be in their pristine (unmodified) version. Adjust the 'gnulib-tool' discovery mechanism to support such installation layout. * build-aux/bootstrap (autogen) : Prefer to use from PATH, else from $GNULIB_SRCDIR/../../bin/gnulib-tool, else from $GNULIB_SRCDIR/gnulib-tool. * gnulib-tool.sh (func_gnulib_dir): Honor GNULIB_SRCDIR to locate gnulib's main directory. --- build-aux/bootstrap | 11 +++++++++-- gnulib-tool.sh | 6 +++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 6295b8a128..06271eea8b 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -3,7 +3,7 @@ # Bootstrap this package from checked-out sources. -scriptversion=2024-04-13.15; # UTC +scriptversion=2024-05-30.20; # UTC # Copyright (C) 2003-2024 Free Software Foundation, Inc. # @@ -1164,7 +1164,14 @@ autogen() fi if $use_gnulib; then - gnulib_tool=$GNULIB_SRCDIR/gnulib-tool + gnulib_tool=$(command -v gnulib-tool) + if test -x "$gnulib_tool"; then + : # done + elif test -x $GNULIB_SRCDIR/../../bin/gnulib-tool; then + gnulib_tool=$GNULIB_SRCDIR/../../bin/gnulib-tool + else + gnulib_tool=$GNULIB_SRCDIR/gnulib-tool + fi <$gnulib_tool || return fi diff --git a/gnulib-tool.sh b/gnulib-tool.sh index 12f0b82461..0aefbe2b2b 100755 --- a/gnulib-tool.sh +++ b/gnulib-tool.sh @@ -518,7 +518,11 @@ func_gnulib_dir () * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; esac done - gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` + if test -n "$GNULIB_SRCDIR"; then + gnulib_dir=$GNULIB_SRCDIR + else + gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` + fi } # func_tmpdir base-commit: ac4b301ae15223c98b51cd5a0eda2e2cf57c817b -- 2.41.0 class='nohover'>AgeCommit message (2024-06-262024-11-03activation: Create directory with specified perms in ‘mkdir-p/perms’....There is currently a window of time between when the desired directory is created and when its permissions are changed. During this time, its permissions are restricted only by the umask. Of course, in the "directory already exists" case, this doesn't matter, but if the directory has been specifically deleted ahead of time so that it is created afresh, this is an unnecessary window. We can avoid this by passing the caller-provided BITS to 'mkdirat' when attempting to create the last directory. * gnu/build/activation.scm (mkdir-p/perms): Create target directory with BITS permissions. Change-Id: I03d2c620872e86b6f591abe0f1c8317aa1245383 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Reepca Russelstein 2024-09-06activation: Fix TOCTTOU in mkdir-p/perms....Fixes <https://issues.guix.gnu.org/47584>. I removed the 'Based upon mkdir-p from (guix build utils)' comment because it's quite a bit different now. * gnu/build/activation.scm (verify-not-symbolic): Delete. (mkdir-p/perms): Rewrite in terms of 'openat'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Change-Id: Id2f5bcbb903283afd45f6109190210d02eb383c7 Maxime Devos 2024-08-11privilege: Add POSIX capabilities(7) support....* gnu/system/privilege.scm (<privileged-program>): Add a field representing the program's POSIX capabilities. (privileged-program-capabilities): New public procedure. * doc/guix.texi (Privileged Programs): Document it. * gnu/build/activation.scm (activate-privileged-programs): Take a LIBCAP package argument providing setcap(8) to apply said capabilities. * gnu/services.scm (privileged-program->activation-gexp): Pass said package argument where supported. Include privileged-program-capabilities in the compatibility hack. Tobias Geerinckx-Rice 2024-08-11build: Rename activate-setuid-programs....* gnu/build/activation.scm (activate-setuid-programs): Rename this… (activate-privileged-programs): …to this. Operate on a list of <privileged-program> records. * gnu/services.scm (setuid-program->activation-gexp): Adjust caller. Tobias Geerinckx-Rice 2024-08-11services: setuid-program: Populate /run/privileged/bin....Create /run/setuid-programs compatibility symlinks so that we can migrate all users (both package and human) piecemeal at our leisure. Apart from being symlinks, this should be a user-invisible change. * gnu/build/activation.scm (%privileged-program-directory): New variable. [activate-setuid-programs]: Put privileged copies in %PRIVILEGED-PROGRAM-DIRECTORY, with compatibility symlinks to each in %SETUID-DIRECTORY. * gnu/services.scm (setuid-program-service-type): Update docstring. * doc/guix.texi (Setuid Programs): Update @file{} name accordingly. Tobias Geerinckx-Rice 2024-02-19services: activation: Ensure /run existence....* gnu/build/activation.scm (activation-script): Ensure /var/run existence. * gnu/build/install.scm (evaluate-populate-directive) [directives]: Remove directory /run. Change-Id: I19ca8e7605c0cff598ab89077a94e20390ba27b0 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Nicolas Graves