GNU bug report logs - #69396
[PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sun, 25 Feb 2024 21:20:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: bug#69396: closed (Re: [PATCH core-updates v2] gnu: ld-wrapper:
 Also unset GUILE_LOAD_PATH.)
Date: Sat, 09 Mar 2024 18:40:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 69396 <at> debbugs.gnu.org.

-- 
69396: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69396
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 69396-done <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [PATCH core-updates v2] gnu: ld-wrapper: Also unset
 GUILE_LOAD_PATH.
Date: Sat, 09 Mar 2024 13:37:35 -0500
Hello,

Maxim Cournoyer <maxim.cournoyer <at> 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

[Message part 3 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH.
Date: Sun, 25 Feb 2024 16:17:49 -0500
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 <at> gnu.org>
 ;;; Copyright © 2020 Marius Bakke <mbakke <at> fastmail.com>
+;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer <at> 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




This bug report was last modified 1 year and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.