From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SNF3KDupuGPEawEAbAwnHQ (envelope-from ) for ; Sat, 07 Jan 2023 00:05:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +A13KDupuGOcgwAA9RJhRA (envelope-from ) for ; Sat, 07 Jan 2023 00:05:31 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 466CECF22 for ; Sat, 7 Jan 2023 00:05:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDvm1-0005Ps-1F; Fri, 06 Jan 2023 18:05:18 -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 1pDvln-0005KK-UC for bug-guix@gnu.org; Fri, 06 Jan 2023 18:05:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDvlm-0007Ur-Pt for bug-guix@gnu.org; Fri, 06 Jan 2023 18:05:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDvlm-0006jO-9z for bug-guix@gnu.org; Fri, 06 Jan 2023 18:05:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#60566: [PATCH] environment: Fix '--emulate-fhs' option overriding $PATH. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 06 Jan 2023 23:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60566 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: John Kehayias Cc: jman , 60566@debbugs.gnu.org Received: via spool by 60566-submit@debbugs.gnu.org id=B60566.167304624225786 (code B ref 60566); Fri, 06 Jan 2023 23:05:02 +0000 Received: (at 60566) by debbugs.gnu.org; 6 Jan 2023 23:04:02 +0000 Received: from localhost ([127.0.0.1]:56048 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDvkn-0006hf-SQ for submit@debbugs.gnu.org; Fri, 06 Jan 2023 18:04:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDvkl-0006hL-KM for 60566@debbugs.gnu.org; Fri, 06 Jan 2023 18:04:00 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDvkW-0001w1-2W; Fri, 06 Jan 2023 18:03:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Ih1dqGmCL/GWNkSg4Tj0OT8eJuVAh8eI2XlQDhGRCeg=; b=VviPdHV2QaKP1QyyC4tR pH1mJEtLHzoEPIIgPPnJo6abFHcTetaT06fFbOUpx6ru/d9nwCyh6mhiptJc0WbQ5n9iF4NyP3G/a Iu2qjol3ykFuv29nwrudZo5v3D2mMHoe7L0+ZmgqSlUalXinSoim9I3gX9B5jU1YXZdLcI8YpdMIQ ABsasHw55RfgYe/M3Qmi4Trt+Xj1sUEYmOmCXUd8ViUoVb+7CAtzHE+XABG5m/uMS+nTuOU2RUKiH LNKgLm9sqpM+RM9PZVS+0O0fc0hzRoB62I2THR5/Z/EGqet9hnYs6bUt4Tt4qUrMzwTjCfYk/gohg 3CpcMjU1GlCdDQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDvkV-0006xa-HB; Fri, 06 Jan 2023 18:03:43 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <874jt4k7bl.fsf@protonmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 18 =?UTF-8?Q?Niv=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour de la Pierre =?UTF-8?Q?=C3=A0?= chaux X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 07 Jan 2023 00:03:40 +0100 In-Reply-To: <874jt4k7bl.fsf@protonmail.com> (John Kehayias's message of "Thu, 05 Jan 2023 21:19:48 +0000") Message-ID: <874jt3xo37.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673046331; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Ih1dqGmCL/GWNkSg4Tj0OT8eJuVAh8eI2XlQDhGRCeg=; b=EnDfK3zprUv7thUoZTnc7EhqoOWgyIRxx4f2UTyEtxwNLwB4Uf4Z5h/Nkp5Wv6bGtWwyAd WkatzP0jBkw977AOiodmtDtYOwxYn2vDywJlPv4g5bxGfnGKoNtwWxA2XsABCyhrPJc069 B8ATiWH20pfWflgMqFmPpLtfZJGD4W4F9WQxYh3l+UapHCEn9Q0CVrbSLmzgLVxSNvPqo1 k4UOj03SCs4EjmDvMvTEWnAvuRqNF6XR7ss8hI1vE1Y+V1Oz7zt6j07AEdLX6HaioDDLMY vUSFDJKVVQNcK4CL07BpdRTJWsPcVH0hQ4TjBjmYWNkg70xQse2GJirouBeJwg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VviPdHV2; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673046331; a=rsa-sha256; cv=none; b=e+UNKnNNzuuPY7+QSo4FBMIKT8BAM17v67J5UB9rj57pfG7RGoGvqtz8c12E3Ld3/zZBtz +ZAgSVkxesi3imqrUbZS81v34MeoR2ywuCSt7wpCto7WGSdW8Nltsyn7iwpvxCoRlNmJbr xrBSao+ecpDedF5O+ngdnwUoTg+gkSIrzh9RAoTgwbFtIxXehukYK4vonaLAVbtQcSHIPv CuQftEzAZbOe4DKckb8zAcwtbRLDhd77/Wuyvx7miiVru+Y5/yzOMUKQO9f2aQce6OA8wP nEPTQ73jWEUjztXSUu4qAA+F2buoNM2T412mWxTlgraCM9h5P3NIs4zKOgI9OA== X-Spam-Score: -2.96 X-Migadu-Queue-Id: 466CECF22 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=VviPdHV2; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -2.96 X-TUID: SNYpRxd12eLW Hi, John Kehayias skribis: > From 57cdc3a8f9c6451aaf17f1fafae0bcf29faeea03 Mon Sep 17 00:00:00 2001 > From: John Kehayias > Date: Thu, 5 Jan 2023 16:06:19 -0500 > Subject: [PATCH] * environment: Fix '--emulate-fhs' option overriding $PA= TH. > > Fixes where even if "--preserve=3D'^P= ATH$'" > was passed to 'guix shell' it would be replaced by just the FHS directori= es > when '--emulate-fhs' was also set. > > * gnu/scripts/environment.scm (launch-environment): Add the FHS directori= es to > $PATH rather than overriding $PATH completely. > --- > guix/scripts/environment.scm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm > index c7fd8fd340..20fa5850c4 100644 > --- a/guix/scripts/environment.scm > +++ b/guix/scripts/environment.scm > @@ -475,10 +475,11 @@ (define* (launch-environment command profile manife= st > (catch 'system-error > (lambda () > (when emulate-fhs? > - ;; When running in a container with EMULATE-FHS?, override $P= ATH > + ;; When running in a container with EMULATE-FHS?, augment $PA= TH > ;; (optional, but to better match FHS expectations), and gene= rate > ;; /etc/ld.so.cache. > - (setenv "PATH" "/bin:/usr/bin:/sbin:/usr/sbin") > + (setenv "PATH" (string-append "/bin:/usr/bin:/sbin:/usr/sbin:" > + (getenv "PATH"))) To be safe, you need to account for (getenv "PATH") returning #f, and not add a trailing colon in that case. Other than that, I agree this is a valid change because that would be consistent with: --8<---------------cut here---------------start------------->8--- $ PATH=3D/foo $(type -P guix) shell -E ^PATH$ -C coreutils -- env |grep ^PA= TH PATH=3D/gnu/store/pfl0lyqbs557khv7rw90bzp24qp2lqsn-profile/bin:/foo --8<---------------cut here---------------end--------------->8--- Perhaps you can add a line to test it in =E2=80=98tests/guix-environment-container.sh=E2=80=99? Thanks, Ludo=E2=80=99.