From patchwork Sun Feb 25 21:17:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 61122 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 1A8C327BBE2; Sun, 25 Feb 2024 21:20:21 +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=unavailable 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 6AA5327BBE9 for ; Sun, 25 Feb 2024 21:20:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reLum-0004Tb-VK; Sun, 25 Feb 2024 16:20:06 -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 1reLue-0004RH-6I for guix-patches@gnu.org; Sun, 25 Feb 2024 16:19:57 -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 1reLuL-0002PX-6T; Sun, 25 Feb 2024 16:19:37 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reLuk-0000rf-2j; Sun, 25 Feb 2024 16:20:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69396] [PATCH core-updates] gnu: ld-wrapper: Also unset GUILE_LOAD_PATH. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Sun, 25 Feb 2024 21:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 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-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by submit@debbugs.gnu.org id=B.17088959673218 (code B ref -1); Sun, 25 Feb 2024 21:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2024 21:19:27 +0000 Received: from localhost ([127.0.0.1]:49852 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reLuA-0000pm-4K for submit@debbugs.gnu.org; Sun, 25 Feb 2024 16:19:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:43914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reLu7-0000pa-7I for submit@debbugs.gnu.org; Sun, 25 Feb 2024 16:19:24 -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 1reLth-0004D1-VS for guix-patches@gnu.org; Sun, 25 Feb 2024 16:18:57 -0500 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reLtg-0002Bl-BC for guix-patches@gnu.org; Sun, 25 Feb 2024 16:18:57 -0500 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-42e848fc6f6so2226311cf.2 for ; Sun, 25 Feb 2024 13:18:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708895935; x=1709500735; darn=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=szz3EFQQUO6kJPWR7IBElWgNnYesthDRVLTFewA0l/c=; b=H8SmUf/d8WaQ0IK8AGhBwLSlGDQQL/6HBJktliMc14f6akQOlS5itVRBShBbZ/ON69 /W9klKxa4d6m7NeVS0WUxfkoKjrTC937nyLGpHIdhGx5IF/bG11hHX2SbkntaJ/ZJQr9 qYZSLsmAmYtFjikH8xpF1Q8DlaPo8U/S0IBlQqrpbnED83xHiInU6Vh6ZeXdhE9dItdr KNLnhtPL5B5qeSq1zLfigQgGiWd6IW9yoWfy0XO8tGdVlfKs+kx0kjB3f46ha7Ji4zCU HBthrsXjTXax+juAqzmnXy6cQ2xCyDWXO/Uu+yGa1MWiGDjTr6/VNGeJgP6ocK2skI+f lsGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708895935; x=1709500735; 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=szz3EFQQUO6kJPWR7IBElWgNnYesthDRVLTFewA0l/c=; b=kyD7UDeSFUVGH/xOTCdhHjoh+oSNmDXV6Yrii2ZKu3vbSDv5MpfdFalnAlr7H1UR6P VmOqnNSwnsYg85rVJDfzHyBcJuvHjjSiw+xz+lCsrT2qMZklokN8tbA8B+dGUDz+Aca3 2G4soVUtio111mJ+kSGlcAC3xXSVJIwxEHavFaxymTY+6ppINJZ7h82GITbg4f0PpA3P nq/xremUbdpM9GroMqR60hEsDoElO23/hRIYEP7HnrAu0VQdGRu7+AoAXJlA9PX9tPe0 ZdjalLGkvm6RWE9AiosP1VlxIGT6Mt0cdkblUaSVsQk6dECOOrC58W7e1UtCU6vcAWtB K4SQ== X-Gm-Message-State: AOJu0Yz1CZrWY3iDJfOMxvqg8+ldMLlkpHK9smAmyEJ8ukKwG2VZQDnA 4qcOW6i4n9hNMtl0AZHp5Qn9n/6HQ8a/EzerGCbgcL1YrRlKz3k+zIm0KRr4 X-Google-Smtp-Source: AGHT+IGd5E8SZZfFUhm97iCssvxi93w/S5HUBOnCIbCdf9bQEF8mbhS/4AtcTJRPpdXFpdXwkpXrmA== X-Received: by 2002:ac8:5c44:0:b0:42e:60af:b63f with SMTP id j4-20020ac85c44000000b0042e60afb63fmr4519796qtj.50.1708895934688; Sun, 25 Feb 2024 13:18:54 -0800 (PST) Received: from localhost.localdomain (dsl-141-6.b2b2c.ca. [66.158.141.6]) by smtp.gmail.com with ESMTPSA id ow7-20020a05620a820700b00787b8e49d9fsm1803261qkn.14.2024.02.25.13.18.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 13:18:54 -0800 (PST) From: Maxim Cournoyer Date: Sun, 25 Feb 2024 16:17:49 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::829; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x829.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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 --- gnu/packages/ld-wrapper.in | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) base-commit: f205179ed2cedf55aa0e046af2d80282f6a74075 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 ). -# 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 -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 ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2024 Maxim Cournoyer ;;; ;;; 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))))