From patchwork Mon Feb 26 03:57:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 61131 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7A3E427BBEA; Mon, 26 Feb 2024 04:00:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A794F27BBE2 for ; Mon, 26 Feb 2024 04:00:08 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reS9a-0006hL-JR; Sun, 25 Feb 2024 22:59:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reS9Y-0006gk-FY for guix-patches@gnu.org; Sun, 25 Feb 2024 22:59:44 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reS9S-0004xb-QE; Sun, 25 Feb 2024 22:59:42 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reS9r-0006qO-7v; Sun, 25 Feb 2024 23:00:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69396] [PATCH core-updates v2] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. References: In-Reply-To: Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 26 Feb 2024 04:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69396 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69396@debbugs.gnu.org Cc: Maxim Cournoyer , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 69396-submit@debbugs.gnu.org id=B69396.170891996826164 (code B ref 69396); Mon, 26 Feb 2024 04:00:03 +0000 Received: (at 69396) by debbugs.gnu.org; 26 Feb 2024 03:59:28 +0000 Received: from localhost ([127.0.0.1]:52980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reS9H-0006nu-I6 for submit@debbugs.gnu.org; Sun, 25 Feb 2024 22:59:28 -0500 Received: from mail-qk1-f175.google.com ([209.85.222.175]:57593) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reS9B-0006nH-Rh for 69396@debbugs.gnu.org; Sun, 25 Feb 2024 22:59:25 -0500 Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-781753f52afso171581185a.2 for <69396@debbugs.gnu.org>; Sun, 25 Feb 2024 19:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708919870; x=1709524670; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KDaVBz7cUjlcsXQoykcGsBnS0yHwNXrGPEKwpCrAuFk=; b=YFxeGRhrOgfs3XT8EkeHnG34pf2hYenWo+L9PMLmG9Rsj5QdDxwIPubzreHw+ejS5w 53rpMGTehASTedP9zmZ95XrpE/vRmimD5/Aj+nNDO20MaC7wMQpZg/ctgEtDT2ERjmDX 2t7Tc1I2YP8D9VVhddG/2Kxz6i7u03kLqUlizfmUrbX0SzFbYNT7pAYJwbkifw602Vfh uSQSPOsLUSH/9fQZvqN0wQSxM7qyy5o3Bu7VhkklXIY2J0zmT3o9YIDJE0CzzPZAWwqT cn4Ayn1k6hFB/TyYj1KJdiW5lSApatNTOlGXXeRsJyR3l0XfnMBByZ1jyZXc4NQbw7Vq IWNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708919870; x=1709524670; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KDaVBz7cUjlcsXQoykcGsBnS0yHwNXrGPEKwpCrAuFk=; b=XckZIC1sVwaNMYvzI7pOWF7TBytNF2D9ZQlMcrzDVLvLfzkIn7y1YZa2yruQQz1ME2 VB3uFkRpQy+DFELyRKCRT0jnqB8jdq6MjurhY5ir15Fi8oSbNpstUdXf53oEDMQXlwD1 N544gfsCOZe9TAZQHQGmLQwD61yHQSSY72vGdtWuz2ik/uVNtn6i/++coDxc1XHxQIJ9 k3H3+LIpG5GlEVa3cTJ0VoYEliEg3YB45EbgbCh+dqjL6Ei11LiDgHhTFyIxMw/iEVmn 2uDDcHwq8gP7Tgp0LstWCtFhGniCiD5SY8+M43QbH6Xo8SA1ACnbcGh6KgNbSkgA75lI FiFg== X-Gm-Message-State: AOJu0Yze3yxAP0zoTaE6gdbtdQB5kIIAVO+YqdvwIZukNCqqKpNt9+Az 41uug+gVViLr2czbdDjur3eRnnEG+kKPC1zt1sP9NKyvl2u4dB9YXo+fsIrQ X-Google-Smtp-Source: AGHT+IH2XfSgHdgdZX2u9HSpWmkSgLAGyU57W/9ZJ2B+EWbXjNG+Iy6uz1r8xhrM4+pc7wz/akpNDw== X-Received: by 2002:a05:620a:858:b0:787:5f6d:88a5 with SMTP id u24-20020a05620a085800b007875f6d88a5mr6631231qku.61.1708919870318; Sun, 25 Feb 2024 19:57:50 -0800 (PST) Received: from localhost.localdomain (dsl-141-6.b2b2c.ca. [66.158.141.6]) by smtp.gmail.com with ESMTPSA id t25-20020a05620a0b1900b00787236a4ba7sm2060783qkg.40.2024.02.25.19.57.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 19:57:49 -0800 (PST) From: Maxim Cournoyer Date: Sun, 25 Feb 2024 22:57:07 -0500 Message-ID: <094b2d80c6524440e9b86ec9a3181e28d31f3957.1708919827.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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(-) base-commit: f205179ed2cedf55aa0e046af2d80282f6a74075 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 ). -# Unset 'GUILE_LOAD_COMPILED_PATH' to make sure we do not stumble upon -# incompatible .go files. See -# . +# 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 +# ). +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 ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2024 Maxim Cournoyer ;;; ;;; 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))))