From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oEJ3Ck8/t2MgDgAAbAwnHQ (envelope-from ) for ; Thu, 05 Jan 2023 22:21:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MCmnCU8/t2MuPQEAG6o9tA (envelope-from ) for ; Thu, 05 Jan 2023 22:21:19 +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 E9577199BE for ; Thu, 5 Jan 2023 22:21:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDXfd-00049S-Mr; Thu, 05 Jan 2023 16:21:05 -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 1pDXfa-00049C-Qp for bug-guix@gnu.org; Thu, 05 Jan 2023 16:21:02 -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 1pDXfa-0005HS-Hz for bug-guix@gnu.org; Thu, 05 Jan 2023 16:21:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDXfa-0007jk-E1 for bug-guix@gnu.org; Thu, 05 Jan 2023 16:21:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#60566: [PATCH] environment: Fix '--emulate-fhs' option overriding $PATH. References: <875ydl29rj.fsf@city17.xyz> In-Reply-To: <875ydl29rj.fsf@city17.xyz> Resent-From: John Kehayias Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 05 Jan 2023 21:21: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: jman Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 60566@debbugs.gnu.org Received: via spool by 60566-submit@debbugs.gnu.org id=B60566.167295360729650 (code B ref 60566); Thu, 05 Jan 2023 21:21:02 +0000 Received: (at 60566) by debbugs.gnu.org; 5 Jan 2023 21:20:07 +0000 Received: from localhost ([127.0.0.1]:53119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDXeh-0007i9-2G for submit@debbugs.gnu.org; Thu, 05 Jan 2023 16:20:07 -0500 Received: from mail-4316.protonmail.ch ([185.70.43.16]:34693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDXef-0007hZ-Er for 60566@debbugs.gnu.org; Thu, 05 Jan 2023 16:20:06 -0500 Date: Thu, 05 Jan 2023 21:19:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1672953599; x=1673212799; bh=2AWHj3SpL/+f9uEnCZyykpXGb1qEUbH3jCKLQdfOpWw=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=d49KsW+xJMf3e5vmU0G9jPjdnyrhL+fyrvj12skRhvJZ0v/Rq1rWQJe3X2F+ymW7s MaVMsX4q4nkM/alajaMv4sMbnz9rORW7JJHgSMGD8TGcfhFeKhRYsy3cE5v4csuVvI lsZin3zT6u0YhdGHTGkqqwOtSz3x6j8mCU5nK9rslOa0OSdnfoKlXtBr3ytPnD0aMK SVNnWNh7OiX1FT6MMRyq2MQn4uLIr6L2R1J03QF/WTMuFlFTkwPwf8CTiaYmUX1o6g VeBmN8kB8OW/AHBPJwf82tkTbDuBwBT//1A3AAusoxarsV2mAbLW6NKktzYhr1CNgQ a+eMQf3nX1QTQ== Message-ID: <874jt4k7bl.fsf@protonmail.com> Feedback-ID: 7805494:user:proton MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_RV1TpXWIsrsgjcgv85zInVOorKVVwMQXqcBXwKv49Y" 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: , Reply-to: John Kehayias From: John Kehayias via Bug reports for GNU Guix 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-Seal: i=1; s=key1; d=yhetil.org; t=1672953679; a=rsa-sha256; cv=none; b=JQ60TRZ/jYZYhQ2mO4u4Ykh9nSlCyTtTmOdjtlNB47MnrTL8MTwGwXM5i0Kkh457aYwjro cu5iPOoHyeeW0hYzmWJAav/aAIU6i1Cqmwl0xLOFxfmGGXsGLTKM+VdT/jN+tPWw07uDRw gy4QVcD+UZKWMMd0UJa8SRBt6y0wv8tpMSrsJdPcq6MIa28e4LAstvNE/UblGz6XU8MfNX 4xxi6gKaK5IQop/n/OXle42ZtnKCT/XyyNc+CDWXwCwGGlY1JLP0iaD/RdpGJP4Q/8ZmKW Qhu0WtHh6gy0PaUTa6+lWe2fx8Mu4XYn6/4RELtLdWIdZB9qrUnqls2QOX30Jg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail3 header.b=d49KsW+x; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672953679; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=2AWHj3SpL/+f9uEnCZyykpXGb1qEUbH3jCKLQdfOpWw=; b=XF9fWzMJFcu8WFiRmGDKE3bUb9NqhPD2/SoFa5wGyxixIr2i/Hp/VAo1jDyHnu1kaXB4wl 9DGMMKBaZULFfxRd6fuN/nBgojHDCAh4+JuPe2KczKclHUOdXk40uTSmRcJCKus+bRF+li xUFjeLfAd0jKLVDVdQlGxi/r3c/NqWEonluwq6XkOwifp0L1GvU74DTze+tSvCxqRJj6NG toFSrGruKFML7QuNK40Zgtelt1fV+A6YN/+Cb9KdmFYoh8xXyIdIoCdOPgTPffgeTKYrY/ nj509fnseUy4i0Oreyhg7GoaJzzvcnuT0bJ8J27rpwFbXVwzJF18pfyVO5fjRw== X-Spam-Score: -0.46 X-Migadu-Queue-Id: E9577199BE Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail3 header.b=d49KsW+x; 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: scn0.migadu.com X-Migadu-Spam-Score: -0.46 X-TUID: GxWGihZgPrJk This is a multi-part message in MIME format. --b1_RV1TpXWIsrsgjcgv85zInVOorKVVwMQXqcBXwKv49Y Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Wed, Jan 04, 2023 at 11:33 PM, jman wrote: > Hello, > > When emulating a FHS I observe that env vars seems to be not preserved. E= xample, > the following command will not preserve $PATH: > > guix shell --container --emulate-fhs --preserve=3D'^PATH$' > > When creating a container *without* emulating a FHS, env vars are availab= le, > example: > > guix shell --container --preserve=3D'^PATH$' > > Pastebin log of a sample of this behaviour: > https://paste.sr.ht/~jman/65e7f96c445504e11f55595b237280e0c1e3ad34 > > ref: https://lists.gnu.org/archive/html/help-guix/2023-01/msg00002.html > > Thanks for an opinion on this Thanks for reporting, I can confirm this behavior. Here is a patch for this where the FHS directories are added to the current value of $PATH. I believe this should in general be fine since this is the last step before actually calling the command given to 'guix shell' and thus $PATH has been set or preserved as needed already. CC'ing Ludo as most familiar with this code. Anything we should be aware of here? This change to $PATH in the first place wasn't strictly needed ('guix shell' already has the profile bin directory) but I thought made sense to make it look most like FHS. Thanks! John --b1_RV1TpXWIsrsgjcgv85zInVOorKVVwMQXqcBXwKv49Y Content-Type: text/x-patch; name=0001-environment-Fix-emulate-fhs-option-overriding-PATH.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-environment-Fix-emulate-fhs-option-overriding-PATH.patch RnJvbSA1N2NkYzNhOGY5YzY0NTFhYWYxN2YxZmFmYWUwYmNmMjlmYWVlYTAzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQ0KRnJvbTogSm9obiBLZWhheWlhcyA8am9obi5rZWhheWlhc0Bwcm90b25t YWlsLmNvbT4NCkRhdGU6IFRodSwgNSBKYW4gMjAyMyAxNjowNjoxOSAtMDUwMA0KU3ViamVjdDog W1BBVENIXSAqIGVudmlyb25tZW50OiBGaXggJy0tZW11bGF0ZS1maHMnIG9wdGlvbiBvdmVycmlk aW5nICRQQVRILg0KDQpGaXhlcyA8aHR0cHM6Ly9pc3N1ZXMuZ3VpeC5nbnUub3JnLzYwNTY2PiB3 aGVyZSBldmVuIGlmICItLXByZXNlcnZlPSdeUEFUSCQnIg0Kd2FzI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IEVNVUxBVEUtRkhTPywg YXVnbWVudCAkUEFUSA0KICAgICAgICAgICAgOzsgKG9wdGlvbmFsLCBidXQgdG8gYmV0dGVyIG1h dGNoIEZIUyBleHBlY3RhdGlvbnMpLCBhbmQgZ2VuZXJhdGUNCiAgICAgICAgICAgIDs7IC9ldGMv bGQuc28uY2FjaGUuDQotICAgICAgICAgICAoc2V0ZW52ICJQQVRIIiAiL2JpbjovdXNyL2Jpbjov c2JpbjovdXNyL3NiaW4iKQ0KKyAgICAgICAgICAgKHNldGVudiAiUEFUSCIgKHN0cmluZy1hcHBl bmQgIi9iaW46L3Vzci9iaW46L3NiaW46L3Vzci9zYmluOiINCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChnZXRlbnYgIlBBVEgiKSkpDQogICAgICAgICAgICAoaW52 b2tlICJsZGNvbmZpZyIgIi1YIikpDQogICAgICAgICAgKGFwcGx5IGV4ZWNscCBwcm9ncmFtIHBy b2dyYW0gYXJncykpDQogICAgICAgIChsYW1iZGEgXw0KLS0gDQoyLjM4LjENCg0K --b1_RV1TpXWIsrsgjcgv85zInVOorKVVwMQXqcBXwKv49Y--