From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KHGFO1u/L2LSRwAAgWs5BA (envelope-from ) for ; Mon, 14 Mar 2022 23:19:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SOtmOFu/L2LMMAEAauVa8A (envelope-from ) for ; Mon, 14 Mar 2022 23:19:07 +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 9E1DB48585 for ; Mon, 14 Mar 2022 23:19:07 +0100 (CET) Received: from localhost ([::1]:50604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTt1u-0002JS-PG for larch@yhetil.org; Mon, 14 Mar 2022 18:19:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTt1q-0002JJ-V3 for guix-patches@gnu.org; Mon, 14 Mar 2022 18:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTt1q-00060S-Me for guix-patches@gnu.org; Mon, 14 Mar 2022 18:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTt1q-0003pD-Cr for guix-patches@gnu.org; Mon, 14 Mar 2022 18:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54375] Mutable guix shell environments Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Mar 2022 22:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54375 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Maxime Devos Cc: 54375@debbugs.gnu.org, Charles Received: via spool by 54375-submit@debbugs.gnu.org id=B54375.164729632614679 (code B ref 54375); Mon, 14 Mar 2022 22:19:02 +0000 Received: (at 54375) by debbugs.gnu.org; 14 Mar 2022 22:18:46 +0000 Received: from localhost ([127.0.0.1]:46706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTt1Z-0003oh-OF for submit@debbugs.gnu.org; Mon, 14 Mar 2022 18:18:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTt1Y-0003oS-AC for 54375@debbugs.gnu.org; Mon, 14 Mar 2022 18:18:44 -0400 Received: from [2001:470:142:3::e] (port=52864 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTt1S-0005wH-FK; Mon, 14 Mar 2022 18:18:38 -0400 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=bQbOHFi1qwZwTSAfhvsvUgtH7asciTEnfdUPdK/c2C8=; b=EDmf9LTHQrwzJ0bjX1YK SKPfVxkbuPgXELYGB3niujXbneCK5R1zpWiL34sEkKV59XUh7C8vzeJyX6wSRPTht1N2ZtDxXKXrG ZBMC9xEBNzln4cqOkmnjl3Ao50nD+AWc3BFxtysMxrGGHNqUGcVxB1c5I7RSNbz/k0B0y8Yk+E7XH 4EPUmhbdCig3H6iomHjuHrKWKcK//eYwgYuXcyIi5oKMaA8mAGWeWLb4y4oy64jUzI+IxWJSm17OD mv/A1i/19wvpyn7Lhgkv593EaU12rGU0Mw9DmJJtPu/BXNQU9xkSLamf6fMzuRfkMHYNZP5hpT8zQ cuOPGav/KRN2mw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56449 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTt1S-0006sO-2s; Mon, 14 Mar 2022 18:18:38 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <6aaf3dfaa6c207b2968b756fa86806232227e2be.camel@telenet.be> Date: Mon, 14 Mar 2022 23:18:35 +0100 In-Reply-To: <6aaf3dfaa6c207b2968b756fa86806232227e2be.camel@telenet.be> (Maxime Devos's message of "Mon, 14 Mar 2022 18:54:52 +0100") Message-ID: <87pmmop490.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.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: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647296347; 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=bQbOHFi1qwZwTSAfhvsvUgtH7asciTEnfdUPdK/c2C8=; b=XsQx1YdzmG47lfwXYO7cDnoE5t+30QzWEKuBUBn8k5o13VY6TP3TP5LUgzs8dTUKS3zZiR IAHVbiBlKq4RZK9jxYgOccOyIuIVxWmUGnT0uCzrS+akVK8rnhpFZ+K19PN/23wst9FJo4 9FUM3pvA0VBfJVyDVPgF2+HK1A30TJHXu1/fofyw25I2HL9gEnbsbTJH/4kMC1ri/9mvCB YI1Vw5U2lrN1sTa7sBZYve7MS/Wr+VbO4O/nW+2bukSvDGEaCF2CtYUKhjzwZPg5O53I5L dtEDOBTr9Qsu2ykhDX/MbSgVfQQWZbDeEazvdu82TKyXGJ4EN2yus3eEEoxfzA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647296347; a=rsa-sha256; cv=none; b=JMxcbHpMbN53OcyUdOSSguW/QAuzI13e7OIkklgW5JFaWG1KgJ/e3yqFd/+vNILVCf6u+7 tqkM/6zmEnlrXWsZioSnTeBQ4I44pdJHNrH7Ssc72xNYTjTmPdVh3l9xzWb91jqDWsD9Hm 2XI04vj/7aEE98QZtjY1Rjdn0whQ6tU3+wrtqN92r1usfsEWNDFJ8H7c1y7TBkYef/atAx SdLfOurT7vcnqJjuWLIzbgq8ek2G0wytcmCaIyNad1UMO8y2As5S0Y1xhMrOhbeJDEEitr ndkndj+i/AwGt7WF8cHp14vsSIFvm7z+prll8Fa8hsiqTWbNJ1KW4wh1qnlR0w== 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=EDmf9LTH; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=EDmf9LTH; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9E1DB48585 X-Spam-Score: -4.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: 85u8Q6Ai5Z1N Hi, Maxime Devos skribis: > Charles via Guix-patches via schreef op zo 13-03-2022 om 18:21 [+0000]: >> sample useage: >> $ cd project >> $ guix package --manifest=3Dmanifest.scm --profile=3D.guix-profile >> $ guix shell # --profile=3D.guix-profile is implicit > > Alternative suggestion, which IMHO fits the non-persistent naturre of > "guix shell" better: > > $ cd project > $ guix shell --allow-temporary-modifications # fails on read-only file sy= stems Or =E2=80=98--transient=E2=80=99. > $ echo $GUIX_ENVIRONMENT > # a temporary (mutable) profile was created >> $HOME/.cache/.../profile > # install things in the $GUIX_ENVIRONMENT profile > $ guix install foo bar ...=20 > > As noted by lilyp, this won't work in all situations due to search path > issues. These could be resolved by always setting a few search paths > (PATH, EMACSLOADPATH, GUILE_LOAD_PATH, INFOPATH, ...) (even in not curren= tly > present in the profile!), at cost of having to make them =E2=80=98magical= =E2=80=99 in some > sense, which ludo does not seem to like IIUC. (This could also be done > for ~/.guix-profile) I like this approach. Charles=E2=80=99 proposal reminds me of =E2=80=98module=E2=80=99, a venerab= le =E2=80=9Cenvironment management=E2=80=9D tool widely used in high-performance computing (HPC): http://modules.sourceforge.net/ That command allows for an incremental style like Charles proposes: module load gcc # adds GCC to $PATH module load libgc # adds libgc to $C_INCLUDE_PATH module unload libgc # removes libgc from $C_INCLUDE_PATH For this to work though, =E2=80=98module=E2=80=99 is actually a shell funct= ion: that lets it adjust environment variables here and now. Anyway, I digress=E2=80=A6 I thought about this other approach: 1. =E2=80=98guix shell=E2=80=99 always builds a new profile, as it alread= y does. 2. When =E2=80=98GUIX_ENVIRONMENT=E2=80=99 is defined, it computes search= paths as a combination of the new profile and that pointed to by $GUIX_ENVIRONMENT. 3. It spawns a new shell, like it already does. Thus, instead of doing upfront: guix shell a b c One could do: $ guix shell a [env]$ guix shell b [env]$ guix shell c It is more accurate but less flexible than what you propose though, because only child processes of the nested shells would see the =E2=80=9Cchanges=E2=80=9D. So maybe not a good idea, after all. Hmm, need more thought=E2=80=A6 Thanks, Ludo=E2=80=99.