[PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 25 Feb 22:17 +0100
(address . guix-patches@gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
e64c696e314f39865f782e7320241631a7e68a77.1708895869.git.maxim.cournoyer@gmail.com
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(-)

Toggle diff (57 lines)
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
L
L
Ludovic Courtès wrote on 25 Feb 22:49 +0100
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 69396@debbugs.gnu.org)
87le7843js.fsf@gnu.org
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

Toggle quote (18 lines)
> 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.

[...]

Toggle quote (20 lines)
> -# 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!).

Toggle quote (7 lines)
> -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’.
M
M
Maxim Cournoyer wrote on 26 Feb 04:57 +0100
[PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.
(address . 69396@debbugs.gnu.org)(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
094b2d80c6524440e9b86ec9a3181e28d31f3957.1708919827.git.maxim.cournoyer@gmail.com
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(-)

Toggle diff (58 lines)
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
M
M
Maxim Cournoyer wrote on 26 Feb 05:06 +0100
Re: bug#69396: [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 69396@debbugs.gnu.org)
87sf1flvip.fsf@gmail.com
Hi Ludo,

Thanks for the prompt review!

Ludovic Courtès <ludo@gnu.org> writes:

[...]

Toggle quote (7 lines)
>> +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.

Toggle quote (12 lines)
>> -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:

Toggle snippet (42 lines)
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

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
L
L
Ludovic Courtès wrote on 27 Feb 10:23 +0100
Re: [bug#69396] [PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 69396@debbugs.gnu.org)
875xyal0qz.fsf@gnu.org
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

Toggle quote (25 lines)
> 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’.
M
M
Maxim Cournoyer wrote on 9 Mar 19:37 +0100
Re: [PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.
(address . 69396-done@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
87bk7ndzf4.fsf@gmail.com
Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (20 lines)
> 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
Closed
?