* [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. @ 2024-02-25 21:17 Maxim Cournoyer 2024-02-25 21:49 ` Ludovic Courtès 2024-02-26 3:57 ` [bug#69396] [PATCH core-updates v2] " Maxim Cournoyer 0 siblings, 2 replies; 6+ messages in thread From: Maxim Cournoyer @ 2024-02-25 21:17 UTC (permalink / raw) To: 69396; +Cc: Maxim Cournoyer, Ludovic Courtès The following problem was discovered while attempting to configure Guix to use a locally built Guile tree, via its meta/uninstalled-env script, which would attempt to use the newer Guile source files and fail with: Pre-boot error; key: unbound-variable, args: (#f "Unbound variable: ~S" (error) #f)collect2: fatal error: ld terminated with signal 6 [Aborted] With the following change, a Guix user may now configure their build to use a locally built Guile with e.g.: ~/src/guile/meta/uninstalled-env ./configure --localstatedir=/var \ --sysconfdir=/etc * gnu/packages/ld-wrapper.in: Unset GUILE_LOAD_PATH. Also unset GUILE_SYSTEM_PATH, for symmetry. Streamline exec call, using the now fixed '-l' option. (ld-wrapper): Fix args being a nested list, and strip its arg0. Change-Id: Iaaa721019f3646d851202bb018214ec9fcc04fd4 --- gnu/packages/ld-wrapper.in | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/gnu/packages/ld-wrapper.in b/gnu/packages/ld-wrapper.in index 0d53e746af..0a2135ff5e 100644 --- a/gnu/packages/ld-wrapper.in +++ b/gnu/packages/ld-wrapper.in @@ -1,23 +1,26 @@ #!@BASH@ # -*- mode: scheme; coding: utf-8; -*- -# XXX: We have to go through Bash because there's no command-line switch to -# augment %load-compiled-path, and because of the silly 127-byte limit for -# the shebang line in Linux. -# Use `load-compiled' because `load' (and `-l') doesn't otherwise load our -# .go file (see <http://bugs.gnu.org/12519>). -# Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon -# incompatible .go files. See -# <https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00000.html>. +# XXX: We have to go through Bash because there's no Guile command-line switch to +# ignore the various Guile load path related environment variables. +# Unset 'GUILE_LOAD_PATH' to make sure we do not stumble upon +# incompatible Guile files (see +# <https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00000.html>). + +unset GUILE_LOAD_PATH unset GUILE_LOAD_COMPILED_PATH +unset GUILE_SYSTEM_PATH unset GUILE_SYSTEM_COMPILED_PATH -main="(@ (gnu build-support ld-wrapper) ld-wrapper)" -exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" + +exec @GUILE@ \ +-l @SELF@ \ +-e '(@ (gnu build-support ld-wrapper) ld-wrapper)' -s "$0" "$@" !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com> +;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -285,9 +288,9 @@ library outside of ~a: ~s~%" result (expand-arguments result))) -(define (ld-wrapper . args) +(define (ld-wrapper args) ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. - (let* ((args (expand-arguments args)) + (let* ((args (expand-arguments (cdr args))) ;strip arg0 (path (library-search-path args)) (libs (library-files-linked args path)) (args (append args (rpath-arguments libs)))) base-commit: f205179ed2cedf55aa0e046af2d80282f6a74075 -- 2.41.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. 2024-02-25 21:17 [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH Maxim Cournoyer @ 2024-02-25 21:49 ` Ludovic Courtès 2024-02-26 4:06 ` Maxim Cournoyer 2024-02-26 3:57 ` [bug#69396] [PATCH core-updates v2] " Maxim Cournoyer 1 sibling, 1 reply; 6+ messages in thread From: Ludovic Courtès @ 2024-02-25 21:49 UTC (permalink / raw) To: Maxim Cournoyer; +Cc: 69396 Hi, Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > The following problem was discovered while attempting to configure Guix to use > a locally built Guile tree, via its meta/uninstalled-env script, which would > attempt to use the newer Guile source files and fail with: > > Pre-boot error; key: unbound-variable, args: (#f "Unbound variable: > ~S" (error) #f)collect2: fatal error: ld terminated with signal 6 [Aborted] > > With the following change, a Guix user may now configure their build to use a > locally built Guile with e.g.: > > ~/src/guile/meta/uninstalled-env ./configure --localstatedir=/var \ > --sysconfdir=/etc > > * gnu/packages/ld-wrapper.in: Unset GUILE_LOAD_PATH. Also unset > GUILE_SYSTEM_PATH, for symmetry. Streamline exec call, using the now fixed > '-l' option. > (ld-wrapper): Fix args being a nested list, and strip its arg0. [...] > -# XXX: We have to go through Bash because there's no command-line switch to > -# augment %load-compiled-path, and because of the silly 127-byte limit for > -# the shebang line in Linux. > -# Use `load-compiled' because `load' (and `-l') doesn't otherwise load our > -# .go file (see <http://bugs.gnu.org/12519>). > -# Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon > -# incompatible .go files. See > -# <https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00000.html>. > +# XXX: We have to go through Bash because there's no Guile command-line switch to > +# ignore the various Guile load path related environment variables. > > +# Unset 'GUILE_LOAD_PATH' to make sure we do not stumble upon > +# incompatible Guile files (see > +# <https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00000.html>). > + > +unset GUILE_LOAD_PATH > unset GUILE_LOAD_COMPILED_PATH > +unset GUILE_SYSTEM_PATH > unset GUILE_SYSTEM_COMPILED_PATH OK for this part (I guess nobody tried that before!). > -main="(@ (gnu build-support ld-wrapper) ld-wrapper)" > -exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" > + > +exec @GUILE@ \ > +-l @SELF@ \ > +-e '(@ (gnu build-support ld-wrapper) ld-wrapper)' -s "$0" "$@" @SELF@ might need to be enclosed in double quotes for good measure. Can you check through ‘strace’ how loading with ‘-l’ compares to (load-compiled …)? Otherwise LGTM, thanks! Ludo’. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. 2024-02-25 21:49 ` Ludovic Courtès @ 2024-02-26 4:06 ` Maxim Cournoyer 0 siblings, 0 replies; 6+ messages in thread From: Maxim Cournoyer @ 2024-02-26 4:06 UTC (permalink / raw) To: Ludovic Courtès; +Cc: 69396 Hi Ludo, Thanks for the prompt review! Ludovic Courtès <ludo@gnu.org> writes: [...] >> +unset GUILE_LOAD_PATH >> unset GUILE_LOAD_COMPILED_PATH >> +unset GUILE_SYSTEM_PATH >> unset GUILE_SYSTEM_COMPILED_PATH > > OK for this part (I guess nobody tried that before!). Ack. >> -main="(@ (gnu build-support ld-wrapper) ld-wrapper)" >> -exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" >> + >> +exec @GUILE@ \ >> +-l @SELF@ \ >> +-e '(@ (gnu build-support ld-wrapper) ld-wrapper)' -s "$0" "$@" > > @SELF@ might need to be enclosed in double quotes for good measure. > > Can you check through ‘strace’ how loading with ‘-l’ compares to > (load-compiled …)? Good suggestion; it turns out the .go file was not loaded until I also would provide the -C / arguments to Guile, as load-in-vicinity with an absolute file does the module loading from site-path thing as well as compiled-path-dir + absolute-file-name-of.go, which meant it was attempting to load the .go file at some odd place like '/gnu/store/hx74v20cwcra7jq8lnagfi76i73018ai-ld-wrapper2-0/bin//gnu/store/hx74v20cwcra7jq8lnagfi76i73018ai-ld-wrapper2-0/bin/ld.go', hm. For completeness, the added system calls as seen with strace when using -C / -l /gnu/store/hx74v20cwcra7jq8lnagfi76i73018ai-ld-wrapper2-0/bin/ld compared to the previous approach were: --8<---------------cut here---------------start------------->8--- newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/3.0/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/3.0/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/3.0/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/3.0/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/lib/guile/3.0/ccache/gnu/build-support/ld-wrapper.go", 0x7ffd4c4c36a0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/lib/guile/3.0/site-ccache/gnu/build-support/ld-wrapper.go", 0x7ffd4c4c36a0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/3.0/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/3.0/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/3.0/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/3.0/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/site/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/gnu/build-support/ld-wrapper.scm", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/gnu/build-support/ld-wrapper", 0x7ffd4c4c3920, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/lib/guile/3.0/ccache/gnu/build-support/ld-wrapper.go", 0x7ffd4c4c36a0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/lib/guile/3.0/site-ccache/gnu/build-support/ld-wrapper.go", 0x7ffd4c4c36a0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) getcwd("/home/maxim/src/guix-core-updates", 100) = 34 newfstatat(AT_FDCWD, "/gnu/store/mn9fi6hvs5nr8n3c4651vbirkgigfy7n-ld-wrapper2-0/bin/ld", {st_dev=makedev(0, 0x18), st_ino=370740560, st_mode=S_IFREG|0555, st_nlink=2, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=32, st_size=12553, st_atime=1708917046 /* 2024-02-25T22:10:46-0500 */, st_atime_nsec=0, st_mtime=1 /* 1969-12-31T19:00:01-0500 */, st_mtime_nsec=0, st_ctime=1708917047 /* 2024-02-25T22:10:47.398473362-0500 */, st_ctime_nsec=398473362}, 0) = 0 newfstatat(AT_FDCWD, "//gnu/store/mn9fi6hvs5nr8n3c4651vbirkgigfy7n-ld-wrapper2-0/bin/ld.go", {st_dev=makedev(0, 0x18), st_ino=370740561, st_mode=S_IFREG|0444, st_nlink=2, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=160, st_size=81429, st_atime=1708917046 /* 2024-02-25T22:10:46-0500 */, st_atime_nsec=0, st_mtime=1 /* 1969-12-31T19:00:01-0500 */, st_mtime_nsec=0, st_ctime=1708917047 /* 2024-02-25T22:10:47.402473236-0500 */, st_ctime_nsec=402473236}, 0) = 0 newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/share/guile/3.0/system/vm/loader.scm", {st_dev=makedev(0, 0x18), st_ino=357681850, st_mode=S_IFREG|0444, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=1120, st_atime=1 /* 1969-12-31T19:00:01-0500 */, st_atime_nsec=0, st_mtime=1 /* 1969-12-31T19:00:01-0500 */, st_mtime_nsec=0, st_ctime=1706016118 /* 2024-01-23T08:21:58.171697725-0500 */, st_ctime_nsec=171697725}, 0) = 0 newfstatat(AT_FDCWD, "/system/vm/loader.go", 0x7ffd4c4c36a0, 0) = -1 ENOENT (Aucun fichier ou dossier de ce type) newfstatat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/lib/guile/3.0/ccache/system/vm/loader.go", {st_dev=makedev(0, 0x18), st_ino=256911472, st_mode=S_IFREG|0444, st_nlink=39, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=136, st_size=68581, st_atime=1707491218 /* 2024-02-09T10:06:58.868984106-0500 */, st_atime_nsec=868984106, st_mtime=1 /* 1969-12-31T19:00:01-0500 */, st_mtime_nsec=0, st_ctime=1707727292 /* 2024-02-12T03:41:32.717219251-0500 */, st_ctime_nsec=717219251}, 0) = 0 openat(AT_FDCWD, "/gnu/store/7jdlzpvy01y7szg7phm2l2x9szjrwlgw-guile-3.0.9/lib/guile/3.0/ccache/system/vm/loader.go", O_RDONLY|O_CLOEXEC) = 5 lseek(5, 0, SEEK_END) = 68581 mmap(NULL, 68581, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7fa8f76cc000 close(5) = 0 mprotect(0x7fa8f76dc000, 936, PROT_READ|PROT_WRITE) = 0 openat(AT_FDCWD, "//gnu/store/mn9fi6hvs5nr8n3c4651vbirkgigfy7n-ld-wrapper2-0/bin/ld.go", O_RDONLY|O_CLOEXEC) = 5 lseek(5, 0, SEEK_END) = 81429 mmap(NULL, 81429, PROT_READ, MAP_PRIVATE, 5, 0) = 0x7fa8f76b8000 close(5) = 0 mprotect(0x7fa8f76c8000, 5832, PROT_READ|PROT_WRITE) = 0 getcwd("/home/maxim/src/guix-core-updates", 100) = 34 newfstatat(AT_FDCWD, "/gnu/store/mn9fi6hvs5nr8n3c4651vbirkgigfy7n-ld-wrapper2-0/bin/ld", {st_dev=makedev(0, 0x18), st_ino=370740560, st_mode=S_IFREG|0555, st_nlink=2, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=32, st_size=12553, st_atime=1708917046 /* 2024-02-25T22:10:46-0500 */, st_atime_nsec=0, st_mtime=1 /* 1969-12-31T19:00:01-0500 */, st_mtime_nsec=0, st_ctime=1708917047 /* 2024-02-25T22:10:47.398473362-0500 */, st_ctime_nsec=398473362}, 0) = 0 newfstatat(AT_FDCWD, "//gnu/store/mn9fi6hvs5nr8n3c4651vbirkgigfy7n-ld-wrapper2-0/bin/ld.go", {st_dev=makedev(0, 0x18), st_ino=370740561, st_mode=S_IFREG|0444, st_nlink=2, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=160, st_size=81429, st_atime=1708917046 /* 2024-02-25T22:10:46-0500 */, st_atime_nsec=0, st_mtime=1 /* 1969-12-31T19:00:01-0500 */, st_mtime_nsec=0, st_ctime=1708917047 /* 2024-02-25T22:10:47.402473236-0500 */, st_ctime_nsec=402473236}, 0) = 0 openat(AT_FDCWD, "//gnu/store/mn9fi6hvs5nr8n3c4651vbirkgigfy7n-ld-wrapper2-0/bin/ld.go", O_RDONLY|O_CLOEXEC) = 5 --8<---------------cut here---------------end--------------->8--- So, I've reverted to the old style of using load-compiled, and left a note. You'll find the result in v2. I'll synchronize with jpoiret for the right timing to merge this to core-updates with other world rebuilding changes, to minimize disruption to other core-updates hackers. -- Thanks, Maxim ^ permalink raw reply [flat|nested] 6+ messages in thread
* [bug#69396] [PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. 2024-02-25 21:17 [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH Maxim Cournoyer 2024-02-25 21:49 ` Ludovic Courtès @ 2024-02-26 3:57 ` Maxim Cournoyer 2024-02-27 9:23 ` Ludovic Courtès 2024-03-09 18:37 ` bug#69396: " Maxim Cournoyer 1 sibling, 2 replies; 6+ messages in thread From: Maxim Cournoyer @ 2024-02-26 3:57 UTC (permalink / raw) To: 69396; +Cc: Maxim Cournoyer, Ludovic Courtès The following problem was discovered while attempting to configure Guix to use a locally built Guile tree, via its meta/uninstalled-env script, which would attempt to use the newer Guile source files and fail with: Pre-boot error; key: unbound-variable, args: (#f "Unbound variable: ~S" (error) #f)collect2: fatal error: ld terminated with signal 6 [Aborted] With the following change, a Guix user may now configure their build to use a locally built Guile with e.g.: ~/src/guile/meta/uninstalled-env ./configure --localstatedir=/var \ --sysconfdir=/etc * gnu/packages/ld-wrapper.in: Unset GUILE_LOAD_PATH. Also unset GUILE_SYSTEM_PATH, for symmetry. Streamline exec call, using the now fixed '-l' option. (ld-wrapper): Fix args being a nested list, and strip its arg0. Change-Id: Iaaa721019f3646d851202bb018214ec9fcc04fd4 --- Changes in v2: - Revert to load-compiled scheme to load ld.go - Refine comment gnu/packages/ld-wrapper.in | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/gnu/packages/ld-wrapper.in b/gnu/packages/ld-wrapper.in index 0d53e746af..c9bb235bca 100644 --- a/gnu/packages/ld-wrapper.in +++ b/gnu/packages/ld-wrapper.in @@ -1,23 +1,28 @@ #!@BASH@ # -*- mode: scheme; coding: utf-8; -*- -# XXX: We have to go through Bash because there's no command-line switch to -# augment %load-compiled-path, and because of the silly 127-byte limit for -# the shebang line in Linux. -# Use `load-compiled' because `load' (and `-l') doesn't otherwise load our -# .go file (see <http://bugs.gnu.org/12519>). -# Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon -# incompatible .go files. See -# <https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00000.html>. +# XXX: We have to go through Bash because there's no Guile command-line switch to +# ignore the various Guile load path related environment variables. + +# Unset 'GUILE_LOAD_PATH' to make sure we do not stumble upon +# incompatible Guile files (see +# <https://lists.gnu.org/archive/html/guile-devel/2016-03/msg00000.html>). +unset GUILE_LOAD_PATH unset GUILE_LOAD_COMPILED_PATH +unset GUILE_SYSTEM_PATH unset GUILE_SYSTEM_COMPILED_PATH + +# Use `load-compiled' because `load' (and `-l') doesn't otherwise load our +# .go file, or causes extraneous `stat' system calls when the "-C" "/" arguments +# are provided. main="(@ (gnu build-support ld-wrapper) ld-wrapper)" -exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@" +exec @GUILE@ -c "(load-compiled \"@SELF@.go\") ($main (command-line))" "$@" !# ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com> +;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -285,9 +290,9 @@ library outside of ~a: ~s~%" result (expand-arguments result))) -(define (ld-wrapper . args) +(define (ld-wrapper args) ;; Invoke the real `ld' with ARGS, augmented with `-rpath' switches. - (let* ((args (expand-arguments args)) + (let* ((args (expand-arguments (cdr args))) ;strip arg0 (path (library-search-path args)) (libs (library-files-linked args path)) (args (append args (rpath-arguments libs)))) base-commit: f205179ed2cedf55aa0e046af2d80282f6a74075 -- 2.41.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [bug#69396] [PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. 2024-02-26 3:57 ` [bug#69396] [PATCH core-updates v2] " Maxim Cournoyer @ 2024-02-27 9:23 ` Ludovic Courtès 2024-03-09 18:37 ` bug#69396: " Maxim Cournoyer 1 sibling, 0 replies; 6+ messages in thread From: Ludovic Courtès @ 2024-02-27 9:23 UTC (permalink / raw) To: Maxim Cournoyer; +Cc: 69396 Hi, Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > The following problem was discovered while attempting to configure Guix to use > a locally built Guile tree, via its meta/uninstalled-env script, which would > attempt to use the newer Guile source files and fail with: > > Pre-boot error; key: unbound-variable, args: (#f "Unbound variable: > ~S" (error) #f)collect2: fatal error: ld terminated with signal 6 [Aborted] > > With the following change, a Guix user may now configure their build to use a > locally built Guile with e.g.: > > ~/src/guile/meta/uninstalled-env ./configure --localstatedir=/var \ > --sysconfdir=/etc > > * gnu/packages/ld-wrapper.in: Unset GUILE_LOAD_PATH. Also unset > GUILE_SYSTEM_PATH, for symmetry. Streamline exec call, using the now fixed > '-l' option. > (ld-wrapper): Fix args being a nested list, and strip its arg0. > > Change-Id: Iaaa721019f3646d851202bb018214ec9fcc04fd4 > --- > > Changes in v2: > - Revert to load-compiled scheme to load ld.go > - Refine comment LGTM! I’ll let you check with Josselin et al. whether to merge it now in ‘core-updates’ (my gut feeling is that we’d rather wait for the next cycle, but I’ve haven’t been following lately.) Thanks, Ludo’. ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#69396: [PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. 2024-02-26 3:57 ` [bug#69396] [PATCH core-updates v2] " Maxim Cournoyer 2024-02-27 9:23 ` Ludovic Courtès @ 2024-03-09 18:37 ` Maxim Cournoyer 1 sibling, 0 replies; 6+ messages in thread From: Maxim Cournoyer @ 2024-03-09 18:37 UTC (permalink / raw) To: 69396-done; +Cc: Ludovic Courtès Hello, Maxim Cournoyer <maxim.cournoyer@gmail.com> writes: > The following problem was discovered while attempting to configure Guix to use > a locally built Guile tree, via its meta/uninstalled-env script, which would > attempt to use the newer Guile source files and fail with: > > Pre-boot error; key: unbound-variable, args: (#f "Unbound variable: > ~S" (error) #f)collect2: fatal error: ld terminated with signal 6 [Aborted] > > With the following change, a Guix user may now configure their build to use a > locally built Guile with e.g.: > > ~/src/guile/meta/uninstalled-env ./configure --localstatedir=/var \ > --sysconfdir=/etc > > * gnu/packages/ld-wrapper.in: Unset GUILE_LOAD_PATH. Also unset > GUILE_SYSTEM_PATH, for symmetry. Streamline exec call, using the now fixed > '-l' option. > (ld-wrapper): Fix args being a nested list, and strip its arg0. > > Change-Id: Iaaa721019f3646d851202bb018214ec9fcc04fd4 Pushed to core-updates. Closing! -- Thanks, Maxim ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-09 18:39 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-02-25 21:17 [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH Maxim Cournoyer 2024-02-25 21:49 ` Ludovic Courtès 2024-02-26 4:06 ` Maxim Cournoyer 2024-02-26 3:57 ` [bug#69396] [PATCH core-updates v2] " Maxim Cournoyer 2024-02-27 9:23 ` Ludovic Courtès 2024-03-09 18:37 ` bug#69396: " Maxim Cournoyer
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.