GNU bug report logs - #50960
[PATCH 00/10] Add 'guix shell' to subsume 'guix environment'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Ludovic Courtès <ludo@HIDDEN>; Keywords: patch; dated Sat, 2 Oct 2021 10:22:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 13 Oct 2021 16:51:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 13 12:51:22 2021
Received: from localhost ([127.0.0.1]:33229 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mahTN-0006kk-V4
	for submit <at> debbugs.gnu.org; Wed, 13 Oct 2021 12:51:22 -0400
Received: from pelzflorian.de ([5.45.111.108]:38090 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1mahTI-0006kY-22
 for 50960 <at> debbugs.gnu.org; Wed, 13 Oct 2021 12:51:21 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 885A5360AEE;
 Wed, 13 Oct 2021 18:51:14 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1634143874;
 bh=FvsGab3aUgbRRY7qAK5wz75NR5kwEaoWqzQhj0yMbdw=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=Vo/6jzeEaDDM7ZnBcCn6y2rRm9+G6hQE6tbFupQdN04C2iFsrG1RAnr8HKvyrB8Xq
 T1neBdZIZu56s97LyVCd9VeFmGmsw5PVD8vc4lr0avU8WmMOxQ5Fx1m5lC/SI4kNdd
 2a9IJEy34FDZw+304a+VBcIyUF5CpFUEVLu5z7/Y=
Date: Wed, 13 Oct 2021 18:51:04 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 03/11] Add 'guix shell'.
Message-ID: <20211013165104.nlzlz7npsxcpbsjn@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211011213809.17482-4-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20211011213809.17482-4-ludo@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org,
 Ludovic =?utf-8?Q?Court=C3=A8s?= <ludovic.courtes@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello Ludo!

When I pull, I can’t use guix shell, perhaps because you did not add
it to guix/self.scm?

I like that the new documentation does not target only developers and
hackers.

On Mon, Oct 11, 2021 at 11:38:01PM +0200, Ludovic Courtès wrote:
> […]
> +The general syntax is:
> +
> +@example
> +guix shell [@var{options}] [@var{package}@dots{}]
> +@end example
> +
> +The following example creates a environment containing Python and NumPy,

*an* environment


> +building and downloading any missing package, and runs the

building *or* downloading


> […]
> +By default, the shell session or command runs in an @emph{augmented}
> +environment, where the new packages are added to search path environment
> +variables such as @code{PATH}.  You can, instead, choose to create an
> +@emph{isolated} environment containing nothing but the packages you

Hmmph.  I had seen the words “isolated environment” being used to
describe containers in "(guix)Managing Software the Guix Way".

Therefore I also had used the German term for “isolated” to explain
containers in other parts of the manual.  Probably this was not
necessary; if you apply guix shell with this term, I will change all
occurrences of “isoliert” in the German PO files.

But then again, maybe it would be better if you described pure
environments not as isolated.  I also see a mix-up further below:


> +This @option{--container} option can also prove useful if you wish to
> +run a security-sensitive application, such as a web browser, in an
> +isolated environment.  For example, the command below launches
> +Ungoogled-Chromium in an isolated environment, this time sharing network
> +access with the host and preserving its @code{DISPLAY} environment
> +variable, but without even sharing the current directory:
> +
> +@example
> +guix shell --container --network --no-cwd ungoogled-chromium \
> +  --preserve='^DISPLAY$' -- chromium
> +@end example
> […]

Back to typos:

> +@node Invoking guix environment
> +@section Invoking @command{guix environment}
> +
> +The purpose of @command{guix environment} is to assists in creating

is to *assist*

So much for the docs.  I have not looked further.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 12:02:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 08:02:04 2021
Received: from localhost ([127.0.0.1]:33730 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maGTr-0004Bu-3b
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 08:02:04 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:46062)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1maGTm-000443-7y
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 08:02:02 -0400
Received: by mail-wr1-f51.google.com with SMTP id r10so66282098wra.12
 for <50960 <at> debbugs.gnu.org>; Tue, 12 Oct 2021 05:01:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-transfer-encoding;
 bh=Mx+HOmDNWcAjwBRn3yCTeCT8uPwqPxoWhSP5NHZcg0I=;
 b=bpFhFdCCOm8A0T7+vbj9J+JJKB7pR0L5aoDodkXc2AzHc9U+Um7lkLPCt7ySEnLtVm
 G7ghCXdYZuuXj6uHGQBx+bAUf0VmnJwM4/TrYpLTrBW3F68tYcWQpy6+f4p1eHxEn39m
 63J2CW8kxGyY/axRv9vMWNUmTafH7pfbZcd9FaQZRgdId0No2Do+avRKX6KhOIolY1Ij
 z+p7FsXhFhHBFsIf8GjyrokoAqKJE/96j+9wBYwp7R7+PyFQn/gTNe/Af93a8iWXE2da
 bhmx9j00hoSkP1f5jBz4u97t3IKOLpH8eI5WWrMFa32qP2twIsPzRqlfWugPIL7yiX/d
 wzHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=Mx+HOmDNWcAjwBRn3yCTeCT8uPwqPxoWhSP5NHZcg0I=;
 b=Qpu51gdmEB5ajf6gO9R0CLilrFbfXXEbh78cyqCsYhbraI4KG5+EQ7+E/UvGxKLa/N
 iYLMiEHcbtr9oTY+3pS7G1ofAFytOCuROiejPWYLXmhaE6+/8s/cDKCNT2AXyYWxkPe9
 ba3Kx1ZtwwgdqvlQKsegkCiOLNDFjoPBse9m3FurE57MbaYUTz8DxA37j4GeHuvQx5AF
 a+O3NSih2GC1Z44jpBVSZ6vLy0FbBlJTA/4d/ZTxo8ctEohBkE+RaRPE86wHSb3FbDpJ
 Z+VPPK5rZeQWyI7ffNHIrSRRHdQX+ndg2lyg/yzIvUUDFZ2MspmybXe4hRvt5EBKJ3RS
 EHhw==
X-Gm-Message-State: AOAM531/hSlcW28R+rrjH2IDOg3BQl3VcaJ0bJaZodtmW8nYY/VqZ91a
 /IhmXmQOd7bCkSIPst/LoxYrK7EgeqOJEg==
X-Google-Smtp-Source: ABdhPJzup1gFcwT7e9h7Xwlrby502dDy2F0s57eywfIUjUwaTZaVIBEilISqf9K8krUWEchByKFuPw==
X-Received: by 2002:a5d:4a46:: with SMTP id v6mr30714604wrs.262.1634040112307; 
 Tue, 12 Oct 2021 05:01:52 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id j16sm2626512wms.16.2021.10.12.05.01.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 12 Oct 2021 05:01:51 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 01/11] packages: Add
 'package-development-inputs'.
In-Reply-To: <87v922va9b.fsf@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211011213809.17482-2-ludo@HIDDEN> <86czoaoigo.fsf@HIDDEN>
 <87v922va9b.fsf@HIDDEN>
Date: Tue, 12 Oct 2021 13:52:45 +0200
Message-ID: <86y26ylasy.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


On Tue, 12 Oct 2021 at 11:54, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
> zimoun <zimon.toutoune@HIDDEN> skribis:
>
>>> +(define* (package-development-inputs package
>>> +                                     #:optional (system (%current-syst=
em))
>>> +                                     #:key target)
>>> +  "Return the list of inputs required by PACKAGE for development purpo=
ses on
>>> +SYSTEM.  When TARGET is true, return the inputs needed to cross-compile
>>> +PACKAGE from SYSTEM to TRIPLET, where TRIPLET is a triplet such as
>>> +\"aarch64-linux-gnu\"."
>>> +  (bag-transitive-inputs (package->bag package system target)))
>>
>> [...]
>>
>>>    ;; Remove non-package inputs such as origin records.
>>>    (filter-map input->manifest-entry
>>> -              (bag-transitive-inputs (package->bag package))))
>>> +              (package-development-inputs package system)))
>>
>> Why =E2=80=99system=E2=80=99 is used here?  Why is not simply?
>>
>>  +              (package-development-inputs package)))
>>
>> because =E2=80=99system=E2=80=99 should be not defined, or I do not know=
 where IIUC.
>
> It=E2=80=99s an optional parameter above.

Sorry if I miss, to me, =E2=80=99system=E2=80=99 is not bounded when callin=
g:

--8<---------------cut here---------------start------------->8---
   ;; Remove non-package inputs such as origin records.
   (filter-map input->manifest-entry
-              (bag-transitive-inputs (package->bag package))))
+              (package-development-inputs package system)))
--8<---------------cut here---------------end--------------->8---

and it seems bounded to something:

    ;;; (#<procedure system (#:optional _)>)=E2=80=9D

and I do not know from where this definition comes.

Maybe I misread what optional means.  From my understanding, it means:

    (package-development-inputs foo)

will use =E2=80=99(%current-system)=E2=80=99 as default.  And it also means=
 that:

    (package-development-inputs foo system)

where =E2=80=99system=E2=80=99 is bounded to something and from my understa=
nding this
something is not necessary =E2=80=99(%current-system)=E2=80=99.


Again, sorry if I misread something.

Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 09:55:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 05:55:56 2021
Received: from localhost ([127.0.0.1]:33540 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maEVo-00015l-Mt
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 05:55:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1maEVm-00015Z-Ou
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 05:55:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60070)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1maEVf-0005cI-Mg; Tue, 12 Oct 2021 05:55:49 -0400
Received: from [193.50.110.91] (port=34620 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1maEVR-0000uP-A0; Tue, 12 Oct 2021 05:55:46 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 00/11] 'guix shell' strikes again
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211012085346.v56ck7fzsfuscto6@HIDDEN>
 <20211012085756.nfhgz55lqhgt6bdq@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 21 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Tue, 12 Oct 2021 11:55:31 +0200
In-Reply-To: <20211012085756.nfhgz55lqhgt6bdq@HIDDEN>
 (pelzflorian@HIDDEN's message of "Tue, 12 Oct 2021 10:57:56
 +0200")
Message-ID: <87r1cqva7g.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

"pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:

> On Tue, Oct 12, 2021 at 10:53:55AM +0200, pelzflorian (Florian Pelz) wrot=
e:
>> On Mon, Oct 11, 2021 at 11:37:58PM +0200, Ludovic Court=C3=A8s wrote:
>> >   =E2=80=A2 Auto-loading happens if and only if the containing directo=
ry
>> >     is listed in ~/.config/guix/shell-authorized-directories, as
>> >     suggested by Florian.
>>=20
>> Liliana Marie Prikler suggested it
>> <https://lists.gnu.org/r/guix-patches/2021-10/msg00380.html>.
>
> Or was it Nicol=C3=B3 Balzarotti?
>
> https://lists.gnu.org/r/guix-patches/2021-10/msg00196.html

My bad, sorry for misattributing it.

Anyhow: big thanks to all of you for providing feedback!  :-)

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 09:54:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 05:54:33 2021
Received: from localhost ([127.0.0.1]:33536 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maEUT-00013g-C7
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 05:54:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44710)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1maEUR-00013T-NO
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 05:54:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60046)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1maEUM-0004bO-Df; Tue, 12 Oct 2021 05:54:26 -0400
Received: from [193.50.110.91] (port=34618 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1maEUM-00051p-4U; Tue, 12 Oct 2021 05:54:26 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 01/11] packages: Add
 'package-development-inputs'.
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211011213809.17482-2-ludo@HIDDEN> <86czoaoigo.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 21 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Tue, 12 Oct 2021 11:54:24 +0200
In-Reply-To: <86czoaoigo.fsf@HIDDEN> (zimoun's message of "Tue, 12 Oct 2021
 08:39:03 +0200")
Message-ID: <87v922va9b.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

zimoun <zimon.toutoune@HIDDEN> skribis:

>> +(define* (package-development-inputs package
>> +                                     #:optional (system (%current-syste=
m))
>> +                                     #:key target)
>> +  "Return the list of inputs required by PACKAGE for development purpos=
es on
>> +SYSTEM.  When TARGET is true, return the inputs needed to cross-compile
>> +PACKAGE from SYSTEM to TRIPLET, where TRIPLET is a triplet such as
>> +\"aarch64-linux-gnu\"."
>> +  (bag-transitive-inputs (package->bag package system target)))
>
> [...]
>
>>    ;; Remove non-package inputs such as origin records.
>>    (filter-map input->manifest-entry
>> -              (bag-transitive-inputs (package->bag package))))
>> +              (package-development-inputs package system)))
>
> Why =E2=80=99system=E2=80=99 is used here?  Why is not simply?
>
>  +              (package-development-inputs package)))
>
> because =E2=80=99system=E2=80=99 should be not defined, or I do not know =
where IIUC.

It=E2=80=99s an optional parameter above.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 09:27:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 05:27:36 2021
Received: from localhost ([127.0.0.1]:33511 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maE4O-0000NZ-No
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 05:27:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39084)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1maE4N-0000NO-PP
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 05:27:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:56930)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1maE4I-0002l7-Ca; Tue, 12 Oct 2021 05:27:30 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=50942 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1maE4E-00031C-5a; Tue, 12 Oct 2021 05:27:30 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 02/11] profiles: Add
 'package->development-manifest'.
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211011213809.17482-3-ludo@HIDDEN> <868ryyoi8q.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 21 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Tue, 12 Oct 2021 11:27:24 +0200
In-Reply-To: <868ryyoi8q.fsf@HIDDEN> (zimoun's message of "Tue, 12 Oct 2021
 08:43:49 +0200")
Message-ID: <878ryyy4n7.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

zimoun <zimon.toutoune@HIDDEN> skribis:

> (These patch 1 and 2 could be applied independently of the new =E2=80=9Cg=
uix
> shell=E2=80=9D command. :-))

Yes, definitely; actually most of the patches are independent of =E2=80=98g=
uix
shell=E2=80=99.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 08:58:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 04:58:10 2021
Received: from localhost ([127.0.0.1]:33458 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maDbu-00086A-0J
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 04:58:10 -0400
Received: from pelzflorian.de ([5.45.111.108]:33922 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1maDbp-000860-Fn
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 04:58:09 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 6C36436069D;
 Tue, 12 Oct 2021 10:58:04 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1634029084;
 bh=S2V8R7E3TlWvAfuraUgP0/MNfWf9vuypToJUocfw7uU=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=NmzeE/yHbelt5eAj2b82IIm2rZf7/xKHB93iqxCRxTjBAR8bvoAOk+xHhva2Jwy6G
 LtAKDvuqpUjSAgpzxF1poY5s9xMlRaoZtjZWrlKxyyx4fPioE0rwyV870vuLCmfJ6J
 0a8tM/4rDhUpd5ey8+z2xRDT1Sd2VLUWH+ZWUbDI=
Date: Tue, 12 Oct 2021 10:57:56 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 00/11] 'guix shell' strikes again
Message-ID: <20211012085756.nfhgz55lqhgt6bdq@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211012085346.v56ck7fzsfuscto6@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20211012085346.v56ck7fzsfuscto6@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Tue, Oct 12, 2021 at 10:53:55AM +0200, pelzflorian (Florian Pelz) wrote:
> On Mon, Oct 11, 2021 at 11:37:58PM +0200, Ludovic Courtès wrote:
> >   • Auto-loading happens if and only if the containing directory
> >     is listed in ~/.config/guix/shell-authorized-directories, as
> >     suggested by Florian.
> 
> Liliana Marie Prikler suggested it
> <https://lists.gnu.org/r/guix-patches/2021-10/msg00380.html>.

Or was it Nicoló Balzarotti?

https://lists.gnu.org/r/guix-patches/2021-10/msg00196.html

Enough confusion.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 08:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 04:53:59 2021
Received: from localhost ([127.0.0.1]:33454 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maDXr-0007zu-Fe
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 04:53:59 -0400
Received: from pelzflorian.de ([5.45.111.108]:33908 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1maDXp-0007zj-ES
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 04:53:58 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id A6A7236069D;
 Tue, 12 Oct 2021 10:53:55 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1634028835;
 bh=Ad7GZkfeCdNWNTBo+svIjXDLkmhbW6syBAAP70vdOlg=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=kBKQOVB7GMyJqQPR5pMIsm2fBMtDEZxAoTf0BILe9p1Z3JhZHP4HAbxynFbNaaIFG
 gJ7J3UL92iDmlYgZ80nto718ExWgw+cOXTvuFMEz30BdRVzaUgHJTJvDBbV9o0utU8
 q7ekD+MnhUcrtSlFsMTAZ0ACKX/tqhq6J22tdp84=
Date: Tue, 12 Oct 2021 10:53:46 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH v2 00/11] 'guix shell' strikes again
Message-ID: <20211012085346.v56ck7fzsfuscto6@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon, Oct 11, 2021 at 11:37:58PM +0200, Ludovic Courtès wrote:
> Hello Guix!
> 
> Here’s a v2 with the following changes:

Nice!

>   • Auto-loading happens if and only if the containing directory
>     is listed in ~/.config/guix/shell-authorized-directories, as
>     suggested by Florian.

Liliana Marie Prikler suggested it
<https://lists.gnu.org/r/guix-patches/2021-10/msg00380.html>.

>   […]
> How does that sound?  :-)

Much better, thank you!

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 06:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 02:53:59 2021
Received: from localhost ([127.0.0.1]:33321 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maBfj-0002kL-9Q
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 02:53:59 -0400
Received: from mail-wr1-f42.google.com ([209.85.221.42]:42632)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1maBfh-0002k9-Cd
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 02:53:57 -0400
Received: by mail-wr1-f42.google.com with SMTP id v17so63541648wrv.9
 for <50960 <at> debbugs.gnu.org>; Mon, 11 Oct 2021 23:53:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-transfer-encoding;
 bh=nYUYagym0U+8MBvo2KcBYTkli5LwS0c0a7zW1Q+eSjk=;
 b=iBtf352S8bbu1Wu6nexROEZK7ThxZd8T3njesoZu3mgQOwp3JeNa8D4zkrWEaZsDjX
 GRkeMaLjm247NPPnxNGN3MJmA9V1A63gUhMuXeY0WTwE6GfWcIHQc9HbJJ0QP38oHNAX
 v9nZ5lrX4WEJyv/yWucMRZPB51PrqKzwNWuPhRhWny1wwwZfftnqUnUFu7TiUk/G3+vx
 XfaT0wioyQFhOYSDsMA86oTp0o8S4euAgP6fzrqtsM/fmyyaF5CmEVfDLJhZcEGjPM9i
 YAhaDOfooo4lJ8AZOPffSFyZKwSIig2sfdSjHmSLtEQjnpBR+0YzT+AXxUA68kConcW7
 5Pmg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=nYUYagym0U+8MBvo2KcBYTkli5LwS0c0a7zW1Q+eSjk=;
 b=2GIeMxZlQwBVLUeo3J+mDVmGBMF96MAGCX8xDu4tQcQ/hu9Is+aHuukJWWshdd7yp7
 8mvpnIhOhhQ1DxgI2AVftiTqbDZbZL6lsLglJwMlEuP4pzxoXq6tTyEii5xxLWwVw3bQ
 XEs39gxDzHdc0SLsgClKMeJwNW9GfQW+r5haTDaD9eyj+5+zwLY5le2nYsbxtw9+G+yd
 rn0OSKJHKbUnwSVhgnmq0O+FeugWsZSrdwH3bD3E8oEvV+M9iH4yrtBTbdRdGZVVXQrB
 x2zEKCI9WmnGm+zvNoR0StUAEWQuAUpUg+PNLPPsS+DcoDmcWtbSFZx/0+BHZT1BzuoA
 Hmfw==
X-Gm-Message-State: AOAM531L8DxnqERVlBbR4cHShRkAXTRhCq600xVujMQGZOoxo2xhe29v
 H7x0kvOEtCVQB2rC52RZkFY=
X-Google-Smtp-Source: ABdhPJzQJCwQN+OjMKYeIxpo7kIHGSvSo/qOIfB6pFckeE832aLd5fMyF/3H3nUaUwnrrd/auqaOAw==
X-Received: by 2002:a05:600c:4e88:: with SMTP id
 f8mr3640124wmq.185.1634021631468; 
 Mon, 11 Oct 2021 23:53:51 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id a16sm9580880wrp.14.2021.10.11.23.53.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 11 Oct 2021 23:53:51 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Subject: Re: [bug#50960] [PATCH v2 02/11] profiles: Add
 'package->development-manifest'.
In-Reply-To: <20211011213809.17482-3-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211011213809.17482-3-ludo@HIDDEN>
Date: Tue, 12 Oct 2021 08:43:49 +0200
Message-ID: <868ryyoi8q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludovic.courtes@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

On Mon, 11 Oct 2021 at 23:38, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
> From: Ludovic Court=C3=A8s <ludovic.courtes@HIDDEN>
>
> * guix/profiles.scm (package->development-manifest): New procedure.
> * guix/scripts/environment.scm (input->manifest-entry)
> (package-environment-inputs): Remove.
> * guix/scripts/environment.scm (options/resolve-packages): Use
> 'package->development-manifest' instead of 'package-environment-inputs'.
> * tests/profiles.scm ("package->development-manifest"): New test.

LGTM!

(These patch 1 and 2 could be applied independently of the new =E2=80=9Cguix
shell=E2=80=9D command. :-))


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 12 Oct 2021 06:42:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 12 02:42:59 2021
Received: from localhost ([127.0.0.1]:33270 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1maBV5-0002PG-47
	for submit <at> debbugs.gnu.org; Tue, 12 Oct 2021 02:42:59 -0400
Received: from mail-wr1-f44.google.com ([209.85.221.44]:45030)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1maBV3-0002P3-OT
 for 50960 <at> debbugs.gnu.org; Tue, 12 Oct 2021 02:42:58 -0400
Received: by mail-wr1-f44.google.com with SMTP id e3so29898429wrc.11
 for <50960 <at> debbugs.gnu.org>; Mon, 11 Oct 2021 23:42:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-transfer-encoding;
 bh=ZWfrs3dWwpcc73r3QLbyyTu99pVGua3vsqE4smT92lI=;
 b=KtA2K3yA4CWXudPfvTvag3v+UK/1GgAjEIgIEcOVJ8NJWPOD89P2V+HCXv5JpI1YXs
 a9aXX8ARaOjennUI3PCDn8Va7F/zC5d0mn0zJLxZyfMk2uIaUAdEynxkjfkRouZGSgyq
 SDYUqF517bb81fPnHRlszMYryZx92ZPGnJnN2XC2TrKaIwZuFBnM16KtnG6G7fBUSl8A
 AzLirE8HUeqEDV7FRk1F6Nplcb5StJhcvhUXchAxkMR9zQOjUNar+JDfghLXmCdjRXvI
 w0a6gCUbltcM0QMWfAaDdDcvC3zAB92A5OrUow1Z6FF/1ME4gOFZ7LBLpewquxPG7H2w
 PlHA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=ZWfrs3dWwpcc73r3QLbyyTu99pVGua3vsqE4smT92lI=;
 b=3fUcuhFXhg8nia37opCvkh7qDZfktvQbmLQHrTPmFaxAPYPAEk+tS+wrOXKzz3NSoX
 e2wWaYAsaaIBJ16gUB2XOJ1heck/o7FbQo/AoHcg88tuP4XU90ygX42qqs0USmODmGD9
 fNeliZBNDNTlO4qEQqQ6sEynyRkYn+aqye2yTcywgWyJB8fyHFlMy9EClchGUQ6pbmvI
 JbUCuVNuqaby11qMDMVBCmoVyXHVB4T52TKK7hvpeH99yI7Ud4fcCQ4f6dupb4fnVy1n
 yU/rmvifbmCLbiRTwyQB6r23g5SaIWdUXasQQq1//7Pg3cwprQQRYnZI/gsqoUePFoYl
 ps0Q==
X-Gm-Message-State: AOAM5306PYtqxpZaM9GcnzkyVA6v9M5p46GO7SI/sNki59z1fZgtjQcr
 qqGmsdVHry7UwZzKPc5Z81M=
X-Google-Smtp-Source: ABdhPJxCL5wQH1t5DvGZ03qFtWdB8/qUnXYzh0M0alto3HFc37JaTjJkQQMPpKAY8w3wm76ZMkJF/Q==
X-Received: by 2002:adf:bb81:: with SMTP id q1mr29955342wrg.119.1634020971679; 
 Mon, 11 Oct 2021 23:42:51 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id d9sm7570930wrm.96.2021.10.11.23.42.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 11 Oct 2021 23:42:51 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Subject: Re: [bug#50960] [PATCH v2 01/11] packages: Add
 'package-development-inputs'.
In-Reply-To: <20211011213809.17482-2-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
 <20211011213809.17482-2-ludo@HIDDEN>
Date: Tue, 12 Oct 2021 08:39:03 +0200
Message-ID: <86czoaoigo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

On Mon, 11 Oct 2021 at 23:37, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
> * guix/packages.scm (package-development-inputs): New procedure.
> * guix/scripts/environment.scm (package-environment-inputs): Use it.
> * tests/packages.scm ("package-development-inputs")
> ("package-development-inputs, cross-compilation"): New tests.
> * doc/guix.texi (package Reference): Document it.

LGTM, except=E2=80=A6

>  guix/packages.scm            | 10 +++++++++
>  guix/scripts/environment.scm |  2 +-

[...]

> +(define* (package-development-inputs package
> +                                     #:optional (system (%current-system=
))
> +                                     #:key target)
> +  "Return the list of inputs required by PACKAGE for development purpose=
s on
> +SYSTEM.  When TARGET is true, return the inputs needed to cross-compile
> +PACKAGE from SYSTEM to TRIPLET, where TRIPLET is a triplet such as
> +\"aarch64-linux-gnu\"."
> +  (bag-transitive-inputs (package->bag package system target)))

[...]

>    ;; Remove non-package inputs such as origin records.
>    (filter-map input->manifest-entry
> -              (bag-transitive-inputs (package->bag package))))
> +              (package-development-inputs package system)))

Why =E2=80=99system=E2=80=99 is used here?  Why is not simply?

 +              (package-development-inputs package)))

because =E2=80=99system=E2=80=99 should be not defined, or I do not know wh=
ere IIUC.


Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:54 2021
Received: from localhost ([127.0.0.1]:32920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30X-0001On-EU
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45520)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30H-0001Mo-As
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:38 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40586)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma30C-0004ax-31; Mon, 11 Oct 2021 17:38:32 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma30B-0007Y0-Py; Mon, 11 Oct 2021 17:38:32 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 11/11] shell: Maintain a profile cache.
Date: Mon, 11 Oct 2021 23:38:09 +0200
Message-Id: <20211011213809.17482-12-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

shell: Maintain a profile cache.

With this change, running "guix shell" (no arguments) is equivalent to:

  guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm

This is the cache miss.  On cache hit, it's equivalent to:

  guix environment -p ~/.cache/guix/profiles/some-root

... which can run in 0.1s.

* guix/scripts/shell.scm (options-with-caching): New procedure.
(parse-args): Use it.
(%profile-cache-directory): New variable.
(profile-cache-key, profile-cached-gc-root): New procedures.
(show-help, %options): Add '--rebuild-cache'.
(guix-shell)[cache-entries, entry-expiration]: New procedures.
Add call to 'maybe-remove-expired-cache-entries'.
* doc/guix.texi (Invoking guix shell): Document '--rebuild-cache'.
---
 doc/guix.texi          |  11 ++++
 guix/scripts/shell.scm | 127 ++++++++++++++++++++++++++++++++++++++---
 2 files changed, 130 insertions(+), 8 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index b95025a39f..f3be6b5085 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5768,6 +5768,17 @@ This is similar to the same-named option in @command{guix package}
 (@pxref{profile-manifest, @option{--manifest}}) and uses the same
 manifest files.
 
+@item --rebuild-cache
+When using @option{--manifest}, @option{--file}, or when invoked without
+arguments, @command{guix shell} caches the environment so that
+subsequent uses are instantaneous.  The cache is invalidated anytime the
+file is modified.
+
+The @option{--rebuild-cache} forces the cached environment to be
+refreshed even if the file has not changed.  This is useful if the
+@command{guix.scm} or @command{manifest.scm} has external dependencies,
+or if its behavior depends, say, on environment variables.
+
 @item --pure
 Unset existing environment variables when building the new environment, except
 those specified with @option{--preserve} (see below).  This has the effect of
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 45fd536145..4062e8155d 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -31,7 +31,15 @@ (define-module (guix scripts shell)
   #:use-module (srfi srfi-71)
   #:use-module (ice-9 match)
   #:autoload   (ice-9 rdelim) (read-line)
-  #:autoload   (guix utils) (config-directory)
+  #:autoload   (guix base32) (bytevector->base32-string)
+  #:autoload   (rnrs bytevectors) (string->utf8)
+  #:autoload   (guix utils) (config-directory cache-directory)
+  #:autoload   (guix describe) (current-channels)
+  #:autoload   (guix channels) (channel-commit)
+  #:autoload   (gcrypt hash) (sha256)
+  #:use-module ((guix build utils) #:select (mkdir-p))
+  #:use-module (guix cache)
+  #:use-module ((ice-9 ftw) #:select (scandir))
   #:export (guix-shell))
 
 (define (show-help)
@@ -48,6 +56,8 @@ (define (show-help)
                          FILE evaluates to"))
   (display (G_ "
   -q                     inhibit loading of 'guix.scm' and 'manifest.scm'"))
+  (display (G_ "
+      --rebuild-cache    rebuild cached environment, if any"))
 
   (show-environment-options-help)
   (newline)
@@ -109,7 +119,10 @@ (define %options
                                     result)))
               (option '(#\q) #f #f
                       (lambda (opt name arg result)
-                        (alist-cons 'explicit-loading? #t result))))
+                        (alist-cons 'explicit-loading? #t result)))
+              (option '("rebuild-cache") #f #f
+                      (lambda (opt name arg result)
+                        (alist-cons 'rebuild-cache? #t result))))
         (filter-map (lambda (opt)
                       (and (not (any (lambda (name)
                                        (member name to-remove))
@@ -132,11 +145,12 @@ (define (handle-argument arg result)
   (let ((args command (break (cut string=? "--" <>) args)))
     (let ((opts (parse-command-line args %options (list %default-options)
                                     #:argument-handler handle-argument)))
-      (auto-detect-manifest
-       (match command
-         (() opts)
-         (("--") opts)
-         (("--" command ...) (alist-cons 'exec command opts)))))))
+      (options-with-caching
+       (auto-detect-manifest
+        (match command
+          (() opts)
+          (("--") opts)
+          (("--" command ...) (alist-cons 'exec command opts))))))))
 
 (define (find-file-in-parent-directories candidates)
   "Find one of CANDIDATES in the current directory or one of its ancestors."
@@ -187,6 +201,53 @@ (define (authorized-shell-directory? directory)
                                  line))))))))))
     (const #f)))
 
+(define (options-with-caching opts)
+  "If OPTS contains exactly one 'load' or one 'manifest' key, automatically
+add a 'profile' key (when a profile for that file is already in cache) or a
+'gc-root' key (to add the profile to cache)."
+  (define (single-file-for-caching opts)
+    (let loop ((opts opts)
+               (file #f))
+      (match opts
+        (() file)
+        ((('package . _) . _) #f)
+        ((('load . ('package candidate)) . rest)
+         (and (not file) (loop rest candidate)))
+        ((('manifest . candidate) . rest)
+         (and (not file) (loop rest candidate)))
+        ((('expression . _) . _) #f)
+        ((_ . rest) (loop rest file)))))
+
+  ;; Check whether there's a single 'load' or 'manifest' option.  When that is
+  ;; the case, arrange to automatically cache the resulting profile.
+  (match (single-file-for-caching opts)
+    (#f opts)
+    (file
+     (let* ((root (profile-cached-gc-root file))
+            (stat (and root (false-if-exception (lstat root)))))
+       (if (and (not (assoc-ref opts 'rebuild-cache?))
+                stat
+                (<= (stat:mtime ((@ (guile) stat) file))
+                    (stat:mtime stat)))
+           (let ((now (current-time)))
+             ;; Update the atime on ROOT to reflect usage.
+             (utime root
+                    now (stat:mtime stat) 0 (stat:mtimensec stat)
+                    AT_SYMLINK_NOFOLLOW)
+             (alist-cons 'profile root
+                         (remove (match-lambda
+                                   (('load . _) #t)
+                                   (('manifest . _) #t)
+                                   (_ #f))
+                                 opts)))          ;load right away
+           (if (and root (not (assq-ref opts 'gc-root)))
+               (begin
+                 (if stat
+                     (delete-file root)
+                     (mkdir-p (dirname root)))
+                 (alist-cons 'gc-root root opts))
+               opts))))))
+
 (define (auto-detect-manifest opts)
   "If OPTS do not specify packages or a manifest, load a \"guix.scm\" or
 \"manifest.scm\" file from the current directory or one of its ancestors.
@@ -236,9 +297,59 @@ (define disallow-implicit-load?
                                      (authorized-directory-file)))
                opts))))))
 
+
+;;;
+;;; Profile cache.
+;;;
+
+(define %profile-cache-directory
+  ;; Directory where profiles created by 'guix shell' alone (without extra
+  ;; options) are cached.
+  (make-parameter (string-append (cache-directory #:ensure? #f)
+                                 "/profiles")))
+
+(define (profile-cache-key file)
+  "Return the cache key for the profile corresponding to FILE, a 'guix.scm' or
+'manifest.scm' file, or #f if we lack channel information."
+  (match (current-channels)
+    (() #f)
+    (((= channel-commit commits) ...)
+     (let ((stat (stat file)))
+       (bytevector->base32-string
+        ;; Since FILE is not canonicalized, only include the device/inode
+        ;; numbers.  XXX: In some rare cases involving Btrfs and NFS, this can
+        ;; be insufficient: <https://lwn.net/Articles/866582/>.
+        (sha256 (string->utf8
+                 (string-append (string-join commits) ":"
+                                (number->string (stat:dev stat)) ":"
+                                (number->string (stat:ino stat))))))))))
+
+(define (profile-cached-gc-root file)
+  "Return the cached GC root for FILE, a 'guix.scm' or 'manifest.scm' file, or
+#f if we lack information to cache it."
+  (match (profile-cache-key file)
+    (#f  #f)
+    (key (string-append (%profile-cache-directory) "/" key))))
+
 
 (define-command (guix-shell . args)
   (category development)
   (synopsis "spawn one-off software environments")
 
-  (guix-environment* (parse-args args)))
+  (define (cache-entries directory)
+    (filter-map (match-lambda
+                  ((or "." "..") #f)
+                  (file (string-append directory "/" file)))
+                (or (scandir directory) '())))
+
+  (define* (entry-expiration file)
+    ;; Return the time at which FILE, a cached profile, is considered expired.
+    (match (false-if-exception (lstat file))
+      (#f 0)                       ;FILE may have been deleted in the meantime
+      (st (+ (stat:atime st) (* 60 60 24 7)))))
+
+  (let ((result (guix-environment* (parse-args args))))
+    (maybe-remove-expired-cache-entries (%profile-cache-directory)
+                                        cache-entries
+                                        #:entry-expiration entry-expiration)
+    result))
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:53 2021
Received: from localhost ([127.0.0.1]:32918 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30X-0001Og-5v
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30G-0001Mn-N5
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40584)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma30B-0004ag-EC; Mon, 11 Oct 2021 17:38:31 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma30B-0007Y0-4u; Mon, 11 Oct 2021 17:38:31 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 10/11] cache: Gracefully handle non-existent cache.
Date: Mon, 11 Oct 2021 23:38:08 +0200
Message-Id: <20211011213809.17482-11-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT
when writing EXPIRY-FILE.
---
 guix/cache.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/guix/cache.scm b/guix/cache.scm
index 0401a9d428..51009809bd 100644
--- a/guix/cache.scm
+++ b/guix/cache.scm
@@ -101,7 +101,13 @@ (define last-expiry-date
                                   #:now now
                                   #:entry-expiration entry-expiration
                                   #:delete-entry delete-entry)
-    (call-with-output-file expiry-file
-      (cute write (time-second now) <>))))
+    (catch 'system-error
+      (lambda ()
+        (call-with-output-file expiry-file
+          (cute write (time-second now) <>)))
+      (lambda args
+        ;; ENOENT means CACHE does not exist.
+        (unless (= ENOENT (system-error-errno args))
+          (apply throw args))))))
 
 ;;; cache.scm ends here
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:53 2021
Received: from localhost ([127.0.0.1]:32916 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30W-0001OZ-SI
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:53 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45510)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30G-0001Mg-32
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40580)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma30A-0004aC-Pe; Mon, 11 Oct 2021 17:38:30 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma30A-0007Y0-GT; Mon, 11 Oct 2021 17:38:30 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 09/11] environment: Autoload some modules.
Date: Mon, 11 Oct 2021 23:38:07 +0200
Message-Id: <20211011213809.17482-10-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This further speeds up the 'guix environment -p PROFILE' case.

* guix/scripts/environment.scm: Autoload a bunch of modules.
---
 guix/scripts/environment.scm | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index e23d52df39..05a43659da 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -34,15 +34,18 @@ (define-module (guix scripts environment)
   #:use-module (guix scripts)
   #:use-module (guix scripts build)
   #:use-module (guix transformations)
-  #:use-module (gnu build linux-container)
-  #:use-module (gnu build accounts)
-  #:use-module ((guix build syscalls) #:select (set-network-interface-up))
-  #:use-module (gnu system linux-container)
+  #:autoload   (gnu build linux-container) (call-with-container %namespaces
+                                            user-namespace-supported?
+                                            unprivileged-user-namespace-supported?
+                                            setgroups-supported?)
+  #:autoload   (gnu build accounts) (password-entry group-entry
+                                     password-entry-name password-entry-directory
+                                     write-passwd write-group)
+  #:autoload   (guix build syscalls) (set-network-interface-up)
   #:use-module (gnu system file-systems)
-  #:use-module (gnu packages)
-  #:use-module (gnu packages bash)
-  #:use-module ((gnu packages bootstrap)
-                #:select (bootstrap-executable %bootstrap-guile))
+  #:autoload   (gnu packages) (specification->package+output)
+  #:autoload   (gnu packages bash) (bash)
+  #:autoload   (gnu packages bootstrap) (bootstrap-executable %bootstrap-guile)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:52 2021
Received: from localhost ([127.0.0.1]:32914 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30W-0001OR-Br
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45504)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30F-0001Mf-Dq
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40578)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma30A-0004Zg-56; Mon, 11 Oct 2021 17:38:30 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma309-0007Y0-Rr; Mon, 11 Oct 2021 17:38:30 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 08/11] environment: Do not connect to the daemon when
 '--profile' is used.
Date: Mon, 11 Oct 2021 23:38:06 +0200
Message-Id: <20211011213809.17482-9-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This further speeds up the 'guix environment -p PROFILE' case.

* guix/scripts/environment.scm (guix-environment*)[store-needed?]: New
variable.
[with-store/maybe]: New macro.
Use it instead of 'with-store', and remove 'with-build-handler' form.
---
 guix/scripts/environment.scm | 169 +++++++++++++++++++----------------
 1 file changed, 93 insertions(+), 76 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 32f376fdd2..e23d52df39 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -691,6 +691,26 @@ (define (guix-environment* opts)
            (mappings   (pick-all opts 'file-system-mapping))
            (white-list (pick-all opts 'inherit-regexp)))
 
+      (define store-needed?
+        ;; Whether connecting to the daemon is needed.
+        (or container? (not profile)))
+
+      (define-syntax-rule (with-store/maybe store exp ...)
+        ;; Evaluate EXP... with STORE bound to a connection, unless
+        ;; STORE-NEEDED? is false, in which case STORE is bound to #f.
+        (let ((proc (lambda (store) exp ...)))
+          (if store-needed?
+              (with-store s
+                (set-build-options-from-command-line s opts)
+                (with-build-handler (build-notifier #:use-substitutes?
+                                                    (assoc-ref opts 'substitutes?)
+                                                    #:verbosity
+                                                    (assoc-ref opts 'verbosity)
+                                                    #:dry-run?
+                                                    (assoc-ref opts 'dry-run?))
+                  (proc s)))
+              (proc #f))))
+
       (when container? (assert-container-features))
 
       (when (and (not container?) link-prof?)
@@ -701,88 +721,85 @@ (define (guix-environment* opts)
         (leave (G_ "--no-cwd cannot be used without --container~%")))
 
 
-      (with-store store
-        (with-build-handler (build-notifier #:use-substitutes?
-                                            (assoc-ref opts 'substitutes?)
-                                            #:verbosity
-                                            (assoc-ref opts 'verbosity)
-                                            #:dry-run?
-                                            (assoc-ref opts 'dry-run?))
-          (with-status-verbosity (assoc-ref opts 'verbosity)
-            (define manifest-from-opts
-              (options/resolve-packages store opts))
+      (with-store/maybe store
+        (with-status-verbosity (assoc-ref opts 'verbosity)
+          (define manifest-from-opts
+            (options/resolve-packages store opts))
 
-            (define manifest
-              (if profile
-                  (profile-manifest profile)
-                  manifest-from-opts))
+          (define manifest
+            (if profile
+                (profile-manifest profile)
+                manifest-from-opts))
 
-            (when (and profile
-                       (> (length (manifest-entries manifest-from-opts)) 0))
-              (leave (G_ "'--profile' cannot be used with package options~%")))
+          (when (and profile
+                     (> (length (manifest-entries manifest-from-opts)) 0))
+            (leave (G_ "'--profile' cannot be used with package options~%")))
 
-            (when (null? (manifest-entries manifest))
-              (warning (G_ "no packages specified; creating an empty environment~%")))
+          (when (null? (manifest-entries manifest))
+            (warning (G_ "no packages specified; creating an empty environment~%")))
 
-            (set-build-options-from-command-line store opts)
+          ;; Use the bootstrap Guile when requested.
+          (parameterize ((%graft? (assoc-ref opts 'graft?))
+                         (%guile-for-build
+                          (and store-needed?
+                               (package-derivation
+                                store
+                                (if bootstrap?
+                                    %bootstrap-guile
+                                    (default-guile))))))
+            (run-with-store store
+              ;; Containers need a Bourne shell at /bin/sh.
+              (mlet* %store-monad ((bash       (environment-bash container?
+                                                                 bootstrap?
+                                                                 system))
+                                   (prof-drv   (if profile
+                                                   (return #f)
+                                                   (manifest->derivation
+                                                    manifest system bootstrap?)))
+                                   (profile -> (if profile
+                                                   (readlink* profile)
+                                                   (derivation->output-path prof-drv)))
+                                   (gc-root -> (assoc-ref opts 'gc-root)))
 
-            ;; Use the bootstrap Guile when requested.
-            (parameterize ((%graft? (assoc-ref opts 'graft?))
-                           (%guile-for-build
-                            (and (or container? (not profile))
-                                 (package-derivation
-                                  store
-                                  (if bootstrap?
-                                      %bootstrap-guile
-                                      (default-guile))))))
-              (run-with-store store
-                ;; Containers need a Bourne shell at /bin/sh.
-                (mlet* %store-monad ((bash       (environment-bash container?
-                                                                   bootstrap?
-                                                                   system))
-                                     (prof-drv   (if profile
-                                                     (return #f)
-                                                     (manifest->derivation
-                                                      manifest system bootstrap?)))
-                                     (profile -> (if profile
-                                                     (readlink* profile)
-                                                     (derivation->output-path prof-drv)))
-                                     (gc-root -> (assoc-ref opts 'gc-root)))
-
-                  ;; First build the inputs.  This is necessary even for
-                  ;; --search-paths.  Additionally, we might need to build bash for
-                  ;; a container.
-                  (mbegin %store-monad
+                ;; First build the inputs.  This is necessary even for
+                ;; --search-paths.  Additionally, we might need to build bash for
+                ;; a container.
+                (mbegin %store-monad
+                  (mwhen store-needed?
                     (built-derivations (append
                                            (if prof-drv (list prof-drv) '())
-                                           (if (derivation? bash) (list bash) '())))
-                    (mwhen gc-root
-                      (register-gc-root profile gc-root))
+                                           (if (derivation? bash) (list bash) '()))))
+                  (mwhen gc-root
+                    (register-gc-root profile gc-root))
 
-                    (cond
-                     ((assoc-ref opts 'search-paths)
-                      (show-search-paths profile manifest #:pure? pure?)
-                      (return #t))
-                     (container?
-                      (let ((bash-binary
-                             (if bootstrap?
-                                 (derivation->output-path bash)
-                                 (string-append (derivation->output-path bash)
-                                                "/bin/sh"))))
-                        (launch-environment/container #:command command
-                                                      #:bash bash-binary
-                                                      #:user user
-                                                      #:user-mappings mappings
-                                                      #:profile profile
-                                                      #:manifest manifest
-                                                      #:white-list white-list
-                                                      #:link-profile? link-prof?
-                                                      #:network? network?
-                                                      #:map-cwd? (not no-cwd?))))
+                  (cond
+                   ((assoc-ref opts 'search-paths)
+                    (show-search-paths profile manifest #:pure? pure?)
+                    (return #t))
+                   (container?
+                    (let ((bash-binary
+                           (if bootstrap?
+                               (derivation->output-path bash)
+                               (string-append (derivation->output-path bash)
+                                              "/bin/sh"))))
+                      (launch-environment/container #:command command
+                                                    #:bash bash-binary
+                                                    #:user user
+                                                    #:user-mappings mappings
+                                                    #:profile profile
+                                                    #:manifest manifest
+                                                    #:white-list white-list
+                                                    #:link-profile? link-prof?
+                                                    #:network? network?
+                                                    #:map-cwd? (not no-cwd?))))
 
-                     (else
-                      (return
-                       (exit/status
-                        (launch-environment/fork command profile manifest
-                                                 #:white-list white-list
-                                                 #:pure? pure?)))))))))))))))
+                   (else
+                    (return
+                     (exit/status
+                      (launch-environment/fork command profile manifest
+                                               #:white-list white-list
+                                               #:pure? pure?))))))))))))))
+
+;;; Local Variables:
+;;; (put 'with-store/maybe 'scheme-indent-function 1)
+;;; End:
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:52 2021
Received: from localhost ([127.0.0.1]:32912 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30R-0001OF-2V
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45452)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma308-0001M1-VV
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:35 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40568)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma303-0004Vy-Bx; Mon, 11 Oct 2021 17:38:23 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma302-0007Y0-S1; Mon, 11 Oct 2021 17:38:23 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 03/11] Add 'guix shell'.
Date: Mon, 11 Oct 2021 23:38:01 +0200
Message-Id: <20211011213809.17482-4-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludovic.courtes@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Ludovic Courtès <ludovic.courtes@HIDDEN>

* guix/scripts/shell.scm, tests/guix-shell.sh: New files.
* Makefile.am (MODULES): Add 'shell.scm'.
(SH_TESTS): Add 'tests/guix-shell.sh'.
* guix/scripts/environment.scm (show-environment-options-help): New
procedure.
(show-help): Use it.
(guix-environment*): New procedure.
(guix-environment): Use it.
* po/guix/POTFILES.in: Add it.
* doc/guix.texi (Features): Refer to "guix shell"
(Invoking guix package): Likewise.
(Development): Likewise.
(Invoking guix shell): New node.
(Invoking guix environment): Add deprecation warning.
(Debugging Build Failures): Use 'guix shell' in examples.
(Invoking guix container): Refer to 'guix shell'.
(Invoking guix processes, Virtualization Services): Adjust examples to
use 'guix shell'.
* doc/contributing.texi (Building from Git): Refer to 'guix shell'.
---
 Makefile.am                  |   2 +
 doc/contributing.texi        |   8 +-
 doc/guix.texi                | 366 ++++++++++++++++++++++++++++++++---
 guix/scripts/environment.scm |  52 +++--
 guix/scripts/shell.scm       | 135 +++++++++++++
 po/guix/POTFILES.in          |   1 +
 tests/guix-shell.sh          |  54 ++++++
 7 files changed, 575 insertions(+), 43 deletions(-)
 create mode 100644 guix/scripts/shell.scm
 create mode 100644 tests/guix-shell.sh

diff --git a/Makefile.am b/Makefile.am
index b66789fa0b..c28c8799ec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -315,6 +315,7 @@ MODULES =					\
   guix/scripts/import/stackage.scm		\
   guix/scripts/import/texlive.scm  		\
   guix/scripts/environment.scm			\
+  guix/scripts/shell.scm			\
   guix/scripts/publish.scm			\
   guix/scripts/edit.scm				\
   guix/scripts/size.scm				\
@@ -550,6 +551,7 @@ SH_TESTS =					\
   tests/guix-authenticate.sh			\
   tests/guix-environment.sh			\
   tests/guix-environment-container.sh		\
+  tests/guix-shell.sh				\
   tests/guix-graph.sh				\
   tests/guix-describe.sh			\
   tests/guix-repl.sh     			\
diff --git a/doc/contributing.texi b/doc/contributing.texi
index fbb3c47c78..363bbe9278 100644
--- a/doc/contributing.texi
+++ b/doc/contributing.texi
@@ -73,10 +73,10 @@ all the dependencies and appropriate environment variables are set up to
 hack on Guix:
 
 @example
-guix environment guix --pure
+guix shell -D guix --pure
 @end example
 
-@xref{Invoking guix environment}, for more information on that command.
+@xref{Invoking guix shell}, for more information on that command.
 
 If you are unable to use Guix when building Guix from a checkout, the
 following are the required packages in addition to those mentioned in the
@@ -92,10 +92,10 @@ installation instructions (@pxref{Requirements}).
 @end itemize
 
 On Guix, extra dependencies can be added by instead running @command{guix
-environment} with @option{--ad-hoc}:
+shell}:
 
 @example
-guix environment guix --pure --ad-hoc help2man git strace
+guix shell -D guix help2man git strace --pure
 @end example
 
 Run @command{./bootstrap} to generate the build system infrastructure
diff --git a/doc/guix.texi b/doc/guix.texi
index bc3f5a537b..b0d745b9e3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -118,6 +118,7 @@ Documentation License''.
 
 @dircategory Software development
 @direntry
+* guix shell: (guix)Invoking guix shell.      Creating software environments.
 * guix environment: (guix)Invoking guix environment.  Building development environments with Guix.
 * guix build: (guix)Invoking guix build.      Building packages.
 * guix pack: (guix)Invoking guix pack.        Creating binary bundles.
@@ -261,6 +262,7 @@ Channels
 
 Development
 
+* Invoking guix shell::         Spawning one-off software environments.
 * Invoking guix environment::   Setting up development environments.
 * Invoking guix pack::          Creating software bundles.
 * The GCC toolchain::           Working with languages supported by GCC.
@@ -3066,10 +3068,10 @@ substitutes: they can force a local build and @emph{challenge} providers
 (@pxref{Invoking guix challenge}).
 
 Control over the build environment is a feature that is also useful for
-developers.  The @command{guix environment} command allows developers of
+developers.  The @command{guix shell} command allows developers of
 a package to quickly set up the right development environment for their
 package, without having to manually install the dependencies of the
-package into their profile (@pxref{Invoking guix environment}).
+package into their profile (@pxref{Invoking guix shell}).
 
 @cindex replication, of software environments
 @cindex provenance tracking, of software artifacts
@@ -3233,7 +3235,7 @@ As an example, @var{file} might contain a definition like this
 Developers may find it useful to include such a @file{guix.scm} file
 in the root of their project source tree that can be used to test
 development snapshots and create reproducible development environments
-(@pxref{Invoking guix environment}).
+(@pxref{Invoking guix shell}).
 
 The @var{file} may also contain a JSON representation of one or more
 package definitions.  Running @code{guix package -f} on
@@ -5558,31 +5560,352 @@ If you are a software developer, Guix provides tools that you should find
 helpful---independently of the language you're developing in.  This is what
 this chapter is about.
 
-The @command{guix environment} command provides a convenient way to set up
-@dfn{development environments} containing all the dependencies and tools
-necessary to work on the software package of your choice.  The @command{guix
+The @command{guix shell} command provides a convenient way to set up
+one-off software environments, be it for development purposes or to run
+a command without installing it in your profile.  The @command{guix
 pack} command allows you to create @dfn{application bundles} that can be
 easily distributed to users who do not run Guix.
 
 @menu
+* Invoking guix shell::         Spawning one-off software environments.
 * Invoking guix environment::   Setting up development environments.
 * Invoking guix pack::          Creating software bundles.
 * The GCC toolchain::           Working with languages supported by GCC.
 * Invoking guix git authenticate:: Authenticating Git repositories.
 @end menu
 
-@node Invoking guix environment
-@section Invoking @command{guix environment}
+@node Invoking guix shell
+@section Invoking @command{guix shell}
 
 @cindex reproducible build environments
 @cindex development environments
 @cindex @command{guix environment}
 @cindex environment, package build environment
-The purpose of @command{guix environment} is to assist hackers in
-creating reproducible development environments without polluting their
-package profile.  The @command{guix environment} tool takes one or more
-packages, builds all of their inputs, and creates a shell
-environment to use them.
+The purpose of @command{guix shell} is to make it easy to create one-off
+software environments, without changing one's profile.  It is typically
+used to create development environments; it is also a convenient way to
+run applications without ``polluting'' your profile.
+
+@quotation Note
+The @command{guix shell} command was recently introduced to supersede
+@command{guix environment} (@pxref{Invoking guix environment}).  If you
+are familiar with @command{guix environment}, you will notice that it is
+similar but also---we hope!---more convenient.
+@end quotation
+
+The general syntax is:
+
+@example
+guix shell [@var{options}] [@var{package}@dots{}]
+@end example
+
+The following example creates a environment containing Python and NumPy,
+building and downloading any missing package, and runs the
+@command{python3} command in that environment:
+
+@example
+guix shell python python-numpy -- python3
+@end example
+
+Development environments can be created as in the example below, which
+spawns an interactive shell containing all the dependencies and
+environment variables needed to work on Inkscape:
+
+@example
+guix shell --development inkscape
+@end example
+
+Exiting the shell places the user back in the original environment
+before @command{guix shell} was invoked.  The next garbage collection
+(@pxref{Invoking guix gc}) may clean up packages that were installed in
+the environment and that are no longer used outside of it.
+
+By default, the shell session or command runs in an @emph{augmented}
+environment, where the new packages are added to search path environment
+variables such as @code{PATH}.  You can, instead, choose to create an
+@emph{isolated} environment containing nothing but the packages you
+asked for.  Passing the @option{--pure} option clears environment
+variable definitions found in the parent environment@footnote{Users
+sometimes wrongfully augment environment variables such as @env{PATH} in
+their @file{~/.bashrc} file.  As a consequence, when @command{guix
+environment} launches it, Bash may read @file{~/.bashrc}, thereby
+introducing ``impurities'' in these environment variables.  It is an
+error to define such environment variables in @file{.bashrc}; instead,
+they should be defined in @file{.bash_profile}, which is sourced only by
+log-in shells.  @xref{Bash Startup Files,,, bash, The GNU Bash Reference
+Manual}, for details on Bash start-up files.}; passing
+@option{--container} goes one step further by spawning a @dfn{container}
+isolated from the rest of the system:
+
+@example
+guix shell --container emacs gcc-toolchain
+@end example
+
+The command above spawns an interactive shell in a container when
+nothing but @code{emacs}, @code{gcc-toolchain}, and their dependencies
+is available.  The container lacks network access and shares no files
+other than the current working directory with the surrounding
+environment.  This is useful to prevent access to system-wide resources
+such as @file{/usr/bin} on foreign distros.
+
+This @option{--container} option can also prove useful if you wish to
+run a security-sensitive application, such as a web browser, in an
+isolated environment.  For example, the command below launches
+Ungoogled-Chromium in an isolated environment, this time sharing network
+access with the host and preserving its @code{DISPLAY} environment
+variable, but without even sharing the current directory:
+
+@example
+guix shell --container --network --no-cwd ungoogled-chromium \
+  --preserve='^DISPLAY$' -- chromium
+@end example
+
+@vindex GUIX_ENVIRONMENT
+@command{guix shell} defines the @env{GUIX_ENVIRONMENT}
+variable in the shell it spawns; its value is the file name of the
+profile of this environment.  This allows users to, say, define a
+specific prompt for development environments in their @file{.bashrc}
+(@pxref{Bash Startup Files,,, bash, The GNU Bash Reference Manual}):
+
+@example
+if [ -n "$GUIX_ENVIRONMENT" ]
+then
+    export PS1="\u@@\h \w [dev]\$ "
+fi
+@end example
+
+@noindent
+...@: or to browse the profile:
+
+@example
+$ ls "$GUIX_ENVIRONMENT/bin"
+@end example
+
+The available options are summarized below.
+
+@table @code
+@item --development
+@itemx -D
+Cause @command{guix shell} to include in the environment the
+dependencies of the following package rather than the package itself.
+This can be combined with other packages.  For instance, the command
+below starts an interactive shell containing the build-time dependencies
+of GNU@tie{}Guile, plus Autoconf, Automake, and Libtool:
+
+@example
+guix shell -D guile autoconf automake libtool
+@end example
+
+@item --expression=@var{expr}
+@itemx -e @var{expr}
+Create an environment for the package or list of packages that
+@var{expr} evaluates to.
+
+For example, running:
+
+@example
+guix shell -D -e '(@@ (gnu packages maths) petsc-openmpi)'
+@end example
+
+starts a shell with the environment for this specific variant of the
+PETSc package.
+
+Running:
+
+@example
+guix shell -e '(@@ (gnu) %base-packages)'
+@end example
+
+starts a shell with all the base system packages available.
+
+The above commands only use the default output of the given packages.
+To select other outputs, two element tuples can be specified:
+
+@example
+guix shell -e '(list (@@ (gnu packages bash) bash) "include")'
+@end example
+
+@item --file=@var{file}
+@itemx -f @var{file}
+Create an environment containing the package or list of packages that
+the code within @var{file} evaluates to.
+
+As an example, @var{file} might contain a definition like this
+(@pxref{Defining Packages}):
+
+@lisp
+@verbatiminclude environment-gdb.scm
+@end lisp
+
+With the file above, you can enter a development environment for GDB by
+running:
+
+@example
+guix shell -D -f gdb-devel.scm
+@end example
+
+@item --manifest=@var{file}
+@itemx -m @var{file}
+Create an environment for the packages contained in the manifest object
+returned by the Scheme code in @var{file}.  This option can be repeated
+several times, in which case the manifests are concatenated.
+
+This is similar to the same-named option in @command{guix package}
+(@pxref{profile-manifest, @option{--manifest}}) and uses the same
+manifest files.
+
+@item --pure
+Unset existing environment variables when building the new environment, except
+those specified with @option{--preserve} (see below).  This has the effect of
+creating an environment in which search paths only contain package inputs.
+
+@item --preserve=@var{regexp}
+@itemx -E @var{regexp}
+When used alongside @option{--pure}, preserve the environment variables
+matching @var{regexp}---in other words, put them on a ``white list'' of
+environment variables that must be preserved.  This option can be repeated
+several times.
+
+@example
+guix shell --pure --preserve=^SLURM openmpi @dots{} \
+  -- mpirun @dots{}
+@end example
+
+This example runs @command{mpirun} in a context where the only environment
+variables defined are @env{PATH}, environment variables whose name starts
+with @samp{SLURM}, as well as the usual ``precious'' variables (@env{HOME},
+@env{USER}, etc.).
+
+@item --search-paths
+Display the environment variable definitions that make up the
+environment.
+
+@item --system=@var{system}
+@itemx -s @var{system}
+Attempt to build for @var{system}---e.g., @code{i686-linux}.
+
+@item --container
+@itemx -C
+@cindex container
+Run @var{command} within an isolated container.  The current working
+directory outside the container is mapped inside the container.
+Additionally, unless overridden with @option{--user}, a dummy home
+directory is created that matches the current user's home directory, and
+@file{/etc/passwd} is configured accordingly.
+
+The spawned process runs as the current user outside the container.  Inside
+the container, it has the same UID and GID as the current user, unless
+@option{--user} is passed (see below).
+
+@item --network
+@itemx -N
+For containers, share the network namespace with the host system.
+Containers created without this flag only have access to the loopback
+device.
+
+@item --link-profile
+@itemx -P
+For containers, link the environment profile to @file{~/.guix-profile}
+within the container and set @code{GUIX_ENVIRONMENT} to that.
+This is equivalent to making @file{~/.guix-profile} a symlink to the
+actual profile within the container.
+Linking will fail and abort the environment if the directory already
+exists, which will certainly be the case if @command{guix shell}
+was invoked in the user's home directory.
+
+Certain packages are configured to look in @file{~/.guix-profile} for
+configuration files and data;@footnote{For example, the
+@code{fontconfig} package inspects @file{~/.guix-profile/share/fonts}
+for additional fonts.}  @option{--link-profile} allows these programs to
+behave as expected within the environment.
+
+@item --user=@var{user}
+@itemx -u @var{user}
+For containers, use the username @var{user} in place of the current
+user.  The generated @file{/etc/passwd} entry within the container will
+contain the name @var{user}, the home directory will be
+@file{/home/@var{user}}, and no user GECOS data will be copied.  Furthermore,
+the UID and GID inside the container are 1000.  @var{user}
+need not exist on the system.
+
+Additionally, any shared or exposed path (see @option{--share} and
+@option{--expose} respectively) whose target is within the current user's
+home directory will be remapped relative to @file{/home/USER}; this
+includes the automatic mapping of the current working directory.
+
+@example
+# will expose paths as /home/foo/wd, /home/foo/test, and /home/foo/target
+cd $HOME/wd
+guix shell --container --user=foo \
+     --expose=$HOME/test \
+     --expose=/tmp/target=$HOME/target
+@end example
+
+While this will limit the leaking of user identity through home paths
+and each of the user fields, this is only one useful component of a
+broader privacy/anonymity solution---not one in and of itself.
+
+@item --no-cwd
+For containers, the default behavior is to share the current working
+directory with the isolated container and immediately change to that
+directory within the container.  If this is undesirable,
+@option{--no-cwd} will cause the current working directory to @emph{not}
+be automatically shared and will change to the user's home directory
+within the container instead.  See also @option{--user}.
+
+@item --expose=@var{source}[=@var{target}]
+@itemx --share=@var{source}[=@var{target}]
+For containers, @option{--expose} (resp. @option{--share}) exposes the
+file system @var{source} from the host system as the read-only
+(resp. writable) file system @var{target} within the container.  If
+@var{target} is not specified, @var{source} is used as the target mount
+point in the container.
+
+The example below spawns a Guile REPL in a container in which the user's
+home directory is accessible read-only via the @file{/exchange}
+directory:
+
+@example
+guix shell --container --expose=$HOME=/exchange guile -- guile
+@end example
+
+@item --root=@var{file}
+@itemx -r @var{file}
+@cindex persistent environment
+@cindex garbage collector root, for environments
+Make @var{file} a symlink to the profile for this environment, and
+register it as a garbage collector root.
+
+This is useful if you want to protect your environment from garbage
+collection, to make it ``persistent''.
+
+When this option is omitted, the environment is protected from garbage
+collection only for the duration of the @command{guix shell}
+session.  This means that next time you recreate the same environment,
+you could have to rebuild or re-download packages.  @xref{Invoking guix
+gc}, for more on GC roots.
+@end table
+
+@command{guix shell} also supports all of the common build options that
+@command{guix build} supports (@pxref{Common Build Options}) as well as
+package transformation options (@pxref{Package Transformation Options}).
+
+@node Invoking guix environment
+@section Invoking @command{guix environment}
+
+The purpose of @command{guix environment} is to assists in creating
+development environments.
+
+@quotation Deprecation warning
+The @command{guix environment} command is deprecated in favor of
+@command{guix shell}, which performs similar functions but is more
+convenient to use.  @xref{Invoking guix shell}.
+
+Being deprecated, @command{guix environment} is slated for eventual
+removal, but the Guix project is committed to keeping it until May 1st,
+2023.  Please get in touch with us at @email{guix-devel@@gnu.org} if you
+would like to discuss it.
+@end quotation
 
 The general syntax is:
 
@@ -11098,14 +11421,14 @@ a container similar to the one the build daemon creates:
 $ guix build -K foo
 @dots{}
 $ cd /tmp/guix-build-foo.drv-0
-$ guix environment --no-grafts -C foo --ad-hoc strace gdb
+$ guix shell --no-grafts -C foo strace gdb
 [env]# source ./environment-variables
 [env]# cd foo-1.2
 @end example
 
 Here, @command{guix environment -C} creates a container and spawns a new
-shell in it (@pxref{Invoking guix environment}).  The @command{--ad-hoc
-strace gdb} part adds the @command{strace} and @command{gdb} commands to
+shell in it (@pxref{Invoking guix shell}).  The @command{strace gdb}
+part adds the @command{strace} and @command{gdb} commands to
 the container, which you may find handy while debugging.  The
 @option{--no-grafts} option makes sure we get the exact same
 environment, with ungrafted packages (@pxref{Security Updates}, for more
@@ -11119,7 +11442,7 @@ remove @file{/bin/sh}:
 @end example
 
 (Don't worry, this is harmless: this is all happening in the throw-away
-container created by @command{guix environment}.)
+container created by @command{guix shell}.)
 
 The @command{strace} command is probably not in the search path, but we
 can run:
@@ -13315,8 +13638,8 @@ is subject to radical change in the future.
 
 The purpose of @command{guix container} is to manipulate processes
 running within an isolated environment, commonly known as a
-``container'', typically created by the @command{guix environment}
-(@pxref{Invoking guix environment}) and @command{guix system container}
+``container'', typically created by the @command{guix shell}
+(@pxref{Invoking guix shell}) and @command{guix system container}
 (@pxref{Invoking guix system}) commands.
 
 The general syntax is:
@@ -13502,7 +13825,7 @@ listed.}.  Here's an example of the information it returns:
 $ sudo guix processes
 SessionPID: 19002
 ClientPID: 19090
-ClientCommand: guix environment --ad-hoc python
+ClientCommand: guix shell python
 
 SessionPID: 19402
 ClientPID: 19367
@@ -29697,8 +30020,7 @@ When the service is running, you can view its console by connecting to
 it with a VNC client, for example with:
 
 @example
-guix environment --ad-hoc tigervnc-client -- \
-         vncviewer localhost:5900
+guix shell tigervnc-client -- vncviewer localhost:5900
 @end example
 
 The default configuration (see @code{hurd-vm-configuration} below)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 54f48a7482..77956fc018 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -50,7 +50,11 @@ (define-module (guix scripts environment)
   #:use-module (srfi srfi-37)
   #:use-module (srfi srfi-98)
   #:export (assert-container-features
-            guix-environment))
+            guix-environment
+            guix-environment*
+            show-environment-options-help
+            (%options . %environment-options)
+            (%default-options . %environment-default-options)))
 
 (define %default-shell
   (or (getenv "SHELL") "/bin/sh"))
@@ -66,23 +70,16 @@ (define* (show-search-paths profile manifest #:key pure?)
                (newline)))
             (profile-search-paths profile manifest)))
 
-(define (show-help)
-  (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
-Build an environment that includes the dependencies of PACKAGE and execute
-COMMAND or an interactive shell in that environment.\n"))
+(define (show-environment-options-help)
+  "Print help about options shared between 'guix environment' and 'guix
+shell'."
   (display (G_ "
   -e, --expression=EXPR  create environment for the package that EXPR
                          evaluates to"))
   (display (G_ "
-  -l, --load=FILE        create environment for the package that the code within
-                         FILE evaluates to"))
-  (display (G_ "
   -m, --manifest=FILE    create environment with the manifest from FILE"))
   (display (G_ "
   -p, --profile=PATH     create environment from profile at PATH"))
-  (display (G_ "
-      --ad-hoc           include all specified packages in the environment instead
-                         of only their inputs"))
   (display (G_ "
       --pure             unset existing environment variables"))
   (display (G_ "
@@ -118,7 +115,24 @@ (define (show-help)
   (display (G_ "
   -v, --verbosity=LEVEL  use the given verbosity LEVEL"))
   (display (G_ "
-      --bootstrap        use bootstrap binaries to build the environment"))
+      --bootstrap        use bootstrap binaries to build the environment")))
+
+(define (show-help)
+  (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
+Build an environment that includes the dependencies of PACKAGE and execute
+COMMAND or an interactive shell in that environment.\n"))
+  (warning (G_ "This command is deprecated in favor of 'guix shell'.\n"))
+  (newline)
+
+  ;; These two options are left out in 'guix shell'.
+  (display (G_ "
+  -l, --load=FILE        create environment for the package that the code within
+                         FILE evaluates to"))
+  (display (G_ "
+      --ad-hoc           include all specified packages in the environment instead
+                         of only their inputs"))
+
+  (show-environment-options-help)
   (newline)
   (show-build-options-help)
   (newline)
@@ -649,11 +663,15 @@ (define (register-gc-root target root)
 
 (define-command (guix-environment . args)
   (category development)
-  (synopsis "spawn one-off software environments")
+  (synopsis "spawn one-off software environments (deprecated)")
 
+  (guix-environment* (parse-args args)))
+
+(define (guix-environment* opts)
+  "Run the 'guix environment' command on OPTS, an alist resulting for
+command-line option processing with 'parse-command-line'."
   (with-error-handling
-    (let* ((opts       (parse-args args))
-           (pure?      (assoc-ref opts 'pure))
+    (let* ((pure?      (assoc-ref opts 'pure))
            (container? (assoc-ref opts 'container?))
            (link-prof? (assoc-ref opts 'link-profile?))
            (network?   (assoc-ref opts 'network?))
@@ -724,8 +742,8 @@ (define manifest
                                      (prof-drv   (manifest->derivation
                                                   manifest system bootstrap?))
                                      (profile -> (if profile
-                                                   (readlink* profile)
-                                                   (derivation->output-path prof-drv)))
+                                                     (readlink* profile)
+                                                     (derivation->output-path prof-drv)))
                                      (gc-root -> (assoc-ref opts 'gc-root)))
 
                   ;; First build the inputs.  This is necessary even for
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
new file mode 100644
index 0000000000..190dd8837d
--- /dev/null
+++ b/guix/scripts/shell.scm
@@ -0,0 +1,135 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts shell)
+  #:use-module (guix ui)
+  #:use-module (guix scripts environment)
+  #:autoload   (guix scripts build) (show-build-options-help)
+  #:autoload   (guix transformations) (show-transformation-options-help)
+  #:use-module (guix scripts)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:use-module (srfi srfi-71)
+  #:use-module (ice-9 match)
+  #:export (guix-shell))
+
+(define (show-help)
+  (display (G_ "Usage: guix shell [OPTION] PACKAGES... [-- COMMAND...]
+Build an environment that includes PACKAGES and execute COMMAND or an
+interactive shell in that environment.\n"))
+  (newline)
+
+  ;; These two options differ from 'guix environment'.
+  (display (G_ "
+  -D, --development      include the development inputs of the next package"))
+  (display (G_ "
+  -f, --file=FILE        create environment for the package that the code within
+                         FILE evaluates to"))
+
+  (show-environment-options-help)
+  (newline)
+  (show-build-options-help)
+  (newline)
+  (show-transformation-options-help)
+  (newline)
+  (display (G_ "
+  -h, --help             display this help and exit"))
+  (display (G_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define (tag-package-arg opts arg)
+  "Return a two-element list with the form (TAG ARG) that tags ARG with either
+'ad-hoc' in OPTS has the 'ad-hoc?' key set to #t, or 'inputs' otherwise."
+  (if (assoc-ref opts 'ad-hoc?)
+      `(ad-hoc-package ,arg)
+      `(package ,arg)))
+
+(define (ensure-ad-hoc alist)
+  (if (assq-ref alist 'ad-hoc?)
+      alist
+      `((ad-hoc? . #t) ,@alist)))
+
+(define (wrapped-option opt)
+  "Wrap OPT, a SRFI-37 option, such that its processor always adds the
+'ad-hoc?' flag to the resulting alist."
+  (option (option-names opt)
+          (option-required-arg? opt)
+          (option-optional-arg? opt)
+          (compose ensure-ad-hoc (option-processor opt))))
+
+(define %options
+  ;; Specification of the command-line options.
+  (let ((to-remove '("ad-hoc" "inherit" "load" "help" "version")))
+    (append
+        (list (option '(#\h "help") #f #f
+                      (lambda args
+                        (show-help)
+                        (exit 0)))
+              (option '(#\V "version") #f #f
+                      (lambda args
+                        (show-version-and-exit "guix shell")))
+
+              (option '(#\D "development") #f #f
+                      (lambda (opt name arg result)
+                        ;; Temporarily remove the 'ad-hoc?' flag from result.
+                        ;; The next option will put it back thanks to
+                        ;; 'wrapped-option'.
+                        (alist-delete 'ad-hoc? result)))
+
+              ;; For consistency with 'guix package', support '-f' rather than
+              ;; '-l' like 'guix environment' does.
+              (option '(#\f "file") #t #f
+                      (lambda (opt name arg result)
+                        (alist-cons 'load (tag-package-arg result arg)
+                                    result))))
+        (filter-map (lambda (opt)
+                      (and (not (any (lambda (name)
+                                       (member name to-remove))
+                                     (option-names opt)))
+                           (wrapped-option opt)))
+                    %environment-options))))
+
+(define %default-options
+  `((ad-hoc? . #t)                                ;always true
+    ,@%environment-default-options))
+
+(define (parse-args args)
+  "Parse the list of command line arguments ARGS."
+  (define (handle-argument arg result)
+    (alist-cons 'package (tag-package-arg result arg)
+                (ensure-ad-hoc result)))
+
+  ;; The '--' token is used to separate the command to run from the rest of
+  ;; the operands.
+  (let ((args command (break (cut string=? "--" <>) args)))
+    (let ((opts (parse-command-line args %options (list %default-options)
+                                    #:argument-handler handle-argument)))
+      (match command
+        (() opts)
+        (("--") opts)
+        (("--" command ...) (alist-cons 'exec command opts))))))
+
+
+(define-command (guix-shell . args)
+  (category development)
+  (synopsis "spawn one-off software environments")
+
+  (guix-environment* (parse-args args)))
diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in
index f5b76bf582..f8abeb2d38 100644
--- a/po/guix/POTFILES.in
+++ b/po/guix/POTFILES.in
@@ -99,6 +99,7 @@ guix/derivations.scm
 guix/scripts/archive.scm
 guix/scripts/build.scm
 guix/scripts/environment.scm
+guix/scripts/shell.scm
 guix/scripts/time-machine.scm
 guix/scripts/import/cpan.scm
 guix/scripts/import/crate.scm
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
new file mode 100644
index 0000000000..f08637f7ff
--- /dev/null
+++ b/tests/guix-shell.sh
@@ -0,0 +1,54 @@
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
+#
+# This file is part of GNU Guix.
+#
+# GNU Guix is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# GNU Guix is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# Test the 'guix shell' alias.
+#
+
+guix shell --version
+
+tmpdir="t-guix-shell-$$"
+trap 'rm -r "$tmpdir"' EXIT
+mkdir "$tmpdir"
+
+guix shell --bootstrap --pure guile-bootstrap -- guile --version
+
+# '--ad-hoc' is a thing of the past.
+! guix shell --ad-hoc guile-bootstrap
+
+if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
+then
+    # Compute the build environment for the initial GNU Make.
+    guix shell --bootstrap --no-substitutes --search-paths --pure \
+         -D -e '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/a"
+
+    # Make sure bootstrap binaries are in the profile.
+    profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'`
+
+    # Make sure the bootstrap binaries are all listed where they belong.
+    grep -E "^export PATH=\"$profile/bin\""         "$tmpdir/a"
+    grep -E "^export CPATH=\"$profile/include\""    "$tmpdir/a"
+    grep -E "^export LIBRARY_PATH=\"$profile/lib\"" "$tmpdir/a"
+    for dep in bootstrap-binaries-0 gcc-bootstrap-0 glibc-bootstrap-0
+    do
+	guix gc --references "$profile" | grep "$dep"
+    done
+
+    # 'make-boot0' itself must not be listed.
+    ! guix gc --references "$profile" | grep make-boot0
+fi
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:47 2021
Received: from localhost ([127.0.0.1]:32910 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30Q-0001O7-Pe
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45494)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30E-0001MY-Np
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40576)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma309-0004ZS-GI; Mon, 11 Oct 2021 17:38:29 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma309-0007Y0-6p; Mon, 11 Oct 2021 17:38:29 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 07/11] environment: Skip derivation computation when
 '--profile' is used.
Date: Mon, 11 Oct 2021 23:38:05 +0200
Message-Id: <20211011213809.17482-8-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/scripts/environment.scm (guix-environment*): Bypass calls to
'package-derivation' and to 'manifest->derivation' when PROFILE is
true.
---
 guix/scripts/environment.scm | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 77956fc018..32f376fdd2 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -729,18 +729,21 @@ (define manifest
             ;; Use the bootstrap Guile when requested.
             (parameterize ((%graft? (assoc-ref opts 'graft?))
                            (%guile-for-build
-                            (package-derivation
-                             store
-                             (if bootstrap?
-                                 %bootstrap-guile
-                                 (default-guile)))))
+                            (and (or container? (not profile))
+                                 (package-derivation
+                                  store
+                                  (if bootstrap?
+                                      %bootstrap-guile
+                                      (default-guile))))))
               (run-with-store store
                 ;; Containers need a Bourne shell at /bin/sh.
                 (mlet* %store-monad ((bash       (environment-bash container?
                                                                    bootstrap?
                                                                    system))
-                                     (prof-drv   (manifest->derivation
-                                                  manifest system bootstrap?))
+                                     (prof-drv   (if profile
+                                                     (return #f)
+                                                     (manifest->derivation
+                                                      manifest system bootstrap?)))
                                      (profile -> (if profile
                                                      (readlink* profile)
                                                      (derivation->output-path prof-drv)))
@@ -750,9 +753,9 @@ (define manifest
                   ;; --search-paths.  Additionally, we might need to build bash for
                   ;; a container.
                   (mbegin %store-monad
-                    (built-derivations (if (derivation? bash)
-                                           (list prof-drv bash)
-                                           (list prof-drv)))
+                    (built-derivations (append
+                                           (if prof-drv (list prof-drv) '())
+                                           (if (derivation? bash) (list bash) '())))
                     (mwhen gc-root
                       (register-gc-root profile gc-root))
 
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:46 2021
Received: from localhost ([127.0.0.1]:32908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30Q-0001O5-EA
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:46 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30E-0001MQ-4X
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40574)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma308-0004Yg-Rg; Mon, 11 Oct 2021 17:38:28 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma305-0007Y0-47; Mon, 11 Oct 2021 17:38:28 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 06/11] environment: Add tests for '--profile'.
Date: Mon, 11 Oct 2021 23:38:04 +0200
Message-Id: <20211011213809.17482-7-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This is a followup to a643deac2de81755a1843a3b41dd53857678bebc.

* tests/guix-environment-container.sh, tests/guix-environment.sh: Add
tests for '--profile'.
---
 tests/guix-environment-container.sh | 8 ++++++++
 tests/guix-environment.sh           | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index f2d15c8d0c..2e238c501d 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -44,6 +44,14 @@ else
     test $? = 42
 fi
 
+# Try '--root' and '--profile'.
+root="$tmpdir/root"
+guix environment -C --ad-hoc --bootstrap guile-bootstrap -r "$root" -- guile --version
+guix environment -C -p "$root" --bootstrap -- guile --version
+path1=$(guix environment -C -p "$root" --bootstrap -- guile -c '(display (getenv "PATH"))')
+path2=$(guix environment -C --ad-hoc --bootstrap guile-bootstrap  -- guile -c '(display (getenv "PATH"))')
+test "$path1" = "$path2"
+
 # Make sure "localhost" resolves.
 guix environment --container --ad-hoc --bootstrap guile-bootstrap \
      -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))'
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index afadcbe195..f4fc2e39ed 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -119,6 +119,13 @@ test `readlink "$gcroot"` = "$expected"
 guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \
      -- guile -c 1
 test `readlink "$gcroot"` = "$expected"
+
+# Make sure '-p' works as expected.
+test $(guix environment -p "$gcroot" -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT') = "$expected"
+paths1="$(guix environment -p "$gcroot" --search-paths)"
+paths2="$(guix environment --bootstrap --ad-hoc guile-bootstrap --search-paths)"
+test "$paths1" = "$paths2"
+
 rm "$gcroot"
 
 # Try '-r' with a relative file name.
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:38 2021
Received: from localhost ([127.0.0.1]:32906 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30H-0001Nf-LL
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45468)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma30A-0001M4-1Q
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40572)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma304-0004X9-QM; Mon, 11 Oct 2021 17:38:24 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma304-0007Y0-9D; Mon, 11 Oct 2021 17:38:24 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 05/11] DRAFT shell: Honor in
 ~/.config/guix/shell-authorized-directories.
Date: Mon, 11 Oct 2021 23:38:03 +0200
Message-Id: <20211011213809.17482-6-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

DRAFT: Squeeze with previous commit, or instead implement "guix shell ."
convention?

* guix/scripts/shell.scm (authorized-directory-file)
(authorized-shell-directory?): New procedure.
(auto-detect-manifest): Use it.
* doc/guix.texi (Invoking guix shell): Document it.
---
 doc/guix.texi          | 14 ++++++++++
 guix/scripts/shell.scm | 60 +++++++++++++++++++++++++++++++++++++++---
 tests/guix-shell.sh    | 16 ++++++++---
 3 files changed, 83 insertions(+), 7 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index b0d745b9e3..b95025a39f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5620,6 +5620,20 @@ before @command{guix shell} was invoked.  The next garbage collection
 (@pxref{Invoking guix gc}) may clean up packages that were installed in
 the environment and that are no longer used outside of it.
 
+As an added convenience, when running from a directory that contains a
+@file{guix.scm} or a @file{manifest.scm} file, possibly in a parent
+directory, @command{guix shell} automatically loads the file---provided
+the directory is listed in
+@file{~/.config/guix/shell-authorized-directories}, and only for
+interactive use:
+
+@example
+guix shell
+@end example
+
+This provides an easy way to define, share, and enter development
+environments.
+
 By default, the shell session or command runs in an @emph{augmented}
 environment, where the new packages are added to search path environment
 variables such as @code{PATH}.  You can, instead, choose to create an
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 39d843bde7..45fd536145 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -18,6 +18,7 @@
 
 (define-module (guix scripts shell)
   #:use-module (guix ui)
+  #:use-module ((guix diagnostics) #:select (location))
   #:use-module (guix scripts environment)
   #:autoload   (guix scripts build) (show-build-options-help)
   #:autoload   (guix transformations) (show-transformation-options-help)
@@ -29,6 +30,8 @@ (define-module (guix scripts shell)
   #:use-module (srfi srfi-37)
   #:use-module (srfi srfi-71)
   #:use-module (ice-9 match)
+  #:autoload   (ice-9 rdelim) (read-line)
+  #:autoload   (guix utils) (config-directory)
   #:export (guix-shell))
 
 (define (show-help)
@@ -151,6 +154,39 @@ (define device (stat:dev (stat start)))
                (and (not (string=? directory "/"))
                     (loop (dirname directory)))))))) ;lexical ".." resolution
 
+(define (authorized-directory-file)
+  "Return the name of the file listing directories for which 'guix shell' may
+automatically load 'guix.scm' or 'manifest.scm' files."
+  (string-append (config-directory) "/shell-authorized-directories"))
+
+(define (authorized-shell-directory? directory)
+  "Return true if DIRECTORY is among the authorized directories for automatic
+loading.  The list of authorized directories is read from
+'authorized-directory-file'; each line must be either: an absolute file name,
+a hash-prefixed comment, or a blank line."
+  (catch 'system-error
+    (lambda ()
+      (call-with-input-file (authorized-directory-file)
+        (lambda (port)
+          (let loop ()
+            (match (read-line port)
+              ((? eof-object?) #f)
+              ((= string-trim line)
+               (cond ((string-prefix? "#" line)   ;comment
+                      (loop))
+                     ((string-prefix? "/" line)   ;absolute file name
+                      (or (string=? line directory)
+                          (loop)))
+                     ((string-null? (string-trim-right line)) ;blank line
+                      (loop))
+                     (else                        ;bogus line
+                      (let ((loc (location (port-filename port)
+                                           (port-line port)
+                                           (port-column port))))
+                        (warning loc (G_ "ignoring invalid file name: '~a'~%")
+                                 line))))))))))
+    (const #f)))
+
 (define (auto-detect-manifest opts)
   "If OPTS do not specify packages or a manifest, load a \"guix.scm\" or
 \"manifest.scm\" file from the current directory or one of its ancestors.
@@ -179,10 +215,26 @@ (define disallow-implicit-load?
          (warning (G_ "no packages specified; creating an empty environment~%"))
          opts)
         (file
-         (info (G_ "loading environment from '~a'...~%") file)
-         (match (basename file)
-           ("guix.scm" (alist-cons 'load `(package ,file) opts))
-           ("manifest.scm" (alist-cons 'manifest file opts)))))))
+         (if (authorized-shell-directory? (dirname file))
+             (begin
+               (info (G_ "loading environment from '~a'...~%") file)
+               (match (basename file)
+                 ("guix.scm" (alist-cons 'load `(package ,file) opts))
+                 ("manifest.scm" (alist-cons 'manifest file opts))))
+             (begin
+               (warning (G_ "not loading '~a' because not authorized to do so~%")
+                        file)
+               (display-hint (format #f (G_ "To allow automatic loading of
+@file{~a} when running @command{guix shell}, you must explicitly authorize its
+directory, like so:
+
+@example
+echo ~a >> ~a
+@end example\n")
+                                     file
+                                     (dirname file)
+                                     (authorized-directory-file)))
+               opts))))))
 
 
 (define-command (guix-shell . args)
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index 0988ca0a75..95725cba2d 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -22,19 +22,29 @@
 
 guix shell --version
 
+configdir="t-guix-shell-config-$$"
 tmpdir="t-guix-shell-$$"
-trap 'rm -r "$tmpdir"' EXIT
-mkdir "$tmpdir"
+trap 'rm -r "$tmpdir" "$configdir"' EXIT
+mkdir "$tmpdir" "$configdir" "$configdir/guix"
+
+XDG_CONFIG_HOME="$(realpath $configdir)"
+export XDG_CONFIG_HOME
 
 guix shell --bootstrap --pure guile-bootstrap -- guile --version
 
 # '--ad-hoc' is a thing of the past.
 ! guix shell --ad-hoc guile-bootstrap
 
-# Ignoring 'manifest.scm' and 'guix.scm' in non-interactive use.
+# Ignoring unauthorized files.
 cat > "$tmpdir/guix.scm" <<EOF
 This is a broken guix.scm file.
 EOF
+(cd "$tmpdir"; SHELL="$(type -P true)" guix shell --bootstrap)
+
+# Authorize the directory.
+echo "$(realpath "$tmpdir")" > "$configdir/guix/shell-authorized-directories"
+
+# Ignoring 'manifest.scm' and 'guix.scm' in non-interactive use.
 (cd "$tmpdir"; guix shell --bootstrap -- true)
 mv "$tmpdir/guix.scm" "$tmpdir/manifest.scm"
 (cd "$tmpdir"; guix shell --bootstrap -- true)
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:37 2021
Received: from localhost ([127.0.0.1]:32903 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30G-0001NS-S3
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:37 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45458)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma309-0001M2-5T
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40570)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma303-0004WO-Ty; Mon, 11 Oct 2021 17:38:23 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma303-0007Y0-KX; Mon, 11 Oct 2021 17:38:23 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 04/11] DRAFT shell: By default load the local 'guix.scm' or
 'manifest.scm' file.
Date: Mon, 11 Oct 2021 23:38:02 +0200
Message-Id: <20211011213809.17482-5-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

DRAFT: Add doc.

* guix/scripts/shell.scm (parse-args): Add call to 'auto-detect-manifest'.
(find-file-in-parent-directories, auto-detect-manifest): New procedures.
* tests/guix-shell.sh: Add test.
---
 guix/scripts/shell.scm | 67 ++++++++++++++++++++++++++++++++++++++----
 tests/guix-shell.sh    | 36 +++++++++++++++++++++++
 2 files changed, 98 insertions(+), 5 deletions(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 190dd8837d..39d843bde7 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -22,6 +22,8 @@ (define-module (guix scripts shell)
   #:autoload   (guix scripts build) (show-build-options-help)
   #:autoload   (guix transformations) (show-transformation-options-help)
   #:use-module (guix scripts)
+  #:use-module (guix packages)
+  #:use-module (guix profiles)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-37)
@@ -41,6 +43,8 @@ (define (show-help)
   (display (G_ "
   -f, --file=FILE        create environment for the package that the code within
                          FILE evaluates to"))
+  (display (G_ "
+  -q                     inhibit loading of 'guix.scm' and 'manifest.scm'"))
 
   (show-environment-options-help)
   (newline)
@@ -99,7 +103,10 @@ (define %options
               (option '(#\f "file") #t #f
                       (lambda (opt name arg result)
                         (alist-cons 'load (tag-package-arg result arg)
-                                    result))))
+                                    result)))
+              (option '(#\q) #f #f
+                      (lambda (opt name arg result)
+                        (alist-cons 'explicit-loading? #t result))))
         (filter-map (lambda (opt)
                       (and (not (any (lambda (name)
                                        (member name to-remove))
@@ -122,10 +129,60 @@ (define (handle-argument arg result)
   (let ((args command (break (cut string=? "--" <>) args)))
     (let ((opts (parse-command-line args %options (list %default-options)
                                     #:argument-handler handle-argument)))
-      (match command
-        (() opts)
-        (("--") opts)
-        (("--" command ...) (alist-cons 'exec command opts))))))
+      (auto-detect-manifest
+       (match command
+         (() opts)
+         (("--") opts)
+         (("--" command ...) (alist-cons 'exec command opts)))))))
+
+(define (find-file-in-parent-directories candidates)
+  "Find one of CANDIDATES in the current directory or one of its ancestors."
+  (define start (getcwd))
+  (define device (stat:dev (stat start)))
+
+  (let loop ((directory start))
+    (let ((stat (stat directory)))
+      (and (= (stat:uid stat) (getuid))
+           (= (stat:dev stat) device)
+           (or (any (lambda (candidate)
+                      (let ((candidate (string-append directory "/" candidate)))
+                        (and (file-exists? candidate) candidate)))
+                    candidates)
+               (and (not (string=? directory "/"))
+                    (loop (dirname directory)))))))) ;lexical ".." resolution
+
+(define (auto-detect-manifest opts)
+  "If OPTS do not specify packages or a manifest, load a \"guix.scm\" or
+\"manifest.scm\" file from the current directory or one of its ancestors.
+Return the modified OPTS."
+  (define (options-contain-payload? opts)
+    (match opts
+      (() #f)
+      ((('package . _) . _) #t)
+      ((('load . _) . _) #t)
+      ((('manifest . _) . _) #t)
+      ((('expression . _) . _) #t)
+      ((_ . rest) (options-contain-payload? rest))))
+
+  (define interactive?
+    (not (assoc-ref opts 'exec)))
+
+  (define disallow-implicit-load?
+    (assoc-ref opts 'explicit-loading?))
+
+  (if (or (not interactive?)
+          disallow-implicit-load?
+          (options-contain-payload? opts))
+      opts
+      (match (find-file-in-parent-directories '("guix.scm" "manifest.scm"))
+        (#f
+         (warning (G_ "no packages specified; creating an empty environment~%"))
+         opts)
+        (file
+         (info (G_ "loading environment from '~a'...~%") file)
+         (match (basename file)
+           ("guix.scm" (alist-cons 'load `(package ,file) opts))
+           ("manifest.scm" (alist-cons 'manifest file opts)))))))
 
 
 (define-command (guix-shell . args)
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index f08637f7ff..0988ca0a75 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -31,6 +31,36 @@ guix shell --bootstrap --pure guile-bootstrap -- guile --version
 # '--ad-hoc' is a thing of the past.
 ! guix shell --ad-hoc guile-bootstrap
 
+# Ignoring 'manifest.scm' and 'guix.scm' in non-interactive use.
+cat > "$tmpdir/guix.scm" <<EOF
+This is a broken guix.scm file.
+EOF
+(cd "$tmpdir"; guix shell --bootstrap -- true)
+mv "$tmpdir/guix.scm" "$tmpdir/manifest.scm"
+(cd "$tmpdir"; guix shell --bootstrap -- true)
+rm "$tmpdir/manifest.scm"
+
+# Honoring the local 'manifest.scm' file.
+cat > "$tmpdir/manifest.scm" <<EOF
+(specifications->manifest '("guile-bootstrap"))
+EOF
+cat > "$tmpdir/fake-shell.sh" <<EOF
+#!$SHELL
+# This fake shell allows us to test interactive use.
+exec echo "\$GUIX_ENVIRONMENT"
+EOF
+chmod +x "$tmpdir/fake-shell.sh"
+profile1="$(cd "$tmpdir"; SHELL="$(realpath fake-shell.sh)" guix shell --bootstrap)"
+profile2="$(guix shell --bootstrap guile-bootstrap -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT')"
+test -n "$profile1"
+test "$profile1" = "$profile2"
+rm "$tmpdir/manifest.scm"
+
+# Do not read manifest when passed '-q'.
+echo "Broken manifest." > "$tmpdir/manifest.scm"
+(cd "$tmpdir"; SHELL="$(realpath fake-shell.sh)" guix shell --bootstrap -q)
+rm "$tmpdir/manifest.scm"
+
 if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
 then
     # Compute the build environment for the initial GNU Make.
@@ -51,4 +81,10 @@ then
 
     # 'make-boot0' itself must not be listed.
     ! guix gc --references "$profile" | grep make-boot0
+
+    # Honoring the local 'guix.scm' file.
+    echo '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/guix.scm"
+    (cd "$tmpdir"; guix shell --bootstrap --search-paths --pure > "b")
+    cmp "$tmpdir/a" "$tmpdir/b"
+    rm "$tmpdir/guix.scm"
 fi
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:36 2021
Received: from localhost ([127.0.0.1]:32900 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30G-0001NG-3y
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45448)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma308-0001Lz-Jd
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40566)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma302-0004VZ-FR; Mon, 11 Oct 2021 17:38:22 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma302-0007Y0-4M; Mon, 11 Oct 2021 17:38:22 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 02/11] profiles: Add 'package->development-manifest'.
Date: Mon, 11 Oct 2021 23:38:00 +0200
Message-Id: <20211011213809.17482-3-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludovic.courtes@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

From: Ludovic Courtès <ludovic.courtes@HIDDEN>

* guix/profiles.scm (package->development-manifest): New procedure.
* guix/scripts/environment.scm (input->manifest-entry)
(package-environment-inputs): Remove.
* guix/scripts/environment.scm (options/resolve-packages): Use
'package->development-manifest' instead of 'package-environment-inputs'.
* tests/profiles.scm ("package->development-manifest"): New test.
---
 doc/guix.texi                | 11 +++++++++++
 guix/profiles.scm            | 19 +++++++++++++++++++
 guix/scripts/environment.scm | 27 +++++----------------------
 tests/profiles.scm           |  7 +++++++
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 49399e792b..bc3f5a537b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3340,6 +3340,17 @@ objects, like this:
  '("emacs" "guile@@2.2" "guile@@2.2:debug"))
 @end lisp
 
+@findex package->development-manifest
+You might also want to create a manifest for all the dependencies of a
+package, rather than the package itself:
+
+@lisp
+(package->development-manifest (specification->package "emacs"))
+@end lisp
+
+The example above gives you all the software required to develop Emacs,
+similar to what @command{guix environment emacs} provides.
+
 @xref{export-manifest, @option{--export-manifest}}, to learn how to
 obtain a manifest file from an existing profile.
 
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 2486f91d09..9f30349c69 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -124,6 +124,7 @@ (define-module (guix profiles)
 
             profile-manifest
             package->manifest-entry
+            package->development-manifest
             packages->manifest
             ca-certificate-bundle
             %default-profile-hooks
@@ -400,6 +401,24 @@ (define* (package->manifest-entry package #:optional (output "out")
                      (properties properties))))
     entry))
 
+(define* (package->development-manifest package
+                                        #:optional
+                                        (system (%current-system))
+                                        #:key target)
+  "Return a manifest for the \"development inputs\" of PACKAGE for SYSTEM,
+optionally when cross-compiling to TARGET.  Development inputs include both
+explicit and implicit inputs of PACKAGE."
+  (manifest
+   (filter-map (match-lambda
+                 ((label (? package? package))
+                  (package->manifest-entry package))
+                 ((label (? package? package) output)
+                  (package->manifest-entry package output))
+                 ;; TODO: Support <inferior-package>.
+                 (_
+                  #f))
+               (package-development-inputs package system #:target target))))
+
 (define (packages->manifest packages)
   "Return a list of manifest entries, one for each item listed in PACKAGES.
 Elements of PACKAGES can be either package objects or package/string tuples
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index d555969b27..54f48a7482 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -66,24 +66,6 @@ (define* (show-search-paths profile manifest #:key pure?)
                (newline)))
             (profile-search-paths profile manifest)))
 
-(define (input->manifest-entry input)
-  "Return a manifest entry for INPUT, or #f if INPUT does not correspond to a
-package."
-  (match input
-    ((_ (? package? package))
-     (package->manifest-entry package))
-    ((_ (? package? package) output)
-     (package->manifest-entry package output))
-    (_
-     #f)))
-
-(define (package-environment-inputs package)
-  "Return a list of manifest entries corresponding to the transitive input
-packages for PACKAGE."
-  ;; Remove non-package inputs such as origin records.
-  (filter-map input->manifest-entry
-              (package-development-inputs package system)))
-
 (define (show-help)
   (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
 Build an environment that includes the dependencies of PACKAGE and execute
@@ -297,11 +279,11 @@ (define (packages->outputs packages mode)
       ((? package? package)
        (if (eq? mode 'ad-hoc-package)
            (list (package->manifest-entry* package))
-           (package-environment-inputs package)))
+           (manifest-entries (package->development-manifest package))))
       (((? package? package) (? string? output))
        (if (eq? mode 'ad-hoc-package)
            (list (package->manifest-entry* package output))
-           (package-environment-inputs package)))
+           (manifest-entries (package->development-manifest package))))
       ((lst ...)
        (append-map (cut packages->outputs <> mode) lst))))
 
@@ -313,8 +295,9 @@ (define (packages->outputs packages mode)
                                  (specification->package+output spec)))
                      (list (package->manifest-entry* package output))))
                   (('package 'package (? string? spec))
-                   (package-environment-inputs
-                    (transform (specification->package+output spec))))
+                   (manifest-entries
+                    (package->development-manifest
+                     (transform (specification->package+output spec)))))
                   (('expression mode str)
                    ;; Add all the outputs of the package STR evaluates to.
                    (packages->outputs (read/eval str) mode))
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 06a0387221..cac5b73347 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -265,6 +265,13 @@ (define transform1
            (manifest-transaction-removal-candidate? guile-2.0.9 t)
            (null? install) (null? downgrade) (null? upgrade)))))
 
+(test-assert "package->development-manifest"
+  (let ((manifest (package->development-manifest packages:hello)))
+    (every (lambda (name)
+             (manifest-installed? manifest
+                                  (manifest-pattern (name name))))
+           '("gcc" "binutils" "glibc" "coreutils" "grep" "sed"))))
+
 (test-assertm "profile-derivation"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:36 2021
Received: from localhost ([127.0.0.1]:32894 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma30C-0001Mq-JH
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45440)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma307-0001Lw-7v
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:28 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40562)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma301-0004Ul-42; Mon, 11 Oct 2021 17:38:21 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma300-0007Y0-R0; Mon, 11 Oct 2021 17:38:21 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 00/11] 'guix shell' strikes again
Date: Mon, 11 Oct 2021 23:37:58 +0200
Message-Id: <20211011213809.17482-1-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello Guix!

Here’s a v2 with the following changes:

  • ‘guix.scm’ and ‘manifest.scm’ only loaded in interactive mode,
    as suggested by Konrad.

  • Auto-loading happens if and only if the containing directory
    is listed in ~/.config/guix/shell-authorized-directories, as
    suggested by Florian.  When a file is found but not authorized,
    a hint is displayed explaining what to do.

  • ‘-q’ inhibits auto-loading.

  • Auto-detection of ‘guix.scm’ and ‘manifest.scm’ uses lexical
    “..” resolution and does not cross device boundaries.

  • Long version of ‘-f’ is now ‘--file’, like for ‘guix build’.

  • Caching also works with files explicitly specified with ‘-m’
    or ‘-f’.  That way, ‘guix shell -f guix.scm -- make’ benefits
    from it.

  • Cache key does not include file name, to avoid cache misses
    given that the file name is not canonicalized (see discussion
    with Maxime).

  • Documentation, including a tentative EOL date for ‘guix
    environment’ (“supported until at least May 1st, 2023”).  The
    intention is to give an incentive to switch while reassuring
    that it won’t disappear overnight.

How does that sound?  :-)

Ludo’.

Ludovic Courtès (11):
  packages: Add 'package-development-inputs'.
  profiles: Add 'package->development-manifest'.
  Add 'guix shell'.
  DRAFT shell: By default load the local 'guix.scm' or 'manifest.scm'
    file.
  DRAFT shell: Honor in ~/.config/guix/shell-authorized-directories.
  environment: Add tests for '--profile'.
  environment: Skip derivation computation when '--profile' is used.
  environment: Do not connect to the daemon when '--profile' is used.
  environment: Autoload some modules.
  cache: Gracefully handle non-existent cache.
  shell: Maintain a profile cache.

 Makefile.am                         |   2 +
 doc/contributing.texi               |   8 +-
 doc/guix.texi                       | 443 ++++++++++++++++++++++++++--
 guix/cache.scm                      |  10 +-
 guix/packages.scm                   |  10 +
 guix/profiles.scm                   |  19 ++
 guix/scripts/environment.scm        | 260 ++++++++--------
 guix/scripts/shell.scm              | 355 ++++++++++++++++++++++
 po/guix/POTFILES.in                 |   1 +
 tests/guix-environment-container.sh |   8 +
 tests/guix-environment.sh           |   7 +
 tests/guix-shell.sh                 | 100 +++++++
 tests/packages.scm                  |  14 +
 tests/profiles.scm                  |   7 +
 14 files changed, 1098 insertions(+), 146 deletions(-)
 create mode 100644 guix/scripts/shell.scm
 create mode 100644 tests/guix-shell.sh

-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 21:38:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 17:38:28 2021
Received: from localhost ([127.0.0.1]:32888 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ma308-0001MJ-5y
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:28 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45444)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1ma307-0001Lx-Dy
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 17:38:27 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40564)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1ma301-0004VQ-P9; Mon, 11 Oct 2021 17:38:21 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53321
 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1ma301-0007Y0-Fk; Mon, 11 Oct 2021 17:38:21 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH v2 01/11] packages: Add 'package-development-inputs'.
Date: Mon, 11 Oct 2021 23:37:59 +0200
Message-Id: <20211011213809.17482-2-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211011213809.17482-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211011213809.17482-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/packages.scm (package-development-inputs): New procedure.
* guix/scripts/environment.scm (package-environment-inputs): Use it.
* tests/packages.scm ("package-development-inputs")
("package-development-inputs, cross-compilation"): New tests.
* doc/guix.texi (package Reference): Document it.
---
 doc/guix.texi                | 41 ++++++++++++++++++++++++++++++++++++
 guix/packages.scm            | 10 +++++++++
 guix/scripts/environment.scm |  2 +-
 tests/packages.scm           | 14 ++++++++++++
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a72a726b54..49399e792b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6847,6 +6847,47 @@ cross-compiling:
 It is an error to refer to @code{this-package} outside a package definition.
 @end deffn
 
+@cindex development inputs, of a package
+@cindex implicit inputs, of a package
+Sometimes you will want to obtain the list of inputs needed to
+@emph{develop} a package---all the inputs that are visible when the
+package is compiled.  This is what the @code{package-development-inputs}
+procedure returns.
+
+@deffn {Scheme Procedure} package-development-inputs @var{package} @
+   [@var{system}] [#:target #f]
+Return the list of inputs required by @var{package} for development
+purposes on @var{system}.  When @var{target} is true, return the inputs
+needed to cross-compile @var{package} from @var{system} to
+@var{triplet}, where @var{triplet} is a triplet such as
+@code{"aarch64-linux-gnu"}.
+
+Note that the result includes both explicit inputs and implicit
+inputs---inputs automatically added by the build system (@pxref{Build
+Systems}).  Let us take the @code{hello} package to illustrate that:
+
+@lisp
+(use-modules (gnu packages base) (guix packages))
+
+hello
+@result{} #<package hello@@2.10 gnu/packages/base.scm:79 7f585d4f6790>
+
+(package-direct-inputs hello)
+@result{} ()
+
+(package-development-inputs hello)
+@result{} (("source" @dots{}) ("tar" #<package tar@@1.32 @dots{}>) @dots{})
+@end lisp
+
+In this example, @code{package-direct-inputs} returns the empty list,
+because @code{hello} has zero explicit dependencies.  Conversely,
+@code{package-development-inputs} includes inputs implicitly added by
+@code{gnu-build-system} that are required to build @code{hello}: tar,
+gzip, GCC, libc, Bash, and more.  To visualize it, @command{guix graph
+hello} would show you explicit inputs, whereas @command{guix graph -t
+bag hello} would include implicit inputs (@pxref{Invoking guix graph}).
+@end deffn
+
 Because packages are regular Scheme objects that capture a complete
 dependency graph and associated build procedures, it is often useful to
 write procedures that take a package and return a modified version
diff --git a/guix/packages.scm b/guix/packages.scm
index 8c3a0b0b7b..43e0130793 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -153,6 +153,7 @@ (define-module (guix packages)
             bag-transitive-host-inputs
             bag-transitive-build-inputs
             bag-transitive-target-inputs
+            package-development-inputs
             package-closure
 
             default-guile
@@ -1070,6 +1071,15 @@ (define (bag-transitive-target-inputs bag)
                  (%current-system (bag-system bag)))
     (transitive-inputs (bag-target-inputs bag))))
 
+(define* (package-development-inputs package
+                                     #:optional (system (%current-system))
+                                     #:key target)
+  "Return the list of inputs required by PACKAGE for development purposes on
+SYSTEM.  When TARGET is true, return the inputs needed to cross-compile
+PACKAGE from SYSTEM to TRIPLET, where TRIPLET is a triplet such as
+\"aarch64-linux-gnu\"."
+  (bag-transitive-inputs (package->bag package system target)))
+
 (define* (package-closure packages #:key (system (%current-system)))
   "Return the closure of PACKAGES on SYSTEM--i.e., PACKAGES and the list of
 packages they depend on, recursively."
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 6958bd6238..d555969b27 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -82,7 +82,7 @@ (define (package-environment-inputs package)
 packages for PACKAGE."
   ;; Remove non-package inputs such as origin records.
   (filter-map input->manifest-entry
-              (bag-transitive-inputs (package->bag package))))
+              (package-development-inputs package system)))
 
 (define (show-help)
   (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
diff --git a/tests/packages.scm b/tests/packages.scm
index 3756877270..266b5aeb7a 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -353,6 +353,20 @@ (define read-at
           (package-transitive-supported-systems d)
           (package-transitive-supported-systems e))))
 
+(test-assert "package-development-inputs"
+  ;; Note: Due to propagated inputs, 'package-development-inputs' returns a
+  ;; couple more inputs, such as 'linux-libre-headers'.
+  (lset<= equal?
+          `(("source" ,(package-source hello)) ,@(standard-packages))
+          (package-development-inputs hello)))
+
+(test-assert "package-development-inputs, cross-compilation"
+  (lset<= equal?
+          `(("source" ,(package-source hello))
+            ,@(standard-cross-packages "mips64el-linux-gnu" 'host)
+            ,@(standard-cross-packages "mips64el-linux-gnu" 'target))
+          (package-development-inputs hello #:target "mips64el-linux-gnu")))
+
 (test-assert "package-closure"
   (let-syntax ((dummy-package/no-implicit
                 (syntax-rules ()
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 09:14:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 05:14:10 2021
Received: from localhost ([127.0.0.1]:56574 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZrNp-0002yN-Rm
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 05:14:10 -0400
Received: from mail-qt1-f173.google.com ([209.85.160.173]:39865)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mZrNn-0002yA-W0
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 05:14:09 -0400
Received: by mail-qt1-f173.google.com with SMTP id i1so14635412qtr.6
 for <50960 <at> debbugs.gnu.org>; Mon, 11 Oct 2021 02:14:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=Wz+axUhu4XMz33oNVKhlPL3X4pB5DY/yDRPd4gjjw1M=;
 b=Cid19gX88PjPyVSi0taIxlLPdWjRp8jkok4S6NSzIkv/qlKugoFJzzj3RH1Lv5PI2D
 mrL3Glotb+Vhfd8AhvnEbZMQuUpwc+wL+mMq+djUURgq/RajIAULmlj9TVMh+7kOFHTA
 bbKWzWYKNENNmlHkoKgz5JVKoLDK4cPrcUY65uNpAx0R4jWAMICF1UfQ42XsgAHWN0xg
 DOIbVfwtpJCjs5Dsn6RMbGiBNNU+RT4K6i4/ILZMhJZkqb8cBmE6v3bk/xEJ+aSVemZh
 evJd6OrTuHHNe0W+QSjaZxiRiqXLk/mtn5avox6H/Gcvxyawo511qVhcUmjrUozYFRVG
 cmkw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=Wz+axUhu4XMz33oNVKhlPL3X4pB5DY/yDRPd4gjjw1M=;
 b=ZuE1b3+BQIhemizezn+77Y80Xl3kj0UNsBBYLhgoaRUcrX6a5w4AfT/1Z0arLKdY0Q
 Ear53G5zzO/MrZzHObp0Io0PLxwxn9e3Vfe26a3UqN3pbFykKYNTZ/l4ksfBdesExD8z
 cvn1nEkWgD7kuqmd+NFc2PJSnX8aR3sycw1dLMcH8dluKjj/ZsaNdECjZzferbT7tefU
 SSVo9xmw7LPLoFhnrq7ZA6up0/tXnidfZLHBcKLexikwpRFFw2P2lFeZjX15zR4azKBK
 zByj4KXJLjyHyUkpaHHY/m4L7QTofwX5sGmJlG52JxA2BCDdAGj5htNRW/sAJ2dgHO6A
 yGTg==
X-Gm-Message-State: AOAM5325X53FgHCkBilWYQT8V5iHODH7OXjOh50IHbRJTUqBTTzfFL7S
 a8iPF8Qe4j38hMwzOS8dsZPZ0lPvuM16y5S7cSk=
X-Google-Smtp-Source: ABdhPJwD6RYWIQPrg2XV9gW48j7kNsErXoC8Orxzr+W07cmfPvY9nH1t6UILbAK/AOjCbCkhMRLnxkOPAP00zCWE2cA=
X-Received: by 2002:a05:622a:316:: with SMTP id
 q22mr13303962qtw.225.1633943642344; 
 Mon, 11 Oct 2021 02:14:02 -0700 (PDT)
MIME-Version: 1.0
References: <20211002102116.27726-1-ludo@HIDDEN>
 <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
 <877depdw3i.fsf_-_@HIDDEN>
In-Reply-To: <877depdw3i.fsf_-_@HIDDEN>
From: zimoun <zimon.toutoune@HIDDEN>
Date: Mon, 11 Oct 2021 11:13:51 +0200
Message-ID: <CAJ3okZ3ZpujpsCamLAQ315LvZEizKA-4RaVv=Ys-WpR783ngLQ@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, "Thompson, David" <dthompson2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

On Thu, 7 Oct 2021 at 11:27, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
> "Thompson, David" <dthompson2@HIDDEN> skribis:
>
> > 1) I can't be the only one that thinks it's a pain to rebuild the
> > whole environment just because I updated the Guix client. It's
> > especially frustrating when there is a regression that breaks the
> > project, or the substitute servers are having a bad day.
>
> The way I see it, I update Guix precisely to get a newer environment.
> Otherwise, why would I update it for?

I think there is a kind of misunderstanding because one updates Guix
because of new project B but then rebuilds the whole environment for
project A.  And this can be unpleasant.

The solution is to use "guix time-machine -C channels.scm --
environment" but again this can be unpleasant because it builds a lot
of things; although before one runs "guix environment".

Well, you should tell me that the solution is to create a profile.
However, I often use "guix environment" with the options --pure or
--container, and a profile cannot, IIUC.


> Perhaps =E2=80=98guix time-machine=E2=80=99, too, could automatically det=
ect
> =E2=80=98channels.scm=E2=80=99.

Well, I am not convince it helps for readibility.  At the end, it would rea=
d:

  guix time-machine -- shell

but then to know what this command does exactly, one should open the
manual check the "guix time-machine" part, check the presence of the
'channels.scm' file, then read the "guix shell" part, then check if if
is 'manifests.scm' or 'guix.scm'.  Maybe, it is just habits, but I
find much simpler:

  guix time-machine -C channels -- shell -m manifest.scm
  guix time-machine -C channels -- shell -f guix.scm

where I just have at the command-line type "guix time-machine --help"
or "guix shell --help" to remember the options and if I do not know
what manifest is, then I go to the manual.

With completion, it is not longer to type.  "Explicit is better than
implicit" as a good Zen says!


> The temptation to add revision data to tools that don=E2=80=99t otherwise=
 deal
> with it is real; I think it=E2=80=99s better kept separate though, becaus=
e
> fundamentally, each revision lives in its own world.

I agree.


All the best,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 08:32:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 11 04:32:20 2021
Received: from localhost ([127.0.0.1]:56529 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZqjM-0007s5-MP
	for submit <at> debbugs.gnu.org; Mon, 11 Oct 2021 04:32:20 -0400
Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:15352)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludovic.courtes@HIDDEN>) id 1mZqjK-0007mX-Oj
 for 50960 <at> debbugs.gnu.org; Mon, 11 Oct 2021 04:32:19 -0400
IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A44/JmqCZl4OoswvlHemr55DYdb4zR+YMi2TD?=
 =?us-ascii?q?GXocdfU1SL37qynApp8mPHPP4gr5HUtPpTniAtjifZq/z/FICOAqVN+ftUvd2V?=
 =?us-ascii?q?dAR7sD0WKW+UyHJ8SIzJ876U4PScVD4aXLfDxHZJHBkWyFL+o=3D?=
X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="395495122"
Received: from unknown (HELO ribbon) ([193.50.110.91])
 by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 11 Oct 2021 10:32:12 +0200
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludovic.courtes@HIDDEN>
To: Konrad Hinsen <konrad.hinsen@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <m1fste4lnp.fsf@HIDDEN> <87mtnlfd2n.fsf_-_@HIDDEN>
 <m1pmsffrky.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 20 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 11 Oct 2021 10:32:12 +0200
In-Reply-To: <m1pmsffrky.fsf@HIDDEN> (Konrad Hinsen's message of "Fri,
 08 Oct 2021 17:45:33 +0200")
Message-ID: <87bl3w0xo3.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Konrad Hinsen <konrad.hinsen@HIDDEN> skribis:

>> To me it=E2=80=99s the same as =E2=80=98guix environment=E2=80=99, but w=
ith a slightly different
>> command-line interface; =E2=80=98guix environment=E2=80=99 was already s=
erves these two
>> use cases.
>
> Indeed, but the new proposal goes much further with supporting
> interactive convenience, in particular via the controversial reading of
> guix.scm and/or manifest.scm. That's a convenience I'd like to have
> interactively, but not something I expect from an infrastructure tool
> that ends up being used in lengthy shell script. For the latter, the
> "Zen of Python wisdom" of "explicit is better than implicit" matters a
> lot. On the command line, it makes life harder, in particular for bad
> typists such as myself.

Agreed.  The automatic reading of guix.scm/manifest.scm, if we keep it,
should only happen in interactive use; I=E2=80=99ll double-check and make s=
ure
this is the case.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 11 Oct 2021 00:29:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 10 20:29:40 2021
Received: from localhost ([127.0.0.1]:56109 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZjCG-0008LS-Kd
	for submit <at> debbugs.gnu.org; Sun, 10 Oct 2021 20:29:40 -0400
Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:33159)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1mZjCF-0008LE-FX
 for 50960 <at> debbugs.gnu.org; Sun, 10 Oct 2021 20:29:40 -0400
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.west.internal (Postfix) with ESMTP id AC2613200E5E;
 Sun, 10 Oct 2021 20:29:33 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute1.internal (MEProxy); Sun, 10 Oct 2021 20:29:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-transfer-encoding:in-reply-to; s=mesmtp;
 bh=vPaT05OGUKwfUf9egHkMvusibCv2sdpPspiY751x1XM=; b=ntyAgk3+ypiH
 j9aFNVYOVLAq/bkfGljUHEzbBqNIw/sfBC5ZhRi6VArcf3Vwuct9gm3s6cdhJYFZ
 Hcs1EL2SH7BuZfRyNQRPnJHzfvRx0h8hQF+4BGtmUcE8Y4iPfFdg4JOlIvtnhNX/
 rc0AL2hSX0BenVGaPj4gGpVzFiUdOFo=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=vPaT05OGUKwfUf9egHkMvusibCv2sdpPspiY751x1
 XM=; b=M8IxbuMyzdXa1dX8Iz/rXOO/sOWcBZc2EcKOk4K3RPRtB0pfty9Tdploy
 9QOYFW1RV6ThlI/ZvQQABQpjyJp5PYmLabGp49cyTr7SudeEnAdAQ8SM8ijex4PV
 +Ylkcog1KAlslwENboJ4V780JBPcYNhOkRxjFxL97rJa2u+03n/YVoJ8PHSQ0SCT
 vQGPgls/FT3GK5GM+AcItJP4IAFUQ5JemmbuKagmuvYAzv67g2IlrVCs6kX90o/5
 zAbNg/e+wYnsTBBuj4IOuv3JSQ0nJHQCMp4dCf+YcLCgYYmDuRxoD5yYLAslyEe5
 RkCj1V2IaXqJuvouPjo+G37N3CW3Q==
X-ME-Sender: <xms:bIVjYT7VmClHhJ7oWhWCj4zPr1Y_zIJ7IsULWd-M2jlIo9eZIKPI7w>
 <xme:bIVjYY6bxqbmr6ERTOIsgEgg06rBXP7Pj-B2Xvr588wvgbkOMnu_xr9xsqSbvxhez
 MXyV9kwO0q7y77w9g>
X-ME-Received: <xmr:bIVjYacnmvTm4JbdlYFHBIDyprAR3xbNOHmGMiwx8_9xgSquDFxVFOHkR37zjAxF-n1umJpphW1kFbxnVkh8P65vOQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddthedgfeegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepfffhvffukfhfgggtugfgjgesthekredttddtjeenucfhrhhomhepnfgvohcu
 hfgrmhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecuggftrfgrth
 htvghrnhepgeejgeeghedtudfgffdutddvffefffejkeffffevffehgedvvdeutdffkeej
 jeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplh
 gvohesfhgrmhhulhgrrhhirdhnrghmvg
X-ME-Proxy: <xmx:bIVjYUJYGkqpTgRWuoEYi6XJv7nGY8hQnR82YAwn4ZvsFEEb_44lWA>
 <xmx:bIVjYXKkng1IyX1JxCUQYSD0nNHTUTZSl4uwdbZJoLHA0EgB2PgsVg>
 <xmx:bIVjYdwMSUqtGFmXd6tZPzP97l6t06CJLNPwpCTlRJKfSpZzeFTDhQ>
 <xmx:bYVjYZzy7-J-rXWugowktjWjw1ZMmbkFuKlkL_glR-8YI2WCohnYYA>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 10 Oct 2021 20:29:32 -0400 (EDT)
Date: Sun, 10 Oct 2021 20:29:29 -0400
From: Leo Famulari <leo@HIDDEN>
To: Ludovic =?iso-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <YWOFaa1uC94fvRC4@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <YVs8CBpBBnw6gFzZ@HIDDEN> <87o88055d4.fsf@HIDDEN>
 <YWBuwMzkvzKnTr3Z@HIDDEN> <87y272xqq8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87y272xqq8.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Sat, Oct 09, 2021 at 03:38:55PM +0200, Ludovic Courtès wrote:
> What do you mean by “old behavior”?

I mean that all the packages listed after the option are affected by it.

> More importantly, I think having ‘-D’ affect only the immediately
> following package is more consistent with typical usage—I don’t think
> I’ve ever run ‘guix environment foo bar baz’ to get the merged
> development environments of all three packages.

I see what you mean: that is a weird behaviour. Let's disregard the
question I brought up.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 9 Oct 2021 13:39:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 09 09:39:04 2021
Received: from localhost ([127.0.0.1]:52502 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZCZ6-0005es-8m
	for submit <at> debbugs.gnu.org; Sat, 09 Oct 2021 09:39:04 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60524)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mZCZ4-0005eP-M5
 for 50960 <at> debbugs.gnu.org; Sat, 09 Oct 2021 09:39:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55028)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mZCYz-0003qi-6E; Sat, 09 Oct 2021 09:38:57 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:59218
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mZCYy-0006x2-T2; Sat, 09 Oct 2021 09:38:57 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Leo Famulari <leo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <YVs8CBpBBnw6gFzZ@HIDDEN> <87o88055d4.fsf@HIDDEN>
 <YWBuwMzkvzKnTr3Z@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 18 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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, 09 Oct 2021 15:38:55 +0200
In-Reply-To: <YWBuwMzkvzKnTr3Z@HIDDEN> (Leo Famulari's message of "Fri, 8
 Oct 2021 12:16:00 -0400")
Message-ID: <87y272xqq8.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Leo Famulari <leo@HIDDEN> skribis:

> On Fri, Oct 08, 2021 at 09:43:19AM +0200, Ludovic Court=C3=A8s wrote:
>> No, it=E2=80=99s the same.  However, =E2=80=98-D=E2=80=99 here affects o=
nly the immediately
>> following package, whereas =E2=80=98--ad-hoc=E2=80=99 would affect every=
 package that
>> follows.
>
> I must not know the correct terminology; that's what I was trying to
> ask.
>
> Can we keep the old behavior?  Or do we think this new way of doing it
> is better?

What do you mean by =E2=80=9Cold behavior=E2=80=9D?

I think there=E2=80=99s large consensus that =E2=80=98--ad-hoc=E2=80=99 sho=
uld be the default,
and that=E2=80=99s the main motivation behind this patch series.

As for =E2=80=98-D=E2=80=99: we could arrange so that it has effect on all =
the following
packages.  However, if we did that, we=E2=80=99d need to reintroduce =E2=80=
=98--ad-hoc=E2=80=99
to cancel the effect of =E2=80=98-D=E2=80=99.

More importantly, I think having =E2=80=98-D=E2=80=99 affect only the immed=
iately
following package is more consistent with typical usage=E2=80=94I don=E2=80=
=99t think
I=E2=80=99ve ever run =E2=80=98guix environment foo bar baz=E2=80=99 to get=
 the merged
development environments of all three packages.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 9 Oct 2021 08:07:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 09 04:07:47 2021
Received: from localhost ([127.0.0.1]:52278 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZ7OV-0007Nz-I7
	for submit <at> debbugs.gnu.org; Sat, 09 Oct 2021 04:07:47 -0400
Received: from smtpout2.vodafonemail.de ([145.253.239.133]:43306)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan-guix@HIDDEN>) id 1mZ7OR-0007Nf-D8
 for 50960 <at> debbugs.gnu.org; Sat, 09 Oct 2021 04:07:46 -0400
Received: from smtp.vodafone.de (unknown [10.2.0.37])
 by smtpout2.vodafonemail.de (Postfix) with ESMTP id 2204861709;
 Sat,  9 Oct 2021 10:07:16 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de;
 s=vfde-smtpout-mb-15sep; t=1633766836;
 bh=t5dak185zZp0Na6wRrcwyIWsJ5DcQi7ZA725F4PrMsE=;
 h=From:Date:Subject:Cc:To;
 b=WN7fUTaGzfBp8ADHh5sBPqYfUU9aoTd2cgFvMy6FBomdKWZHU1LONJpTAqLMDWzfT
 yTt4cK+dBPWKH8777teyR5YeiqgMsu3wYQlvGBJ2oN3XR2KV0HfRAfuRdhywBwG23l
 BvnXjb4SgyxFNSH/0f5ZmEKJy9bEFxluVbVtuXmg=
Received: from smtpclient.apple
 (dslb-002-202-077-004.002.202.pools.vodafone-ip.de [2.202.77.4])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by smtp.vodafone.de (Postfix) with ESMTPSA id D1EDA1401B0;
 Sat,  9 Oct 2021 08:07:15 +0000 (UTC)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
From: Stefan <stefan-guix@HIDDEN>
Mime-Version: 1.0 (1.0)
Date: Sat, 9 Oct 2021 10:07:14 +0200
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-Id: <F72DB966-D292-4169-AFD2-0FBD9C9B7BAC@HIDDEN>
To: liliana.prikler@HIDDEN
X-Mailer: iPhone Mail (19A346)
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
 further information)
X-purgate: clean
X-purgate-size: 256
X-purgate-ID: 155817::1633766835-00003C24-00B9D060/0/0
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, konrad.hinsen@HIDDEN, ludovic.courtes@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi!

How about a directory argument to load some standard file? And using a speci=
al ... to search all parent directories?

guix shell .      ;# ./guix.scm
guix shell ..     ;# ../guix.scm
guix shell ...    ;# ./(../)*guix.scm


Bye

Stefan=




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 9 Oct 2021 07:45:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 09 03:45:41 2021
Received: from localhost ([127.0.0.1]:52254 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mZ737-0006oy-Dr
	for submit <at> debbugs.gnu.org; Sat, 09 Oct 2021 03:45:41 -0400
Received: from mail-wr1-f68.google.com ([209.85.221.68]:41935)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1mZ735-0006oj-MA
 for 50960 <at> debbugs.gnu.org; Sat, 09 Oct 2021 03:45:40 -0400
Received: by mail-wr1-f68.google.com with SMTP id t2so36616731wrb.8
 for <50960 <at> debbugs.gnu.org>; Sat, 09 Oct 2021 00:45:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:subject:from:to:date:in-reply-to:references:user-agent
 :mime-version:content-transfer-encoding;
 bh=/Z703v8jZvDgAWaLnxF5Cv0R9hJ/gzn5I547PTcQ8VY=;
 b=i9bHcLzjkjb7K72rmPuwDV6QL6eCnKiyVBvgT9M2P6iprOYHDHpDtnwHsz32hqJBOh
 rkxH6YVpAlWBVDmwEAmPodefaPVcLMEn1uxBtvroXE2B1Yd50egMyhBQnGPnaksb3lu0
 Bi6/B3we9Li3/aRPMBZxuxV6orlwst9az+KUq1qGAoOfgh/uBskSiRRyZQ4pYr04ks34
 86++SPtb23RQ3ck4bttTDhCemVAWSBh3a2sLZqnWOy5+ceD+BbVlbdFa/XaACmJHY21M
 o2yiJFglzAmJQGTpWZm+ZEJg2BYIaAzmH8tExu08t2XrKeu5LVcEIEYsH//oh57p69+4
 vcKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to
 :references:user-agent:mime-version:content-transfer-encoding;
 bh=/Z703v8jZvDgAWaLnxF5Cv0R9hJ/gzn5I547PTcQ8VY=;
 b=wpcXccSpMDlQ+TO2bOnpgwNN8nlV8Bkkz7nANDZQL5Qilr/+Oz7uhlAmZurI36Q7SC
 Hcj5N8Go6aOPKQ3CzWYQTpNxS38/WIssOzT+WMZ5+GOymOD2w3+qmoug8Yk/CojagXqw
 5s0m01smR9eJsgh08boXPgOruFxi2n/In5d+j4ywHxW+By5UP32P3+nZmFBJTPcfht3B
 K/8khq+9cu7+vvrDtXcqph9HyuVHr+WSPGichSY26blQGWPstxftW7IxvYDO7Z+mRaON
 Q360yBKRxM2sERr3+y/lnV1IbHV2uAQVjZJ0MLlQFo75CGGLxlc5YZ8STR+zGiHoFlrx
 QDfA==
X-Gm-Message-State: AOAM531QWGuZQeXsOeXwMRuzqT8aC1RHtu0bJnvZZ6JK3vB9iupgr4mz
 ySCtcVE9q4j2i38UcoXJjgE=
X-Google-Smtp-Source: ABdhPJy+gYQlVkACxGVcogxehPAX1n1wiT+anlbnEDIxTlbnX5bL71uBvswYeeBQsr3m5dUT6irTXg==
X-Received: by 2002:a05:600c:4f87:: with SMTP id
 n7mr8288522wmq.194.1633765533569; 
 Sat, 09 Oct 2021 00:45:33 -0700 (PDT)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id g2sm1476429wrq.62.2021.10.09.00.45.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 09 Oct 2021 00:45:33 -0700 (PDT)
Message-ID: <b263ffa2e4a1a13ba83aec6bafe2e03410e42009.camel@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Konrad Hinsen <konrad.hinsen@HIDDEN>, Ludovic
 =?ISO-8859-1?Q?Court=E8s?=
 <ludovic.courtes@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 09 Oct 2021 09:45:31 +0200
In-Reply-To: <m1pmsffrky.fsf@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <m1fste4lnp.fsf@HIDDEN> <87mtnlfd2n.fsf_-_@HIDDEN>
 <m1pmsffrky.fsf@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Am Freitag, den 08.10.2021, 17:45 +0200 schrieb Konrad Hinsen:
> Hi Ludo and Liliana,
> 
> > To me it’s the same as ‘guix environment’, but with a slightly
> > different command-line interface; ‘guix environment’ was already
> > serves these two use cases.
> 
> Indeed, but the new proposal goes much further with supporting
> interactive convenience, in particular via the controversial reading
> of guix.scm and/or manifest.scm. That's a convenience I'd like to
> have interactively, but not something I expect from an infrastructure
> tool that ends up being used in lengthy shell script. For the latter,
> the "Zen of Python wisdom" of "explicit is better than implicit"
> matters a lot. On the command line, it makes life harder, in
> particular for bad typists such as myself.
> 
> > Perhaps to avoid this trouble, guix shell could read a file that
> > simply specifies which arguments to add one line at a time e.g.
> > 
> >   ;; .guix-shell-rc
> >   --manifest=manifest.scm
> 
> That's a nice idea, but again something I wouldn't want an
> infrastructure tool to do. When I use "guix environment" or "guix
> shell" in a script or workflow, I want whatever it does to be as
> independent as possible from my machine or account, except when I
> explicitly say the contrary.
People do use “emacs -Q” so there's no hard “one way or the other”
requirement.  All we would need to do is offer a similar flag to
prevent reading the rc file, no?

Cheers,
Liliana





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 8 Oct 2021 16:16:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 12:16:10 2021
Received: from localhost ([127.0.0.1]:51800 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYsXa-0002F0-0n
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 12:16:10 -0400
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44905)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1mYsXY-0002EZ-Em
 for 50960 <at> debbugs.gnu.org; Fri, 08 Oct 2021 12:16:08 -0400
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 5F1EE5C010B;
 Fri,  8 Oct 2021 12:16:02 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute4.internal (MEProxy); Fri, 08 Oct 2021 12:16:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-transfer-encoding:in-reply-to; s=mesmtp;
 bh=zmpDsrVlrPlLVnoHFCMgU6CnSg9WB5GHvuAiFNtRsiY=; b=FMNW9+JjRP0Z
 kD0/4inY7KlcvzSf2xold8viDjN51fqil3w+nuVs2PGoUbOpseQXJUe8+iRWKxJ0
 JJD8xVU5308BlusuBaHqktPiV9CVpbyfun1VI++59KDK2ovpH+8plWOkDukD7S5b
 XpWzwUZzqggt8x5HQwS9a0M3OuPiH6s=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=zmpDsrVlrPlLVnoHFCMgU6CnSg9WB5GHvuAiFNtRs
 iY=; b=JtLHhf2hFwwKXCfoERl/INYFV2tWLCLBvb2bjt3682yR570EFE9tYmvwn
 5UjL5SDqrCYFTK5HXB6gtvGSLQn58FJcONTHLYRnwd8xsb2BCvdSs2Y2mgFWMnQ5
 DW14GsYzsneL0LIKqyT6mluHCjEJzbQ9RwAC+44kuF6zZhjWwL9anOunkBFH0rV8
 LRC5DOm+o1+poyiu0Q+t2N5iM2a7aQBEXVyUxST9rvxk65dNUFldN6iZZUg7L+2R
 4ysxMYDKqLaPVb/Qhrv3LY/4LJTdm8c2V1rXaMor7yAtZQWQ0PJp2ujqMeqOIjs9
 XdUCgbZoEnOELRmWsVUZbMJp7JUPw==
X-ME-Sender: <xms:wm5gYX_hAvK576E-4U6P5RIGuX8udzfBuS4H2_P93NNc8StscFBOFQ>
 <xme:wm5gYTs53OwQkXgCfMadfpFpFQAmuU-TySTMJDQ1Jm12yn_aZadYGfe2ZfnOAgvx-
 2D_MZc4Ab19imZy6w>
X-ME-Received: <xmr:wm5gYVC485i0UluHZ5--Zo9BZp8uXi_3hFZMvEgreue-zIO1y8cbRkWMtnhfxIuOdXv7Hr5Im7sJPE8IQir1Qbv92A>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddttddgleeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhepfffhvffukfhfgggtugfgjgesthekredttddtjeenucfhrhhomhepnfgvohcu
 hfgrmhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecuggftrfgrth
 htvghrnhepgeejgeeghedtudfgffdutddvffefffejkeffffevffehgedvvdeutdffkeej
 jeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplh
 gvohesfhgrmhhulhgrrhhirdhnrghmvg
X-ME-Proxy: <xmx:wm5gYTfGAKbnx6usgVKkFtx5UGMKvnwFG05jo5qTPLKT2KrlbRuVKA>
 <xmx:wm5gYcOTYQmMIvb0N-CRV0axuqRxi3DrTgxy2FEhqHZlujpSyfCs5w>
 <xmx:wm5gYVm493vEj6QxJ-av6hYACZDsF-jIriZFGLqTwc02LZkhTIN8GA>
 <xmx:wm5gYWWPwZLUMdoRWVYBSrGp-42AXwomuVi1c6TgTZjXO7tjrW2yNw>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 8 Oct 2021 12:16:01 -0400 (EDT)
Date: Fri, 8 Oct 2021 12:16:00 -0400
From: Leo Famulari <leo@HIDDEN>
To: Ludovic =?iso-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <YWBuwMzkvzKnTr3Z@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <YVs8CBpBBnw6gFzZ@HIDDEN> <87o88055d4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87o88055d4.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Fri, Oct 08, 2021 at 09:43:19AM +0200, Ludovic Courtès wrote:
> No, it’s the same.  However, ‘-D’ here affects only the immediately
> following package, whereas ‘--ad-hoc’ would affect every package that
> follows.

I must not know the correct terminology; that's what I was trying to
ask.

Can we keep the old behavior?  Or do we think this new way of doing it
is better?




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 8 Oct 2021 15:45:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 11:45:44 2021
Received: from localhost ([127.0.0.1]:51782 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYs47-0001TX-TC
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 11:45:44 -0400
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:41907)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <konrad.hinsen@HIDDEN>) id 1mYs45-0001TI-Sg
 for 50960 <at> debbugs.gnu.org; Fri, 08 Oct 2021 11:45:43 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 6509F5C01C6;
 Fri,  8 Oct 2021 11:45:36 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute6.internal (MEProxy); Fri, 08 Oct 2021 11:45:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h=
 from:to:to:to:subject:in-reply-to:references:date:message-id
 :mime-version:content-type:content-transfer-encoding; s=fm1; bh=
 dc7XF0K73mkVUJXJ5ASCViyD6qSTrIzzKGPVK8O0qLc=; b=E/ODT1qNikGCZovi
 bnvs/G4ELnAxY0vGrI2z4FuUe8l6xByfEhvFfQO69a8K2arnO6UrQehb7LobVc8O
 WuvgFuLPUggYEurqGzSH0hKmA+HOsHFRUTenr0/I/LWyah1nJLFyA5MvLdoLSIV+
 13OvND3hqtJ+Fbjjh3fTQBmR2upcgcyky4rJ2DVsXV/yoQU0a2F3DnBsKlDyln9B
 Mtnrm6fGpHK5aO5BYppenHHsFo9HKPCV4DN8/LZBqgtToUwj0PlfeBgGmiYCS0Ce
 XJf5aMOptMcubjgScaAqYdoyLacWUIMXMc2D9HFLYak4RjNmdstCQ1LaSyC23hM4
 GCWACA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=dc7XF0K73mkVUJXJ5ASCViyD6qSTrIzzKGPVK8O0q
 Lc=; b=h6d3eUULgSjkThT6ZK57Y2T4WPd8Y+KjiIEWFuI5+e5GDxSgoTzH8Udof
 d6ScANuXX09ziAeeDMwkSmyJy6WxC4Q8V4QwVB0wHpxLtD+fp4VmgpJv3Uc92otQ
 2qrzXWVdxTseb5+JR6zW5KIYaAAO2rvDwW+wB7ksBl2QOBd5xRp5CPNEXfe1Yc44
 RY4NZ0onzczCnE0ANGsoe2wiyCdh+DwnP2vGpqUuqtk5m6p7ugIMaI9rf9+hTnTD
 n0Djr6R0Cbxsb5Ugp7amGZMKaG+Kkzg71dP3XSQv7jo7wKrJ3jeI+rfzN0vsz4bm
 BKpYhqiKd00y0R2wB5J7qE5jNoL7Q==
X-ME-Sender: <xms:oGdgYbyFK7TB9W18FootiKPVBCx0RNxOrMTXhiNPuSGkV6WaUk2doQ>
 <xme:oGdgYTT19GmrtEupts1MUrgCaK8Oba4NJoJ6SH9CxK-KzjYPSa_ZE5xsov7YA4xvl
 n0_gsZceFOVBdP->
X-ME-Received: <xmr:oGdgYVV36UySfYMkCfjEk6sux3pbm6p3BDcacrE_UyS1Y5nsYRJ46u0ddwqiptQTmjWpAvOjXnwrBFtAfrirgCa4y_mX5w>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddttddgledtucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 gotffhvedqqdfjughrqdfuuhhsphgvtghtqdhlohifucdlhedmnecujfgurhephffvvffv
 ufgjfhffkfggtgfgsehtqhertddttdejnecuhfhrohhmpefmohhnrhgrugcujfhinhhsvg
 hnuceokhhonhhrrggurdhhihhnshgvnhesfhgrshhtmhgrihhlrdhnvghtqeenucggtffr
 rghtthgvrhhnpeehveevleeftdejiedvtdduuefgveffhedtjeejiefgfefhfeejvefhud
 fhfeejteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm
 pehkohhnrhgrugdrhhhinhhsvghnsehfrghsthhmrghilhdrnhgvth
X-ME-Proxy: <xmx:oGdgYViZ3X1kS7CV3cD9is_UzEueGDmEujJDBVF0iiopKxzhskuq_A>
 <xmx:oGdgYdAeg5i_MklUOEFB1IH5jhTJQMRJxbgu8uwRe8DcDnIYEwtipQ>
 <xmx:oGdgYeKaKQZIv5UtPQ0vqd4R4K56KJ7imYtS48qRL_QcrU5loYDvsg>
 <xmx:oGdgYQM25Xk1HLBcRbca7GaMVsmb3wL2kd4ivYxcRx3O1rNCDkeDYg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 8 Oct 2021 11:45:35 -0400 (EDT)
From: Konrad Hinsen <konrad.hinsen@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludovic.courtes@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
In-Reply-To: <87mtnlfd2n.fsf_-_@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <m1fste4lnp.fsf@HIDDEN> <87mtnlfd2n.fsf_-_@HIDDEN>
Date: Fri, 08 Oct 2021 17:45:33 +0200
Message-ID: <m1pmsffrky.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Ludo and Liliana,

> To me it=E2=80=99s the same as =E2=80=98guix environment=E2=80=99, but wi=
th a slightly different
> command-line interface; =E2=80=98guix environment=E2=80=99 was already se=
rves these two
> use cases.

Indeed, but the new proposal goes much further with supporting
interactive convenience, in particular via the controversial reading of
guix.scm and/or manifest.scm. That's a convenience I'd like to have
interactively, but not something I expect from an infrastructure tool
that ends up being used in lengthy shell script. For the latter, the
"Zen of Python wisdom" of "explicit is better than implicit" matters a
lot. On the command line, it makes life harder, in particular for bad
typists such as myself.

> Perhaps to avoid this trouble, guix shell could read a file that simply
> specifies which arguments to add one line at a time e.g.
>
>   ;; .guix-shell-rc
>   --manifest=3Dmanifest.scm

That's a nice idea, but again something I wouldn't want an
infrastructure tool to do. When I use "guix environment" or "guix shell"
in a script or workflow, I want whatever it does to be as independent as
possible from my machine or account, except when I explicitly say the
contrary.

Cheers,
  Konrad




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 8 Oct 2021 14:24:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 10:24:47 2021
Received: from localhost ([127.0.0.1]:51663 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYqnn-0005io-5Y
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 10:24:47 -0400
Received: from mail-qk1-f174.google.com ([209.85.222.174]:35791)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cox.katherine.e@HIDDEN>) id 1mYqnk-0005iX-DU
 for 50960 <at> debbugs.gnu.org; Fri, 08 Oct 2021 10:24:45 -0400
Received: by mail-qk1-f174.google.com with SMTP id c7so9584716qka.2
 for <50960 <at> debbugs.gnu.org>; Fri, 08 Oct 2021 07:24:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=keW7URPLLfpboTAtJT/8+HCaYm/3mWQmGHvEzLtaUY4=;
 b=GuQIgrWgCboqvm8IjrediK7ZCNrU03wIJkYowBVdRzbN3dhDKpjX9XDEvurkxQQnMw
 XncnqXwNNCzg/mpWb1Yu7HZOL1SerjRir8HykuXMc0oO6rzG3mZVWh6zjxTGonQhA9oa
 QZDPYYR/anluH+9qKQfJI+B9nc6eC4S3/+8b9IZ11OKHiRFXMILUzX8UcqqQZCFa5AkA
 2a3/LjmQFL1APdyNXQ5VEY3Mmbmrllodr7hJAMtvRKX5tS1HCgS84M39lyE0ujp4PvFa
 oWDUOdiXDo7cGy7sgFYIHyKyNKz+ZssJeizaFjFkZEhVWzc7J5UIXyfpeWsz4PVUQ5eF
 5TNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=keW7URPLLfpboTAtJT/8+HCaYm/3mWQmGHvEzLtaUY4=;
 b=FNV1Kkww+AXVJIpTn2OlvG5Rlq/qk8v/F9bsJyoHA5qAxLc/J/XsKDbBlWF/NOwHSC
 edINAM3S+IeT1Pk3tI4+XJCeD5qMfJUeI6GC25H6qs2D10IkcK5jXaiq6GG33ZL2cSdX
 aU7ZUmRS7hXkwqZ3DtxnCCBekMnue7Ejg0gVFh8cu30U0t3AjFCy+OI+LDryxz2wyXTW
 MUKNGoLz9Qfxe9+Z3K9tdtJoHCHV1PnPWlIsXTK/g2iVcDZF6DtINSFTQ0TFN1Q6pTp2
 W6JUWlUJ2UHv+gonbDMm1UZ64s2xYEr391SpTCjhkOkfAnG1LU/3Dt0EcY8sowY/vTEs
 NJBw==
X-Gm-Message-State: AOAM5310QFz5zlfGh9X4uOn1dFJmsgLF0RgFIJskArD/SS65Md4Uik2b
 SBcUqbrmzvS8eQ+n/UBe41U=
X-Google-Smtp-Source: ABdhPJxjBkPUt8VdCvF4BqDYuWJqDm69OYHcRrzY8wbiaWOMGaCVbxY5i0qpkd4tOkCDuiYSm41mLg==
X-Received: by 2002:a37:9bd2:: with SMTP id d201mr3128142qke.456.1633703078499; 
 Fri, 08 Oct 2021 07:24:38 -0700 (PDT)
Received: from washu-v4 (172-221-246-205.res.spectrum.com. [172.221.246.205])
 by smtp.gmail.com with ESMTPSA id
 n16sm2465443qta.51.2021.10.08.07.24.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 08 Oct 2021 07:24:38 -0700 (PDT)
From: Katherine Cox-Buday <cox.katherine.e@HIDDEN>
To: "Thompson, David" <dthompson2@HIDDEN>
Subject: Re: [bug#50960] [EXT] Re: [bug#50960] [PATCH 00/10] Add 'guix
 shell' to subsume 'guix environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
 <877depdw3i.fsf_-_@HIDDEN>
 <20211007105236.xzkq5tij3g3tcdob@HIDDEN>
 <CAJ=Rwfb7fSEuWYxnnPE_miqGF5_O_d8qJdi3XdmwSQsFE=8jXA@HIDDEN>
Date: Fri, 08 Oct 2021 09:24:36 -0500
In-Reply-To: <CAJ=Rwfb7fSEuWYxnnPE_miqGF5_O_d8qJdi3XdmwSQsFE=8jXA@HIDDEN>
 (David Thompson's message of "Thu, 7 Oct 2021 07:17:43 -0400")
Message-ID: <878rz3lhln.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 "pelzflorian \(Florian Pelz\)" <pelzflorian@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

"Thompson, David" <dthompson2@HIDDEN> writes:

> I don't think your fear should outweigh the immense user friendliness
> of having some established conventions to ease development.  Every
> mainstream developer tool I use in the professional word has
> conventions like this, and the result is that it is quick and easy to
> jump into a new project and get the software you need to be
> productive.  Guix needs to embrace this kind of usability if it hopes
> to offer a real alternative to these other tools.  'guix shell' with
> no other arguments should "just work" in the context of whatever
> project I am in.
>
> - Dave

I agree with this.

-- 
Katherine




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 8 Oct 2021 07:44:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 03:44:44 2021
Received: from localhost ([127.0.0.1]:48973 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYkYd-0007Gc-QH
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 03:44:43 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46142)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mYkYb-0007GO-HM
 for 50960 <at> debbugs.gnu.org; Fri, 08 Oct 2021 03:44:42 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60050)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mYkYW-0007yK-9w; Fri, 08 Oct 2021 03:44:36 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60582 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mYkYW-0002Qi-1a; Fri, 08 Oct 2021 03:44:36 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
 <1c5d7a3d62da1b495a14b850a1b56b2a410b2405.camel@HIDDEN>
 <87mtnrzgn9.fsf_-_@HIDDEN>
 <51388f2a0e841af6f1b4441d3dc34e38996e7209.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 17 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Fri, 08 Oct 2021 09:44:34 +0200
In-Reply-To: <51388f2a0e841af6f1b4441d3dc34e38996e7209.camel@HIDDEN>
 (Maxime Devos's message of "Tue, 05 Oct 2021 09:50:02 +0200")
Message-ID: <87k0io55b1.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maxime Devos <maximedevos@HIDDEN> skribis:

> Guix itself doesn't follow this convention: the guix source tree has an u=
nrelated
> "guix.scm" file, that doesn't evaluate to a package.

Indeed, but that=E2=80=99s because Guix predates the convention.  :-)

> I'd expect that running "guix shell" within the guix source tree would
> be equivalent to "guix environment guix", but currently this doesn't
> seem to be the case.

Right, it would fail poorly in this particular case.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 8 Oct 2021 07:43:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 03:43:29 2021
Received: from localhost ([127.0.0.1]:48965 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYkXR-0007EH-5j
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 03:43:29 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45954)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mYkXP-0007E3-UU
 for 50960 <at> debbugs.gnu.org; Fri, 08 Oct 2021 03:43:28 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:60020)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mYkXK-00070U-FR; Fri, 08 Oct 2021 03:43:22 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60580 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mYkXK-0002Jy-6l; Fri, 08 Oct 2021 03:43:22 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Leo Famulari <leo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <YVs8CBpBBnw6gFzZ@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 17 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Fri, 08 Oct 2021 09:43:19 +0200
In-Reply-To: <YVs8CBpBBnw6gFzZ@HIDDEN> (Leo Famulari's message of "Mon, 4
 Oct 2021 13:38:16 -0400")
Message-ID: <87o88055d4.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Leo Famulari <leo@HIDDEN> skribis:

> On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Court=C3=A8s wrote:

[...]

>>        =E2=80=98guix shell -D hello git=E2=80=99 =E2=89=8D =E2=80=98guix=
 environment hello --ad-hoc git=E2=80=99
>
> Is my understanding correct, that arguments to `guix environment` are
> positional, whereas with `guix shell` arguments are not positional?

No, it=E2=80=99s the same.  However, =E2=80=98-D=E2=80=99 here affects only=
 the immediately
following package, whereas =E2=80=98--ad-hoc=E2=80=99 would affect every pa=
ckage that
follows.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 8 Oct 2021 07:38:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Oct 08 03:38:07 2021
Received: from localhost ([127.0.0.1]:48953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYkSE-00075r-HM
	for submit <at> debbugs.gnu.org; Fri, 08 Oct 2021 03:38:07 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mYkSC-00075N-Fq
 for 50960 <at> debbugs.gnu.org; Fri, 08 Oct 2021 03:38:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59930)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mYkS6-0007yb-Is; Fri, 08 Oct 2021 03:37:58 -0400
Received: from [193.50.110.91] (port=39742 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mYkS6-0001sR-4S; Fri, 08 Oct 2021 03:37:58 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
 <87ilyfy0q4.fsf@HIDDEN>
 <d169e493187d1de26c09dd1503e55cb5db982384.camel@HIDDEN>
 <87lf39ryle.fsf@HIDDEN>
 <f821bfcc64304e467575a26c4473ddc6863eb42e.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 17 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Fri, 08 Oct 2021 09:37:55 +0200
In-Reply-To: <f821bfcc64304e467575a26c4473ddc6863eb42e.camel@HIDDEN>
 (Maxime Devos's message of "Mon, 04 Oct 2021 17:58:41 +0200")
Message-ID: <8735pc6k6k.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Maxime,

Maxime Devos <maximedevos@HIDDEN> skribis:

> Ludovic Court=C3=A8s schreef op ma 04-10-2021 om 10:19 [+0200]:
>> > A documented flag to always consider the cache stale seems good, thoug=
h I think
>> > at least the dependencies made with the common macros and procedures '=
include',
>> > 'load', 'include-from-path', 'load-from-path', 'use-modules' and non-r=
ecursive
>> > 'local-file' could be tracked, though this could be left as a TODO for=
 later
>> > I suppose.
>>=20
>> Tracking those uses reliably is impossible: there could be same-named
>> bindings that do other things, there could be custom macros, there could
>> be =E2=80=9Cdynamic arguments=E2=80=9D (whose value is not known statica=
lly), etc.  You
>> have to expand + evaluate the code to get better results, and even then,
>> there might be different paths in the code so you can=E2=80=99t be sure =
you got
>> it right.
>
> I think there's a miscommunication here.  From what I'm reading, what you=
 have
> in mind is that, to determine the dependency information, "guix shell" wo=
uld
> open "guix.scm", read it with the procedure 'read' and sniff for 'load',
> 'include-from-path', 'load-from-path', 'use-modules' and 'local-file' form
> -- something like 'module-file-dependencies' and 'extract-dependencies', =
but
> more general.

Yes, that=E2=80=99s roughly what I thought you had in mind, sorry!

> However, my idea is to replace these macros, such that, when "guix shell"
> loads "guix.scm" or "manifest.scm", these macros inform "guix shell"
> that "guix.scm" or "manifest.scm" depend on certain files referred to
> by 'load', 'include-from-path', etc. forms, using a mechanism like the
> 'notice-dependency' defined in <https://issues.guix.gnu.org/50384>.
>
> Then, when "guix shell" puts the resulting profile in the cache,
> it includes the generated list of files.  And when "guix shell" finds
> an entry in the cache, it will check if the files in this list (and guix.=
scm
> or manifest.scm of course) have been modified.  If some are (or the forci=
ng
> flag is set), guix.scm needs to be loaded and a new profile needs to be
> generated.  If they are all unchanged, guix.scm will _not_ be read: the c=
ached
> profile can be reused.
>
> It's not 100% reliable (e.g. the list of packages in the manifest could
> depend on the phase of the moon if (current-time) is used) (is that what
> you mean by =E2=80=98different paths=E2=80=99 and =E2=80=98dynamic argume=
nts=E2=80=99?), but it should
> cover the vast majority of cases.
>
> I don't know a non-artifical situation where =E2=80=98custom macros=E2=80=
=99 are a problem
> -- do you know an example in the wild where this dependency tracking sche=
me
> would fail to work?

I think we have to look at the cost and at the benefits.  The cost:
either we spread =E2=80=98notice-dependency=E2=80=99 calls all over the pla=
ce, or we
interpose on =E2=80=98open-file=E2=80=99 altogether, assuming that even wor=
ks.  The
benefit: we=E2=80=99d have an 80% solution.  There would still be edge case=
s not
handled correctly; a realistic example is a =E2=80=98guix.scm=E2=80=99 whos=
e execution
differs based on the presence of a file or environment variable.  People
would have to know about this pitfall and pass the right flag.

[...]

>> In such situations, I err on the side of not even trying.  The added
>> complexity for a flaky result doesn=E2=80=99t pay off to me.  I prefer t=
o be
>> upfront, document limitations, and let users handle them as they see
>> fit.
>
> About complexity: there's some extra code, sure, but it doesn't seem comp=
lex
> to me.  To track dependencies in <https://issues.guix.gnu.org/50384>,
> I only needed to add 'notice-dependency' and some other code to (guix bui=
ld compile),
> and some code to build-aux/compile-all.scm to save/load the dependency in=
formation
> to/from the builddir and to also check the mtime of dependencies.
>
> Does it still seem flaky to you, after my explanation on how the dependen=
cy
> information would be determined?
>
> Being upfront, documenting limitations, and having a =E2=80=98force rebui=
ld flag=E2=80=99
> (is that what you mean by =E2=80=98letting users handle them as they see =
fit=E2=80=99?)
> (possibly also documenting 'notice-dependency') is not incompatible with
> the automatic dependency tracking.
>
> More abstractly, this seems more like a =E2=80=98Perfect is the enemy of =
the good=E2=80=99 situation.
> While I would prefer 'perfect' above 'good', and the automatic dependency=
 tracking
> certainly isn't 'perfect', it does seem 'good' to me, and perfection appe=
ars to
> be impossible and there's the =E2=80=98force rebuild flag=E2=80=99 as an =
escape hatch, so I believe
> 'good-but-not-perfect' to be acceptable here, as long as it is documented=
 in the manual
> that there are some limitation on what dependencies are automatically tra=
cked.

Yeah, I can relate to that sentiment, even if I=E2=80=99m all too often on =
the
=E2=80=9Cperfectionist=E2=80=9D side of things.  ;-)

I guess I could live with an 80% dependency tracking solution.  However,
my criteria for it would be that (1) it should be orthogonal (e.g., not
requiring explicit calls to =E2=80=98notice-dependency=E2=80=99 in many pla=
ces), and (2)
it should be self-contained and reasonably small.  Perhaps having
=E2=80=98load*=E2=80=99 or similar instrument =E2=80=98open-file=E2=80=99 o=
r similar could help achieve
that?

I would rather not block =E2=80=98guix shell=E2=80=99 on that though.

WDYT?

Thanks for taking the time to clarify what you had in mind!

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 7 Oct 2021 12:01:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 08:01:35 2021
Received: from localhost ([127.0.0.1]:46233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYS5f-00085k-Cn
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 08:01:35 -0400
Received: from pelzflorian.de ([5.45.111.108]:56118 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1mYS5b-00085W-7K
 for 50960 <at> debbugs.gnu.org; Thu, 07 Oct 2021 08:01:34 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 5BDFB3606A0;
 Thu,  7 Oct 2021 14:01:29 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1633608089;
 bh=P2Au4QcixRHDJDjkwyCF09xSx7NcBaz8iwLtLhq7D5A=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=J1T2l9NzhaY7hONEo+ulBlPM2jw1SpCHrmZvSt2A9DhX4UjVZFwYnws5qr4sN4goc
 R1mEzntMghVzkGNZd3s0ToCRZyQoNuSHFGuDSVZciULFOw/MVfFsNXTHC2HLRizR2+
 m2EvMU9+sdu66C+gln0afZwpld1rZv7kS4pVdVg4=
Date: Thu, 7 Oct 2021 14:01:19 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: "Thompson, David" <dthompson2@HIDDEN>
Subject: Re: [EXT] Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume
 'guix environment'
Message-ID: <20211007120119.sdhip6yvj2doslsr@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
 <877depdw3i.fsf_-_@HIDDEN>
 <20211007105236.xzkq5tij3g3tcdob@HIDDEN>
 <CAJ=Rwfb7fSEuWYxnnPE_miqGF5_O_d8qJdi3XdmwSQsFE=8jXA@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAJ=Rwfb7fSEuWYxnnPE_miqGF5_O_d8qJdi3XdmwSQsFE=8jXA@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Thu, Oct 07, 2021 at 07:17:43AM -0400, Thompson, David wrote:
> 'guix shell' with
> no other arguments should "just work" in the context of whatever
> project I am in.

If you only care about projects: Searching only guix.scm and
manifest.scm files when a .git subdirectory is present would indeed be
better than going through all parent directories.  I do not know git
well enough to judge if that could interfere with git worktrees and
git submodules.

The only remaining problem would be novice users
who know “guix shell program-a program-b” and who do not expect “guix
shell” without argument instead loads code from a file.

I’m also afraid of git hooks btw, which is why I clone old git
checkouts from the backup instead of copying, but at least they stay
local to the .git checkout.

I still don’t understand why not having to type --file is useful
though.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 7 Oct 2021 11:18:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 07:18:01 2021
Received: from localhost ([127.0.0.1]:46185 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYRPV-0004oS-LB
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 07:18:01 -0400
Received: from mail-vs1-f45.google.com ([209.85.217.45]:35631)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dthompson2@HIDDEN>) id 1mYRPU-0004oF-92
 for 50960 <at> debbugs.gnu.org; Thu, 07 Oct 2021 07:18:00 -0400
Received: by mail-vs1-f45.google.com with SMTP id w13so6387325vsa.2
 for <50960 <at> debbugs.gnu.org>; Thu, 07 Oct 2021 04:18:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=worcester-edu.20210112.gappssmtp.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=ROXfO6j93QHoyxTbEaV6/qczZsWGlW6VPDVCOJdUQ0Y=;
 b=4vFOweGXOnTBdHPayCjOnKj+sXVSIFGABxbUMCyNEVxvwEUu2OcVg8qMvUncia1X28
 zXoiLjKVY3ln8CIUFLryOBrglpb7GZYq91i96TAVbaWJ8mcPTDA6Od4y8o4CLCVHc4rz
 FC1/hsn7Nl4HgroKCl2uaoUwOU+uY2w135vU2D60y7GRIDNK7vdr8ULGQwO4HSRJSWcy
 9nvkZUakYu4Ck8Ams8nBS07b9sbTjaXa8/+FdSoMqO//tzEoAVKPZdgIjKiYHX1zGPii
 One1AycZ7rd+rbjZunAqi/DYCRlTmfxn8LIO03b6c1JVQRc/fsL9XDftGQZuj1SEZ5sh
 yqZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=ROXfO6j93QHoyxTbEaV6/qczZsWGlW6VPDVCOJdUQ0Y=;
 b=3FzTp4QlOR12pX6qOqdtdlvGgVziQs/bbTUMzEUXRHjJD4kAALR4rHRqHScCZulaVR
 y10P6J4YclkheAa8boq3ti1ncLNfwheJSirdH6JGJu/8075Hz/xbahYOOYCOKZQmfcqs
 2AnRNVNy/oAxRIkRujo9Oo9TM3wQ34Oa5LKe/cPW9x04bsJ1QNQzbkhy/4oh8q+9NE2j
 sk3FW4RVnwfRx9UbY81/0JZRroIMIlOsDyCK4ZW9IKD1CYYZ3HFN55GxcxyEIPx9VtSi
 LdTR2njgSBab3s6N54OPkFTXpxITkuzN7oJZkEiiqcA+2ilsC2Vfz8ZtfECbq8DlzENo
 LbWQ==
X-Gm-Message-State: AOAM531eL/QPKTadviRWxhyWB+7CpoVNS2RYvxt6lOkSF50c5u7ViyGQ
 mRGc0vkesvVGDKKkwegGx0pbGZtGfTD6uQ9NkgTX36EU1y4=
X-Google-Smtp-Source: ABdhPJwFlfMnDrzsVDuZo6WHKEq1TtbdEDhMZmvY4DyL5AvN9858noKjATnN9emzmIkS/is2wjqzwkJSchToQ4DIycw=
X-Received: by 2002:a05:6102:1350:: with SMTP id
 j16mr3130587vsl.54.1633605474710; 
 Thu, 07 Oct 2021 04:17:54 -0700 (PDT)
MIME-Version: 1.0
References: <20211002102116.27726-1-ludo@HIDDEN>
 <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
 <877depdw3i.fsf_-_@HIDDEN>
 <20211007105236.xzkq5tij3g3tcdob@HIDDEN>
In-Reply-To: <20211007105236.xzkq5tij3g3tcdob@HIDDEN>
From: "Thompson, David" <dthompson2@HIDDEN>
Date: Thu, 7 Oct 2021 07:17:43 -0400
Message-ID: <CAJ=Rwfb7fSEuWYxnnPE_miqGF5_O_d8qJdi3XdmwSQsFE=8jXA@HIDDEN>
Subject: Re: [EXT] Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume
 'guix environment'
To: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Thu, Oct 7, 2021 at 6:52 AM pelzflorian (Florian Pelz)
<pelzflorian@HIDDEN> wrote:
>
> I=E2=80=99m not a direnv user and frankly don=E2=80=99t really understand=
 the gain
> from loading by default the guix.scm file nor manifest.scm.
>
> My fear is accidentally running code, possibly malicious, possibly
> just a backup script one happened to call guix.scm.  In German we have
> the word DAU for =E2=80=9Cdumbest assumable user=E2=80=9D.  Guix without =
shell is
> DAU-prove.

I don't think your fear should outweigh the immense user friendliness
of having some established conventions to ease development.  Every
mainstream developer tool I use in the professional word has
conventions like this, and the result is that it is quick and easy to
jump into a new project and get the software you need to be
productive.  Guix needs to embrace this kind of usability if it hopes
to offer a real alternative to these other tools.  'guix shell' with
no other arguments should "just work" in the context of whatever
project I am in.

- Dave




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 7 Oct 2021 10:52:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 06:52:49 2021
Received: from localhost ([127.0.0.1]:46163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYR17-0004CP-F2
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 06:52:49 -0400
Received: from pelzflorian.de ([5.45.111.108]:56040 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1mYR15-0004CG-8x
 for 50960 <at> debbugs.gnu.org; Thu, 07 Oct 2021 06:52:48 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id A53FC3606A0;
 Thu,  7 Oct 2021 12:52:45 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1633603965;
 bh=yxTnkqkCzdBSBi4NB9Rfp1nCub3G6OQ1uZT6HDOuYoU=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=bH+JvkiA8D71VNMAlto9qFZKtjn09RdgLuoakk1AaaiO3gOjyT3fXnaVFxuzioSYv
 Df3zvuhH1PXEWVbuBoo3j8BrRuraIASJyyeH4cIewwYeIvDbdZz4/W6NvU2bM22Jw/
 VIe+NMS1EYXlnUbgILWIkpuwwmS/1SuJxDnL3xO4=
Date: Thu, 7 Oct 2021 12:52:36 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <20211007105236.xzkq5tij3g3tcdob@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
 <877depdw3i.fsf_-_@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <877depdw3i.fsf_-_@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, "Thompson, David" <dthompson2@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

I’m not a direnv user and frankly don’t really understand the gain
from loading by default the guix.scm file nor manifest.scm.

My fear is accidentally running code, possibly malicious, possibly
just a backup script one happened to call guix.scm.  In German we have
the word DAU for “dumbest assumable user”.  Guix without shell is
DAU-prove.

Both

- Konrad Hinsen’s suggestion of two different commands and

- Nicolò Balzarotti’s suggestion of having to explicitly allow a file

would take away my paranoia of accidentally running code.  (By just
not using Konrad Hinsen’s other command.)

- Hidden .-rc files in the current directory would not take away my
  paranoia of malicious code.

- I think printing a suggestion to use --file=../guix.scm is fine.

Bash is different from Guix Shell.  It does not load code from . or
arbitrary parent directories.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 7 Oct 2021 09:26:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 05:26:40 2021
Received: from localhost ([127.0.0.1]:46080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYPfj-000886-Ut
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 05:26:40 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33136)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mYPff-00087q-M9
 for 50960 <at> debbugs.gnu.org; Thu, 07 Oct 2021 05:26:39 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:57960)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mYPfa-0001NH-5t; Thu, 07 Oct 2021 05:26:30 -0400
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:59162
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mYPfY-0007Jl-CB; Thu, 07 Oct 2021 05:26:29 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: "Thompson, David" <dthompson2@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
Date: Thu, 07 Oct 2021 11:26:25 +0200
In-Reply-To: <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
 (David Thompson's message of "Mon, 4 Oct 2021 17:29:26 -0400")
Message-ID: <877depdw3i.fsf_-_@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

"Thompson, David" <dthompson2@HIDDEN> skribis:

> 1) I can't be the only one that thinks it's a pain to rebuild the
> whole environment just because I updated the Guix client. It's
> especially frustrating when there is a regression that breaks the
> project, or the substitute servers are having a bad day.

The way I see it, I update Guix precisely to get a newer environment.
Otherwise, why would I update it for?

> 2) One important use-case for tools like Bundler, npm, etc. is to
> exactly (within their limited ability to do so, of course) reproduce
> the environment for all developers working on the project.  With 'guix
> environment', and now with this proposed 'guix shell', the resulting
> development environment depends upon the version of Guix being used.
> So, to make 'guix shell' a true universal replacement for these
> language-specific tools, there should be a way to "lock" to a specific
> version of Guix.  Bundler has Gemfile.lock, npm has package-lock.json,
> etc.  Guix has good support for using older versions of Guix already,
> so it seems feasible.  I spend a non-trivial amount of time sorting
> out development environment issues for a couple dozen devs,
> so a tool that took most of the variables out of the equation would be
> really great.

This part is currently addressed by =E2=80=98guix describe -f channels=E2=
=80=99 (to pin
the Guix revision) and =E2=80=98guix time-machine=E2=80=99 (to spin up a sp=
ecific
revision).  The other tools are totally unaware of revisions and
channels.

As it stands, developers would use the pinned version by running:

  guix time-machine --commit=3DXYZ -- shell

or:

  guix time-machine -C channels.scm -- shell

Perhaps =E2=80=98guix time-machine=E2=80=99, too, could automatically detect
=E2=80=98channels.scm=E2=80=99.

The temptation to add revision data to tools that don=E2=80=99t otherwise d=
eal
with it is real; I think it=E2=80=99s better kept separate though, because
fundamentally, each revision lives in its own world.

> 3) I haven't looked at the patches to see if it has already been
> implemented, but when running 'guix shell' with no arguments, I think
> the search for the manifest file should follow the established
> conventions of Git, Bundler, etc. and search not only the current
> directory, but the parent directory and so on until it finds it or
> gets to / and gives up. This will make the tool much more usable when
> working inside a subdirectory within a project.

It=E2=80=99s implemented (and controversial).

> Just some things to think about.  I just don't want to see Guix commit
> to an interface that slams the door on future improvement due to
> compatibility reasons.  I mean, what would you even name the next
> tool? guix... biome?

Good point.  :-)

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 7 Oct 2021 09:15:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 05:15:27 2021
Received: from localhost ([127.0.0.1]:46055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYPUt-0007ps-0I
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 05:15:27 -0400
Received: from mail-wr1-f67.google.com ([209.85.221.67]:40761)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1mYPUq-0007pe-Vq
 for 50960 <at> debbugs.gnu.org; Thu, 07 Oct 2021 05:15:25 -0400
Received: by mail-wr1-f67.google.com with SMTP id i12so4317386wrb.7
 for <50960 <at> debbugs.gnu.org>; Thu, 07 Oct 2021 02:15:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:subject:from:to:cc:date:in-reply-to:references
 :user-agent:mime-version:content-transfer-encoding;
 bh=lR4kBv1Z4qYy5xVwzl+pwfwN0ApsXbNpi1YQaUWNQh8=;
 b=OopKjuEgTuXGqXNlZoMA3ioDYh9qYfp1g6jUaeemy3Eba9mEFHOJWiY76dw1/LHygj
 2ScORdUdivmdWBBDmAp6ZF5URq+A7GOfQxKGmcx6owJcsLQGcMfaXXI6lqPZgYloTMFV
 ojmsn4GhmOyaNVYP4JZDaCgzrdzrf0jRx0shap9PBewqMr5l48rFx81xD97PgwZBQzOY
 lBsAiNb2Xj/lmoNBSwClYK/ylmRhI2zcSRx/3Hk7vai4YT/XL/KjSfL09/cRbP9OClmM
 lHaUeOAjO5bnHqV9GTAazHcK4bfqt6RRcE0UVBgc+tlxnPlbzm3L2E5LV2/r93YD1XcN
 +VLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to
 :references:user-agent:mime-version:content-transfer-encoding;
 bh=lR4kBv1Z4qYy5xVwzl+pwfwN0ApsXbNpi1YQaUWNQh8=;
 b=SC5UBOxyRRZOj5ANDv5DbY1ttmqnie9HDxOzlh1jp94UzvreHxgqQtQTHtAMDldEkl
 EdT9p+hxozDP4cgdNCJzEPd0iR7W76wsliASzCU9gJsLHS2uPy082lt/BP0+Bnz9ru3q
 YjhdtPsvxV+80WiMJvyacu1II04m3h+9aNNVcInAKlpmqwYm9vjHBME8ZRIezmoke/n4
 6Hx/ZcagJ9EpAgihrM54iDEhoW7pO+Iul22KynDQ4cNnw6t/06ZqGOV+xEUoaWpV7EM5
 apZUpMBfh1ktzuzRiaxod7aS2AMYLh4C+KM5FI0r9adHJGhrisDA3ftYEoqaFQ+0HEdW
 BcUQ==
X-Gm-Message-State: AOAM533NUDVhXDJG+CKAFHAlVkzt5JUiP3AhSfx2cOk/9P7V2v8WZqPW
 7r01yf3Uyyw2md9askPwMtE=
X-Google-Smtp-Source: ABdhPJwPAZwcHVZvncaIwzDwFrkKxrRM6lazRQmvr8PzcsvjVHUazf6l0DhX0wwcM1g/PXvbcfFeAQ==
X-Received: by 2002:a05:600c:1c93:: with SMTP id
 k19mr15098736wms.80.1633598119146; 
 Thu, 07 Oct 2021 02:15:19 -0700 (PDT)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id v191sm8255405wme.36.2021.10.07.02.15.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 07 Oct 2021 02:15:18 -0700 (PDT)
Message-ID: <dbd60e1f57398800a215020032d9ebfba478e0cb.camel@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludovic.courtes@HIDDEN>, Konrad
 Hinsen <konrad.hinsen@HIDDEN>
Date: Thu, 07 Oct 2021 11:15:16 +0200
In-Reply-To: <87mtnlfd2n.fsf_-_@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <m1fste4lnp.fsf@HIDDEN> <87mtnlfd2n.fsf_-_@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Ludo,

Am Donnerstag, den 07.10.2021, 10:34 +0200 schrieb Ludovic Courtès:
> > The behavior of "guix shell" with and without arguments is
> > sufficiently different, which will make it a challenge to document,
> > and then a challenge for users to understand. And part of the
> > criticism related to the tacit execution of files is about the
> > convenience for 1) vs. the risk in 2).
> 
> ‘guix shell’ without arguments is equivalent to ‘guix environment -f
> guix.scm’ or ‘guix environment -m manifest.scm’.
> 
> > So... how about making this two different commands? They could of
> > course share most of the implementation.
> > 
> > I'd use "guix shell" for the scenario that actually starts a shell,
> > and something different, perhaps "guix process", for the
> > infrastructure command for use in scripts.
> 
> I don’t think there’s enough to warrant two different commands (and
> perhaps we could leave out the auto-detection of ‘guix.scm’ or
> ‘manifest.scm’ is that proves to be too controversial).
Leaving out the auto-detection of ‘guix.scm’ and ‘manifest.scm’ for now
is a good idea, given that Guix itself would be an edge-case for that.

Perhaps to avoid this trouble, guix shell could read a file that simply
specifies which arguments to add one line at a time e.g.

  ;; .guix-shell-rc
  --manifest=manifest.scm

or

  ;; .guix-shell-rc
  --load=guix.scm

Similar behaviour is used in other (GNU) tools with lots of available
arguments, which operate on a directory basis, e.g. stow.

> Maybe you’re hinting at the name and the fact that it suggests it’s
> starting a shell.  I’m not fond of it, notably for that reason.  For
> the record, it came out as the only proposal that seemed viable to
> me:
> 
>   https://issues.guix.gnu.org/38529#17
> 
> Thoughts?
I think “guix shell” is fine as-is.  People typically don't complain
that “sh somefile.sh” doesn't launch a shell, so the same reasoning can
be applied to Guix tools in my opinion.  We would still have the always
non-intuitive naming choices of “do”, “start” and “run” at our disposal
if we ever need to discard the shell.

Regards,
Liliana





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 7 Oct 2021 08:34:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Oct 07 04:34:37 2021
Received: from localhost ([127.0.0.1]:45967 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mYOrN-0006if-EY
	for submit <at> debbugs.gnu.org; Thu, 07 Oct 2021 04:34:37 -0400
Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:32868)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludovic.courtes@HIDDEN>) id 1mYOrL-0006iO-Gu
 for 50960 <at> debbugs.gnu.org; Thu, 07 Oct 2021 04:34:36 -0400
IronPort-HdrOrdr: =?us-ascii?q?A9a23=3ALr58J6x7Tng+9gDbkc2GKrPwob1zdoMgy1kn?=
 =?us-ascii?q?xilNYDRPeM2ZiMyi2NwHvCWEwQr4WBkb9uxoS5PwJU80lKQFhLX5Uo3DYODZgh?=
 =?us-ascii?q?rUEGgP1+XfK9OJIVyJygZyvZ0QAJSWIueAfWSTFa3BkX6F++9J+qjyzEhD7d2u?=
 =?us-ascii?q?vUuFNDsaHp2IjD0JaDpzcHcWeOAcP+tEZeWhD6N8zlLKExkqh6KAdwE4tsf41q?=
 =?us-ascii?q?P2ffndEGc77nAchDVmwQnYi4ITRHOjr3Ejuw0k+8ZYzYGTqX2f2k2p2cvLsCP0?=
 =?us-ascii?q?5ivV6dBfg9HhysRObfb8+/QoFg=3D=3D?=
X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="532557243"
Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201])
 by mail2-relais-roc.national.inria.fr with
 ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 10:34:25 +0200
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludovic.courtes@HIDDEN>
To: Konrad Hinsen <konrad.hinsen@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN> <m1fste4lnp.fsf@HIDDEN>
Date: Thu, 07 Oct 2021 10:34:24 +0200
In-Reply-To: <m1fste4lnp.fsf@HIDDEN> (Konrad Hinsen's message of "Wed,
 06 Oct 2021 10:12:10 +0200")
Message-ID: <87mtnlfd2n.fsf_-_@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Konrad,

Konrad Hinsen <konrad.hinsen@HIDDEN> skribis:

> Looking at the proposal and then the discussion, I wonder if the main
> issue with "guix shell" is that it's two very different things wrapped
> into one:
>
>   1) A convenience utility for interactive work, in particular software
>      development, implemented as "guix shell" with no arguments.
>
>   2) A modernized "guix environment" for both interactive and scripting
>      use.

To me it=E2=80=99s the same as =E2=80=98guix environment=E2=80=99, but with=
 a slightly different
command-line interface; =E2=80=98guix environment=E2=80=99 was already serv=
es these two
use cases.

> The behavior of "guix shell" with and without arguments is sufficiently
> different, which will make it a challenge to document, and then a
> challenge for users to understand. And part of the criticism related to
> the tacit execution of files is about the convenience for 1) vs. the
> risk in 2).

=E2=80=98guix shell=E2=80=99 without arguments is equivalent to =E2=80=98gu=
ix environment -f
guix.scm=E2=80=99 or =E2=80=98guix environment -m manifest.scm=E2=80=99.

> So... how about making this two different commands? They could of course
> share most of the implementation.
>
> I'd use "guix shell" for the scenario that actually starts a shell, and
> something different, perhaps "guix process", for the infrastructure
> command for use in scripts.

I don=E2=80=99t think there=E2=80=99s enough to warrant two different comma=
nds (and
perhaps we could leave out the auto-detection of =E2=80=98guix.scm=E2=80=99=
 or
=E2=80=98manifest.scm=E2=80=99 is that proves to be too controversial).

Maybe you=E2=80=99re hinting at the name and the fact that it suggests it=
=E2=80=99s
starting a shell.  I=E2=80=99m not fond of it, notably for that reason.  Fo=
r the
record, it came out as the only proposal that seemed viable to me:

  https://issues.guix.gnu.org/38529#17

Thoughts?

Thanks for your feedback,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 6 Oct 2021 08:12:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 06 04:12:19 2021
Received: from localhost ([127.0.0.1]:42410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mY22F-0002xV-3j
	for submit <at> debbugs.gnu.org; Wed, 06 Oct 2021 04:12:19 -0400
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:33457)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <konrad.hinsen@HIDDEN>) id 1mY22D-0002xI-E0
 for 50960 <at> debbugs.gnu.org; Wed, 06 Oct 2021 04:12:18 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id 0BCD85C00FE;
 Wed,  6 Oct 2021 04:12:12 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Wed, 06 Oct 2021 04:12:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h=
 from:to:subject:date:message-id:mime-version:content-type; s=
 fm1; bh=8PWf07PNQVwqgUKio+XKTHIPkpTHxfPWUgq8jMJITm4=; b=YrPTu8/V
 Q88u3brc6OoXnRUQqx8qQwrycXJa2aqrp5sDA5Zx815nXObV29srmlOY4BIzuSRl
 aaMMDHteC5Lb0HOWlsQOUo+z1IiYocAgMr1UHSORNx6AIvlCmEKkkJJvfijT44mE
 q61UNIDqVQj6v+aJ4rR8D3i2y+/oltnlZh5bpobqWhrynYvp/Ru3Nd/ygMQMpFzq
 vNxopBxyIHHDqoARX8pQ9wAmOuzcFvGIZjf22ntmbn/8IYexkdRd0x42j+Ab/Cpr
 hXeV1BKqUpcawdcEo/m3fszsEbh/0N6ev2n1reJ4lgD/xUC/46Z8Wvz5YRTjfGlo
 gQlGkDrYN6OGqA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; bh=8PWf07PNQVwqgUKio+XKTHIPkpTHx
 fPWUgq8jMJITm4=; b=P/GARlE4XahOqI/Fsi7HVR425ryTchqI5zkTzF2xJSD1X
 3hBOsx1+rksHhbCY40WlbuUVxibqzNzh7+saGzSWndSKT6nHkDdpF71HD6wkr0YC
 p//O6utAyjCWMupwXCYNiMBhDcTYhatL1yToafVW7OdmAnLx1ET2HpNqCnWPahTC
 a9i4pgQwTGRcNlNapRAUC5ZQjN6psUMVl0kr9m5DO4EvIRCmy4UEy/uAC9FhG6To
 d+jXG3dOcfmF3YM3p1P/MY42TSgGQP558AmFoGkF8WAbCt/1M7LOGJMaCvidlLY0
 h+3Mcek81sNUQ0duWVksuyWmDPUkzWUvP2biaXLwQ==
X-ME-Sender: <xms:W1pdYVSNCv9hl9pE9rhAgjYXCaV0b7Jc7MNNwgiQmJeL7FTuSEFJqQ>
 <xme:W1pdYezA3Xu_9IyCT4IkAtI2aQW9YhlWF9zOJaT7wb4RqNM00jZLq5vblcqkIUfa8
 ayUfm5y8SJc9CND>
X-ME-Received: <xmr:W1pdYa2Er3FMDPaW_fFIICpA5GEl4N7y0OnpiEcnYemET-62ui-mlRk8kPefbAWWWE4hAhUvZmATp54A9UtmJ0mfKrkKPw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeliecutefuodetggdotefrodftvfcurf
 hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr
 ihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddttdenuc
 fhrhhomhepmfhonhhrrgguucfjihhnshgvnhcuoehkohhnrhgrugdrhhhinhhsvghnsehf
 rghsthhmrghilhdrnhgvtheqnecuggftrfgrthhtvghrnhepveefveeutdeitdettefgge
 ehvdduieelkefgheekheduteevheegueetueevjeehnecuvehluhhsthgvrhfuihiivgep
 tdenucfrrghrrghmpehmrghilhhfrhhomhepkhhonhhrrggurdhhihhnshgvnhesfhgrsh
 htmhgrihhlrdhnvght
X-ME-Proxy: <xmx:W1pdYdBXTrMxs5bAdCQLWAcUGP9SwEVcpbcILEsBpwZlPSU7U-LexQ>
 <xmx:W1pdYegHREvePgaa4YBbuNLo145yJEY6YlItXmHS07p9yJD1rErfFQ>
 <xmx:W1pdYRpq2CUm0IT6wTr1lbQcwRkcGAUt9NtYgQKrYQRTBFVo-XbCuA>
 <xmx:XFpdYWKqVXOsphYuLbrlPgk_xBvs_p-Y8nXRY4ZiXPHmYUYbbFLUyg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 6 Oct 2021 04:12:11 -0400 (EDT)
From: Konrad Hinsen <konrad.hinsen@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: Re: [PATCH 00/10] Add 'guix shell' to subsume 'guix environment'
Date: Wed, 06 Oct 2021 10:12:10 +0200
Message-ID: <m1fste4lnp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi everyone,

I just discovered this discussion today... a lot to read...

First of all, I very much like this proposal. It provides many
improvements to today's "guix environment" for which I have immediate
use cases.

Looking at the proposal and then the discussion, I wonder if the main
issue with "guix shell" is that it's two very different things wrapped
into one:

  1) A convenience utility for interactive work, in particular software
     development, implemented as "guix shell" with no arguments.

  2) A modernized "guix environment" for both interactive and scripting
     use.

The behavior of "guix shell" with and without arguments is sufficiently
different, which will make it a challenge to document, and then a
challenge for users to understand. And part of the criticism related to
the tacit execution of files is about the convenience for 1) vs. the
risk in 2).

So... how about making this two different commands? They could of course
share most of the implementation.

I'd use "guix shell" for the scenario that actually starts a shell, and
something different, perhaps "guix process", for the infrastructure
command for use in scripts.

Cheers,
  Konrad




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 5 Oct 2021 07:51:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 05 03:51:36 2021
Received: from localhost ([127.0.0.1]:38958 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXfEd-00075C-Km
	for submit <at> debbugs.gnu.org; Tue, 05 Oct 2021 03:51:35 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:34258)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mXfEb-000754-GY
 for 50960 <at> debbugs.gnu.org; Tue, 05 Oct 2021 03:51:34 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by albert.telenet-ops.be with bizsmtp
 id 27rY2600M0mfAB4067rYF2; Tue, 05 Oct 2021 09:51:32 +0200
Message-ID: <1e4e9ace6c74c37f2f0aaba354ad89d642f81e2b.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 04/10] DRAFT shell: By default load the
 local 'guix.scm' or 'manifest.scm' file.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Tue, 05 Oct 2021 09:51:32 +0200
In-Reply-To: <20211002102240.27815-4-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-HwFhDEgklzBYqVcJRbH8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633420292; bh=QjJ3O2HW1C43peeYRNET711XRnCnt9Xt9jEm+A0cwJ4=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=hgg53DpZ6AsCAwUKzhXqJT7OvP72PqM8r/13SP5LCgaOt/cGI4Ymn6mMN/CPsu97O
 Ln4I7zciOiLPXlw09ISrVe9vCv8H8FqkcK7YY6XdmZDYquDphpKfpohTgwoqdYw1ns
 aKzAU2/gdkPqC80rUnGV5mmWuiQzr1eYSNT3sBVwUbAJlxure2UHhRlCn5xa/tpNWK
 bMPUhG9Wdo98l5Xjvb9EcSepEqpXCSmmuep4fAdIx/yTRy++OvJu/OTnwJjhnkMoHj
 DbcadWiisLtPi5Ic+ekPz0CdzzQf25GT+Tuowtv/qbuPgjtqbuB8CdVc246Q4XRKpp
 PrZ31efyhdw7g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-HwFhDEgklzBYqVcJRbH8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
> DRAFT: Add doc.
>=20
> * guix/scripts/shell.scm (parse-args): Add call to 'auto-detect-manifest'=
.
> (find-file-in-parent-directories, auto-detect-manifest): New procedures.
> * tests/guix-shell.sh: Add test.
> ---
>  guix/scripts/shell.scm | 44 ++++++++++++++++++++++++++++++++++++++++--
>  tests/guix-shell.sh    | 16 +++++++++++++++
>  2 files changed, 58 insertions(+), 2 deletions(-)
>=20
> diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
> index 6a4b7a5092..2f15befbd3 100644
> --- a/guix/scripts/shell.scm
> +++ b/guix/scripts/shell.scm
> @@ -22,6 +22,8 @@
>    #:autoload   (guix scripts build) (show-build-options-help)
>    #:autoload   (guix transformations) (show-transformation-options-help)
>    #:use-module (guix scripts)
> +  #:use-module (guix packages)
> +  #:use-module (guix profiles)
>    #:use-module (srfi srfi-1)
>    #:use-module (srfi srfi-26)
>    #:use-module (srfi srfi-37)
> @@ -121,13 +123,51 @@ interactive shell in that environment.\n"))
>    ;; The '--' token is used to separate the command to run from the rest=
 of
>    ;; the operands.
>    (let ((args command (break (cut string=3D? "--" <>) args)))
> -    (let ((opts (parse-command-line args %options (list %default-options=
)
> -                                    #:argument-handler handle-argument))=
)
> +    (let ((opts (auto-detect-manifest
> +                 (parse-command-line args %options (list %default-option=
s)
> +                                     #:argument-handler handle-argument)=
)))
>        (match command
>          (() opts)
>          (("--") opts)
>          (("--" command ...) (alist-cons 'exec command opts))))))
> =20
> +(define (find-file-in-parent-directories candidates)
> +  "Find one of CANDIDATES in the current directory or one of its ancesto=
rs."
> +  (let loop ((directory (getcwd)))
> +    (and (=3D (stat:uid (stat directory)) (getuid))
> +         (or (any (lambda (candidate)
> +                    (let ((candidate (string-append directory "/" candid=
ate)))
> +                      (and (file-exists? candidate) candidate)))
> +                  candidates)
> +             (loop (string-append directory "/..")))))) ;Unix ".." resol=
ution
> +
> +(define (auto-detect-manifest opts)
> +  "If OPTS do not specify packages or a manifest, load a \"guix.scm\" or
> +\"manifest.scm\" file from the current directory or one of its ancestors=
.
> +Return the modified OPTS."
> +  (define (options-contain-payload? opts)
> +    (match opts
> +      (() #f)
> +      ((('package . _) . _) #t)
> +      ((('load . _) . _) #t)
> +      ((('manifest . _) . _) #t)
> +      ((('expression . _) . _) #t)
> +      ((_ . rest) (options-contain-payload? rest))))
> +
> +  (if (options-contain-payload? opts)
> +      opts
> +      (match (find-file-in-parent-directories '("guix.scm" "manifest.scm=
"))
> +        (#f
> +         (warning (G_ "no packages specified; creating an empty environm=
ent~%"))
> +         opts)
> +        (file
> +         (info (G_ "loading environment from '~a'...~%") file)

Could we have nice =E2=80=98curly quotes=E2=80=99 here:

  (info (G_ "loading environment from =E2=80=98~a=E2=80=99...~%") file)

Greetings,
Maxime.

--=-HwFhDEgklzBYqVcJRbH8
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVwEBBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7oKkAPwKaNzKVGx+AL+ncrNdaJSSur75
elAgSG/m8u9LFrNqsQEAuFU3chzE9XCEQIHbcx3qVuHyGj6PyQ2Cok7OqcsjYQA=
=LxUM
-----END PGP SIGNATURE-----

--=-HwFhDEgklzBYqVcJRbH8--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 5 Oct 2021 07:50:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 05 03:50:07 2021
Received: from localhost ([127.0.0.1]:38953 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXfDD-00072p-5S
	for submit <at> debbugs.gnu.org; Tue, 05 Oct 2021 03:50:07 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:59472)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mXfDB-00072c-EK
 for 50960 <at> debbugs.gnu.org; Tue, 05 Oct 2021 03:50:05 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by albert.telenet-ops.be with bizsmtp
 id 27q32600C0mfAB4067q3uh; Tue, 05 Oct 2021 09:50:04 +0200
Message-ID: <51388f2a0e841af6f1b4441d3dc34e38996e7209.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, Liliana Marie Prikler
 <liliana.prikler@HIDDEN>
Date: Tue, 05 Oct 2021 09:50:02 +0200
In-Reply-To: <87mtnrzgn9.fsf_-_@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
 <1c5d7a3d62da1b495a14b850a1b56b2a410b2405.camel@HIDDEN>
 <87mtnrzgn9.fsf_-_@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-kQgGfdbEBaVeygvo4ho3"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633420204; bh=QMTN73+PIbSyYbr8UlJcdeLIpktcULvajZBHoPAKeJk=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=MGEKTDgdsbWb168EUQL7kbxJe4ZVSzd1Xz8BCxKykEB9Z2gvt4mzuJeAjyxtZBlFb
 IBCCgGnDBn7oFd9yrfKQE9lA1uwi/AqGKSxzHxw9Qw3KavHvSAaNwNbNeKKW1yIxfs
 kpxR0o5ZDEWLCJHM6YuxNAObK6r9K/Kzasrg8cjeeoUocQVEymGhVnqFbnWguyeQMr
 MIg4kM2n4h8h1omLUuS3hF3YdOPRmd2idkSl0IiydKESvAdsQzylNwtwlCYP2EHrkU
 cbAo1sxzCTcNtMR6wGyoWQz1BgVw5MHoujw733/KDAHLQ9IU6VUR3LehMmMZnvnT0h
 p7UXxtxQYpe8g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-kQgGfdbEBaVeygvo4ho3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 15:43 [+0200]:
> Hi,
>=20
> Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:
>=20
> > Am Samstag, den 02.10.2021, 12:22 +0200 schrieb Ludovic Court=C3=A8s:
> > > [...]
> > > +(define (auto-detect-manifest opts)
> > > +  "If OPTS do not specify packages or a manifest, load a
> > > \"guix.scm\" or
> > > +\"manifest.scm\" file from the current directory or one of its
> > > ancestors.
> > > +Return the modified OPTS."
> > > +  (define (options-contain-payload? opts)
> > > +    (match opts
> > > +      (() #f)
> > > +      ((('package . _) . _) #t)
> > > +      ((('load . _) . _) #t)
> > > +      ((('manifest . _) . _) #t)
> > > +      ((('expression . _) . _) #t)
> > > +      ((_ . rest) (options-contain-payload? rest))))
> > > +
> > > +  (if (options-contain-payload? opts)
> > > +      opts
> > > +      (match (find-file-in-parent-directories '("guix.scm"
> > > "manifest.scm"))
> > > +        (#f
> > > +         (warning (G_ "no packages specified; creating an empty
> > > environment~%"))
> > > +         opts)
> > > +        (file
> > > +         (info (G_ "loading environment from '~a'...~%") file)
> > > +         (match (basename file)
> > > +           ("guix.scm"
> > > +            (alist-cons 'load `(package ,file) opts))
> > > +           ("manifest.scm"
> > > +            (alist-cons 'manifest file opts)))))))
> > > [...]
> > What would happen on the top-level of the Guix source tree or deep
> > inside the tree of a guile package that deals with manifests, that
> > aren't necessarily related to Guix?
>=20
> You mean a directory that contains a file named =E2=80=98guix.scm=E2=80=
=99 or
> =E2=80=98manifest.scm=E2=80=99 but that happens to do something completel=
y unrelated?
>=20
> We can never rule this out, but I=E2=80=99d say it=E2=80=99s unlikely (th=
ese two
> conventions are rather well established) and it=E2=80=99s up to the user =
to pay
> attention.
>=20
> WDYT?

Guix itself doesn't follow this convention: the guix source tree has an unr=
elated
"guix.scm" file, that doesn't evaluate to a package.  I'd expect that runni=
ng
"guix shell" within the guix source tree would be equivalent to
"guix environment guix", but currently this doesn't seem to be the case.

Greetings,
Maxime.

--=-kQgGfdbEBaVeygvo4ho3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVwDqxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ka0AQDnU7a+eWbslkX7fyYYmApXdwox
f30IDVhPdf7QlCRmiQEA/ISOlBj627fvuxi78KBfTj9oA+4xX5WqI6+fcRHVQgU=
=8DCn
-----END PGP SIGNATURE-----

--=-kQgGfdbEBaVeygvo4ho3--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 21:29:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 17:29:46 2021
Received: from localhost ([127.0.0.1]:38493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXVWs-0003x7-0b
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 17:29:46 -0400
Received: from mail-vs1-f47.google.com ([209.85.217.47]:34484)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dthompson2@HIDDEN>) id 1mXVWp-0003ws-3w
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 17:29:44 -0400
Received: by mail-vs1-f47.google.com with SMTP id z22so19649737vsp.1
 for <50960 <at> debbugs.gnu.org>; Mon, 04 Oct 2021 14:29:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=worcester-edu.20210112.gappssmtp.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=DwHSO+bymtbobYmaLx43qph2qUXiSs/2SInPAg4m6ks=;
 b=B1i5FaNPsaBQ9rMld0w4kIMuEGcOsNXOPWZhlGKFSdtuPpz0fFNa3235Fp0Q3cpboR
 5TFU5qaw4/M3JP6a2vgQ4dEM4gkgqQo551KdjO5A1aByI5rOSJ83hVrYLTgfGVJs62Zt
 Vx0hxgO7bzoi0PjNtP4Zo5nKrzHWSFDp0a0WP3WKmpgKEzpa4A94fZCm79nCfEcvXU9l
 4vAbuTuwfeHf9vyzQfBqEV6Hfs/NLrWWcUtiEY8h/bMu1nePOLDnqTKY0w0oEwjej4wk
 nKMW95YXPLdoXVXEBK3z6eoUqzG72zpms1QAfP86nMCMbxzRTVYSwaQAuV/UwDY5mxBY
 Qa4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=DwHSO+bymtbobYmaLx43qph2qUXiSs/2SInPAg4m6ks=;
 b=Gg0Mee01sgmyguxEJFycmBv0hmZqIXYDEIaE0fM4TqQ5bU8tRgEdRu9f4vKYzakhw9
 gOQFTYZV+nseV6ZqlY6D0R2r0yvxi/xiMWGp+6X7KCRBCiC5cnrJmO3Dv3yJNcaB8Ub+
 Suztiy0zOfIsg05a0r+Rwng2oSuGnm4RHogM1zYJQpDZZ6r8SZgPPvO1mKq5hSsLygWq
 sDQBGddC+tfTqUOGe9qJ0ipucGZO+8ZmzYYjEHKgAZVtPzkHvk6uuOWc7FT2hNiVaxoL
 pRlypGYErl3SFPPwE/Ei8HoMOe6JirqqIFTZbBgh62Bp55ZRy95bcBiBGf7HbC1TN9gE
 lFug==
X-Gm-Message-State: AOAM533wCHPgDZgZB7N9lmjXz8fpQL6P3hFWHQKY5ZJ3ik5naKNVws3v
 w80elnDDmKlU3b0hjNh9QyyY1Zc1Oo/Kgnbp0YhSIFXQOC2MAA==
X-Google-Smtp-Source: ABdhPJzp+yn3hrBIu7fJq1MPFmKkTOJYSwzCz2YgRkuRSHVYSSEESG1RlBAL9VwK1PY8fJgWFy6ehR1KqpLNBzbQznM=
X-Received: by 2002:a67:d00d:: with SMTP id r13mr15522083vsi.23.1633382977427; 
 Mon, 04 Oct 2021 14:29:37 -0700 (PDT)
MIME-Version: 1.0
References: <20211002102116.27726-1-ludo@HIDDEN>
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
From: "Thompson, David" <dthompson2@HIDDEN>
Date: Mon, 4 Oct 2021 17:29:26 -0400
Message-ID: <CAJ=RwfZJqZg9K1bH0fdZbC+LaRmfueb9=3tBU5Y=vhrmYKKp3g@HIDDEN>
Subject: Re: [EXT] [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hey Ludo,

First of all: Thanks for picking up where I left off all those years
ago.  You remember mailing list posts I wrote 4 years ago much better
than I do. ;)

On Sat, Oct 2, 2021 at 6:22 AM Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
>
> Hello Guix!
>
> Here comes =E2=80=98guix shell=E2=80=99, a proposed replacement for =E2=
=80=98guix environment=E2=80=99!
> =E2=80=98guix environment=E2=80=99 would stay around though, at least for=
 some time,
> probably for a long time.
>
> The differences to =E2=80=98guix environment=E2=80=99 are:
>
>   1. =E2=80=98--ad-hoc=E2=80=99 is the default.
>
>        =E2=80=98guix shell hello=E2=80=99 =E2=89=8D =E2=80=98guix environ=
ment --ad-hoc hello=E2=80=99
>        =E2=80=98guix shell -D hello git=E2=80=99 =E2=89=8D =E2=80=98guix =
environment hello --ad-hoc git=E2=80=99
>
>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.
>
>   3. =E2=80=98--load=E2=80=99/=E2=80=98-l=E2=80=99 is not =E2=80=98-f=E2=
=80=99/=E2=80=98--install-from-file=E2=80=99 for consistency with
>      =E2=80=98guix package=E2=80=99.
>
>   4. =E2=80=98guix shell=E2=80=99 without arguments maintains a cache, su=
ch that, the
>      second time you run it, it runs in ~0.1s (it does not even need to
>      connect to the daemon).
>
>      If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix s=
hell=E2=80=99, it recomputes
>      the environment, as is currently the case with =E2=80=98guix environ=
ment=E2=80=99.
>
> Here=E2=80=99s a summary of previous proposals:
>
>   - Dave Thompson: https://lists.gnu.org/archive/html/guix-devel/2017-08/=
msg00300.html
>     - [X] --ad-hoc is the default
>     - [X] caching
>     - [X] behavior with no arguments
>     - [ ] --load accepts <environment>
>     - [ ] Shepherd services
>     - [ ] 'guix environment --update' to explicitly update
>   - make --ad-hoc the default: https://issues.guix.gnu.org/38529
>     - [X] https://issues.guix.gnu.org/38529#17: proposal for a new subcom=
mand
>           deprecation of =E2=80=98guix environment=E2=80=99
>
> I think <environment> records and Shepherd services could come later.
> As for =E2=80=98--update=E2=80=99, I prefer the behavior implemented here=
 because it=E2=80=99s
> stateless and thus more predictable.
>
> Thoughts?  Are there other changes people would like to see?

A few thoughts:

1) I can't be the only one that thinks it's a pain to rebuild the
whole environment just because I updated the Guix client. It's
especially frustrating when there is a regression that breaks the
project, or the substitute servers are having a bad day.

2) One important use-case for tools like Bundler, npm, etc. is to
exactly (within their limited ability to do so, of course) reproduce
the environment for all developers working on the project.  With 'guix
environment', and now with this proposed 'guix shell', the resulting
development environment depends upon the version of Guix being used.
So, to make 'guix shell' a true universal replacement for these
language-specific tools, there should be a way to "lock" to a specific
version of Guix.  Bundler has Gemfile.lock, npm has package-lock.json,
etc.  Guix has good support for using older versions of Guix already,
so it seems feasible.  I spend a non-trivial amount of time sorting
out development environment issues for a couple dozen devs,
so a tool that took most of the variables out of the equation would be
really great.

3) I haven't looked at the patches to see if it has already been
implemented, but when running 'guix shell' with no arguments, I think
the search for the manifest file should follow the established
conventions of Git, Bundler, etc. and search not only the current
directory, but the parent directory and so on until it finds it or
gets to / and gives up. This will make the tool much more usable when
working inside a subdirectory within a project.

Just some things to think about.  I just don't want to see Guix commit
to an interface that slams the door on future improvement due to
compatibility reasons.  I mean, what would you even name the next
tool? guix... biome?

Anyway, great work!  Back to lurking.

- Dave




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 17:38:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 13:38:25 2021
Received: from localhost ([127.0.0.1]:38306 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXRuz-0006dM-PC
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 13:38:25 -0400
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:34517)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@HIDDEN>) id 1mXRux-0006d9-AW
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 13:38:25 -0400
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id 328195C01E0;
 Mon,  4 Oct 2021 13:38:18 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Mon, 04 Oct 2021 13:38:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-type:content-transfer-encoding:in-reply-to; s=mesmtp;
 bh=7Q28bIiVFQe7deGWBZGc8wjwfsA7QTKFPoSEcVC3F3U=; b=lPeMXWx1u8HB
 B/Yi84fv15PXq32HXlYwtSVBFtsWKAgEQNvr/Oed0KdKBhZMWdQl6bCqLQffnTKb
 LghlWd+tVQfDiAAfQwcpFqkcIcu9HE1vvnm/VOQ7orNUucyr0Usi15azNf4EW2v/
 nYismx5KqpL+bidbZ6gVTlk3kg9Pkx0=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm1; bh=7Q28bIiVFQe7deGWBZGc8wjwfsA7QTKFPoSEcVC3F
 3U=; b=eh/dswnqVpUbTQrtLr3j7MXafDWT1ry0w+OGZCQtsPxLbgwUNX7dx6LVP
 ZDW3NSl2edW48vhJG9aIXjJvgMNAM/otI7FU2FlH+Jvixa34DJr71vCXGfe0Yp3Z
 3guBNmoQJchFHse4VgZpfAS0CG4JGK1zwtOcR6obxCBqZ2qdxUg2R48WQx7mVRBj
 esXHPJHtAx9A4p8KoFOra0yfxW2F9ue12Exo210CynCfMa7iw8UuAOkHh0ykdtee
 FRCnlrJ9jZABmeVHOGufnzy/dkL3anYvJ3If4MFvFisZZUnaFvcIqnoOTizFlmYM
 83aFB+rR9hVUiaHQQJfevJOB6XDYA==
X-ME-Sender: <xms:CjxbYdI5f8BrKagXXr7qdL9aeU7BO8E_gMGxp9HvIMCzm79Tbj5EUg>
 <xme:CjxbYZJmrPUp_JnNAxOdYWg2MZy9k3uAu8es3T5lJ6g_yzMYxtPAP5-iVUyJDOep2
 arR9djU_vhsWRULxA>
X-ME-Received: <xmr:CjxbYVswh6AkKgsKIQOOG6CYuhGyWTTprHBnZg0JlTVi67-v5twPh7Q4JoDR1UY_1-QlIrzmJd4Ge5ORmz7OgMGflQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelvddgudduvdcutefuodetggdotefrod
 ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh
 necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd
 enucfjughrpeffhffvuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpefnvgho
 ucfhrghmuhhlrghrihcuoehlvghosehfrghmuhhlrghrihdrnhgrmhgvqeenucggtffrrg
 htthgvrhhnpeegjeeggeehtddugfffuddtvdfffeffjeekffffveffheegvddvuedtffek
 jeejjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe
 hlvghosehfrghmuhhlrghrihdrnhgrmhgv
X-ME-Proxy: <xmx:CjxbYebEyJEXfZ1ZgOjlu0Ncjdfgr044j8R1EhRGtuvDnaaFDFUQiQ>
 <xmx:CjxbYUY-rqepYL1E9h4gwftMKo30X1AR9TjwGNCRBSdWMGii5ufPqA>
 <xmx:CjxbYSAEko6xjT4EVGYJeOBjXRSjlDgmgeWfd8p3U6D4efbHyE7n6w>
 <xmx:CjxbYdDd6VLtUCjYssoT8KahNxaPSN84MwjSXM7AvclQwiTfBZ6gAg>
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 4 Oct 2021 13:38:17 -0400 (EDT)
Date: Mon, 4 Oct 2021 13:38:16 -0400
From: Leo Famulari <leo@HIDDEN>
To: Ludovic =?iso-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <YVs8CBpBBnw6gFzZ@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Courtès wrote:
> Here comes ‘guix shell’, a proposed replacement for ‘guix environment’!
> ‘guix environment’ would stay around though, at least for some time,
> probably for a long time.

Very nice!

>        ‘guix shell -D hello git’ ≍ ‘guix environment hello --ad-hoc git’

Is my understanding correct, that arguments to `guix environment` are
positional, whereas with `guix shell` arguments are not positional?




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 17:12:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 13:12:55 2021
Received: from localhost ([127.0.0.1]:38266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXRWI-0003qI-Mu
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 13:12:54 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:59150)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mXRWE-0003q6-OS
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 13:12:53 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by albert.telenet-ops.be with bizsmtp
 id 1tCp260010mfAB406tCpME; Mon, 04 Oct 2021 19:12:49 +0200
Message-ID: <9fedb2b3797673ad7f6f0cbd5731cbc632b1b587.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, Vagrant Cascadian
 <vagrant@HIDDEN>
Date: Mon, 04 Oct 2021 19:12:40 +0200
In-Reply-To: <874k9xrxxj.fsf@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN> <871r53htdv.fsf@yucca>
 <874k9xrxxj.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-zCAtNyzDBKrYR8y/3aag"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633367569; bh=GdzeVpgUB/Fu46EhAOnBL4yrH0DxAK0l0A+qFuSDij0=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=nwXfPdVs8OdkYMjE5NmnQ4Dto9NvZIhnKZgqlWeVHLXfJFaaZr4iGtNM9j/tPn7sW
 jkFUfaa6H5gmQfJmJo9AK05fxe/l7YRWLKPlnIJuMsWX4uAr4qKD6Cjwatzxz+sSI+
 J5rL1OznM6BWlQ1EhOpxS4bdqPLLtjxrrj/OQvoVYtEUXhbi8mHIsHijkH3vV/ZKeG
 wNw3HpCeEGAGaS3Md7HjSNvCPqSPCttboJD4cuw0AAK7BRKa7j31xKOK1MBfR2cvyB
 btRwUNH3e6r0Flqp3aYsbjUOPQvwhylMoh85pMu9/YVcVjaeINf9GyCYSDGPBm0ze3
 Ts50ImbeIjp8g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-zCAtNyzDBKrYR8y/3aag
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op ma 04-10-2021 om 10:34 [+0200]:
> Hello!
>=20
> Vagrant Cascadian <vagrant@HIDDEN> skribis:
>=20
> > On 2021-10-02, Ludovic Court=C3=A8s wrote:
>=20
> [...]
>=20
> > >   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98=
guix.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
> > >      from the current directory or one of its ancestors.
> >=20
> > This sounds a little scary to me, just implicitly importing whatever
> > happens to be lying around doesn't sound very guixy...
>=20
> Right, it would be the first command that does that.
>=20
> I became quite convinced that conventions and, thus, implicit arguments
> can occasionally improve usability.  We use tools that operate this way
> daily: =E2=80=98make=E2=80=99, =E2=80=98git=E2=80=99, etc.  Dave nicely a=
rgued about it:

'git' doesn't run binaries in the repository, unless configured otherwise
(in .git/config I think).  =E2=80=98make=E2=80=99 and =E2=80=98bundle=E2=80=
=99 are verbs and are for building
source code, which needs to be checked for backdoors anyway, so those progr=
ams
implicitely reading code from the current directory seems acceptable.

"guix sh" seems to be useful outside software development.
E.g. I sometimes do
"guix environment --pure --ad-hoc minetest various-minetest-mods-... -- min=
etest",
which would become
"guix shell --pure minetest various-minetest-mods-... -- minetest".
I could very easily accidentally press the enter key after typing "shell"
(I write from personal experience), and this could easily happen from withi=
n,
say, a ~/Downloads directory with an untrusted guix.scm (e.g. downloaded fr=
om
some rando's site to look at later).

Conventions are nice, but loading arbitrary code from the current directory
by default is an exploit waiting to happen.  This situation seem like inclu=
ding "."
in PATH by default to me.

Greetings,
Maxime

--=-zCAtNyzDBKrYR8y/3aag
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVs2CBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ju2APwMhHDa5IZLEuzUpci5cznfcmvr
qvJYcqAZ1o9bTBTsvQEA+mwVlhVJkbqa2R/eEqAvAesOY3jR1LQlh2w5IDUQOg8=
=L6bZ
-----END PGP SIGNATURE-----

--=-zCAtNyzDBKrYR8y/3aag--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 16:50:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 12:50:42 2021
Received: from localhost ([127.0.0.1]:38219 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXRAn-0003HK-QY
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 12:50:42 -0400
Received: from michel.telenet-ops.be ([195.130.137.88]:54586)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mXRAl-0003H8-68
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 12:50:40 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by michel.telenet-ops.be with bizsmtp
 id 1sqd260020mfAB406sqdY3; Mon, 04 Oct 2021 18:50:37 +0200
Message-ID: <991f4d26de32b3b9c93b1112920f11427a54f4fd.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, "pelzflorian
 (Florian Pelz)" <pelzflorian@HIDDEN>
Date: Mon, 04 Oct 2021 18:50:27 +0200
In-Reply-To: <87ee91ryg1.fsf@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211002115958.rzupz4afq7elehq4@HIDDEN>
 <87sfxjzgsv.fsf_-_@HIDDEN>
 <20211002150851.7xa2wdb225dbjtpi@HIDDEN>
 <87ee91ryg1.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-lq18kKTjCTR2BUqN4heP"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633366237; bh=GHTmoPyPSfyfpWGBHYLfhGhrwwviBu/X3Gocaueg7zU=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=QdHo2GwNlvHKm/dK5MEvTt+pVhfn7LIQLHwVYiXkl1UvuO1Yp4tsun9WxUTrDLisZ
 cD7a08thf2rkAJIV+qkFpLZ+dI6icsl9SPxRerSRVRQ+NHEi5970NI2DkQ2ShmBYrM
 74CNkNljk95SmhnDt+01vQ4jxe9TGHbv4i4MMsx2NLwIO2M4jCqHBB/VW70aHvXbAs
 BHiX6JfgrDxkbAYazHl8MEBgDc8Jmr+nRAxKzvdInoDfL9GvTaR0O+J4mbffyQuKE/
 skfszb39UAJfr+WA8Aa0mUTpZI+Lc3xYGgDAOyXvRwK+pIhKME7UMzlAX9Syw0LI36
 8Kgf0MCU71ioA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-lq18kKTjCTR2BUqN4heP
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op ma 04-10-2021 om 10:22 [+0200]:
> Hi,
>=20
> "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:
>=20
> > On Sat, Oct 02, 2021 at 03:40:00PM +0200, Ludovic Court=C3=A8s wrote:
> > > "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:
> > > > On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Court=C3=A8s wrot=
e:
> > > > > 2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=
=98guix.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
> > > > >    from the current directory or one of its ancestors.
> > > > This however is concerning.  Users will not expect guix to execute
> > > > arbitrary code.  Maybe print a suggestion to maybe --file the file
> > > > instead.
> > > I think it=E2=80=99s fine as long as, as in the case of =E2=80=98haun=
t build=E2=80=99 or =E2=80=98make=E2=80=99
> > > or =E2=80=98git=E2=80=99, it=E2=80=99s properly documented.  Also, =
=E2=80=98guix shell=E2=80=99 unconditionally
> > > writes a message.
> >=20
> > Let=E2=80=99s say I have downloaded undesirable code to a file
> > /home/florian/Downloads/guix.scm and am hacking on source code in
> > /home/florian/Downloads/something/ where I run `guix shell`, but
> > /home/florian/Downloads/something/ does not in fact contain a
> > guix.scm file.  Now I=E2=80=99d have accidentally run the other guix.sc=
m.
>=20
> Sure, but it=E2=80=99s all under your control; it=E2=80=99s not very diff=
erent from
> someone knowingly running =E2=80=9Cguix build -f guix.scm=E2=80=9D on an =
untrusted file,
> is it?

Consider the following situation:

  1. I browse the web and find some rando's website.  It has a link to a "g=
uix.scm" to download.
  2. I'd like to know how people are using guix, so I tell IceCat to downlo=
ad it.
     IceCat downloads it to ~/Downloads/guix.scm.
  3. I forget about the guix.scm and didn't look at it.
  4. I download some tarball, verify it (with gpg or something), unpack it,
     and run "guix shell" without arguments from within the directory
     (e.g. ~/Downloads/some-source-code).
  5. It turns out the tarball didn't actually have a guix.scm, so the
     ~/Downloads/guix.scm from the rando is loaded.
  6. It turns out the rando's guix.scm uploads my secret keys, passwords,
     all e-mails, installs a keylogger ... Oops!

> > Also `make` is typically used without arguments, but a novice `guix
> > shell` user might know `guix shell program-a program-b` but is
> > surprised when running `guix shell` without arguments in an untrusted
> > directory.
>=20
> We have the advantage that =E2=80=98guix shell=E2=80=99 is a new command,=
 so we can
> document it from the start as behaving this way without arguments.

Sure, this behaviour can be documented, but it's very easy to forget a piec=
e
of documentation, especially if the behaviour is inconsistent between "guix=
 environment"
and "guix shell", and an attacker only needs an attack to function once.

I'd prefer not be constantly kept on my toes, so if "guix shell" will autom=
atically
load guix.scm in the current directory or parent directories, I think I'll
keep using "guix environment" to avoid any opportunities for fatal mistakes=
.

Greetings,
Maximes.

--=-lq18kKTjCTR2BUqN4heP
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVsw1BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iNvAP9w6uhC55k8rLsfc6FuAyUHJKqw
Q+4aU5maKG+kj1U+zQD7BTf7JP1DbslnAKWsTztizW/ALYUzCn15gP4y0KfE/Ao=
=WfW1
-----END PGP SIGNATURE-----

--=-lq18kKTjCTR2BUqN4heP--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 15:59:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 11:59:12 2021
Received: from localhost ([127.0.0.1]:38173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXQMy-0008C4-5J
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 11:59:12 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:45848)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mXQMs-0008Bq-1b
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 11:59:10 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by albert.telenet-ops.be with bizsmtp
 id 1rz32600j0mfAB406rz37c; Mon, 04 Oct 2021 17:59:04 +0200
Message-ID: <f821bfcc64304e467575a26c4473ddc6863eb42e.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Date: Mon, 04 Oct 2021 17:58:41 +0200
In-Reply-To: <87lf39ryle.fsf@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
 <87ilyfy0q4.fsf@HIDDEN>
 <d169e493187d1de26c09dd1503e55cb5db982384.camel@HIDDEN>
 <87lf39ryle.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-IsBlfaMsDAaUWMCzUWr2"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633363144; bh=uTQ3FZMUyPXWdnAOipUp4VqFlLv/ZRHbFeenCFJLLu4=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=gzXXyt700gfYpf8qrCuY7E0EZxD1PWyPB1ZDnAocc6Cfq+NJd+8xeGYLsjj19wS7O
 Usjlp4lzWA/m5ASrOsi446WETLoA0skGdrSntIwjmtpcuWaKZ5j/dbvB7LkD9aVJ4Y
 uStw7rV3ZptzoxY6UisLjyuFXS2ntgSJw7TcFTJnNqXJacaRmisen/fvSzCh8+OMtb
 Lst+Bwo4Gwq5BiHRfNw7IamhESkHXaeUiBVhNDNMYK5pm2Puzkhpx4WuoZSKEggj0k
 QZTGBcDBkBibn4hsufY29D5VHYzHL7OxmwpHl7Qt1tUOoNGG1IPrSSjmArijuiwm8p
 ay3DdGZD6Qqcg==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-IsBlfaMsDAaUWMCzUWr2
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op ma 04-10-2021 om 10:19 [+0200]:
> > A documented flag to always consider the cache stale seems good, though=
 I think
> > at least the dependencies made with the common macros and procedures 'i=
nclude',
> > 'load', 'include-from-path', 'load-from-path', 'use-modules' and non-re=
cursive
> > 'local-file' could be tracked, though this could be left as a TODO for =
later
> > I suppose.
>=20
> Tracking those uses reliably is impossible: there could be same-named
> bindings that do other things, there could be custom macros, there could
> be =E2=80=9Cdynamic arguments=E2=80=9D (whose value is not known statical=
ly), etc.  You
> have to expand + evaluate the code to get better results, and even then,
> there might be different paths in the code so you can=E2=80=99t be sure y=
ou got
> it right.

I think there's a miscommunication here.  From what I'm reading, what you h=
ave
in mind is that, to determine the dependency information, "guix shell" woul=
d
open "guix.scm", read it with the procedure 'read' and sniff for 'load',
'include-from-path', 'load-from-path', 'use-modules' and 'local-file' form
-- something like 'module-file-dependencies' and 'extract-dependencies', bu=
t
more general.

However, my idea is to replace these macros, such that, when "guix shell"
loads "guix.scm" or "manifest.scm", these macros inform "guix shell"
that "guix.scm" or "manifest.scm" depend on certain files referred to
by 'load', 'include-from-path', etc. forms, using a mechanism like the
'notice-dependency' defined in <https://issues.guix.gnu.org/50384>.

Then, when "guix shell" puts the resulting profile in the cache,
it includes the generated list of files.  And when "guix shell" finds
an entry in the cache, it will check if the files in this list (and guix.sc=
m
or manifest.scm of course) have been modified.  If some are (or the forcing
flag is set), guix.scm needs to be loaded and a new profile needs to be
generated.  If they are all unchanged, guix.scm will _not_ be read: the cac=
hed
profile can be reused.

It's not 100% reliable (e.g. the list of packages in the manifest could
depend on the phase of the moon if (current-time) is used) (is that what
you mean by =E2=80=98different paths=E2=80=99 and =E2=80=98dynamic argument=
s=E2=80=99?), but it should
cover the vast majority of cases.

I don't know a non-artifical situation where =E2=80=98custom macros=E2=80=
=99 are a problem
-- do you know an example in the wild where this dependency tracking scheme
would fail to work?

> We could get an approximation for common uses by recognizing special
> forms as you suggest.  But it=E2=80=99s just that, an approximation.

It's an approximation, sure, but it seems to be a quite accurate approximat=
ion
to me.  And it's not really recognising special forms that I'm suggesting,
but rather modifying the macros behind these forms to inform "guix shell"
of what the dependencies are.

> In such situations, I err on the side of not even trying.  The added
> complexity for a flaky result doesn=E2=80=99t pay off to me.  I prefer to=
 be
> upfront, document limitations, and let users handle them as they see
> fit.

About complexity: there's some extra code, sure, but it doesn't seem comple=
x
to me.  To track dependencies in <https://issues.guix.gnu.org/50384>,
I only needed to add 'notice-dependency' and some other code to (guix build=
 compile),
and some code to build-aux/compile-all.scm to save/load the dependency info=
rmation
to/from the builddir and to also check the mtime of dependencies.

Does it still seem flaky to you, after my explanation on how the dependency
information would be determined?

Being upfront, documenting limitations, and having a =E2=80=98force rebuild=
 flag=E2=80=99
(is that what you mean by =E2=80=98letting users handle them as they see fi=
t=E2=80=99?)
(possibly also documenting 'notice-dependency') is not incompatible with
the automatic dependency tracking.

More abstractly, this seems more like a =E2=80=98Perfect is the enemy of th=
e good=E2=80=99 situation.
While I would prefer 'perfect' above 'good', and the automatic dependency t=
racking
certainly isn't 'perfect', it does seem 'good' to me, and perfection appear=
s to
be impossible and there's the =E2=80=98force rebuild flag=E2=80=99 as an es=
cape hatch, so I believe
'good-but-not-perfect' to be acceptable here, as long as it is documented i=
n the manual
that there are some limitation on what dependencies are automatically track=
ed.

Greetings,
Maxime.

--=-IsBlfaMsDAaUWMCzUWr2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVskshccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7o9RAQCMHGDE6veWG0GNgcj9MUOlBs/9
G5xDCZkVsqfM7KsIpQEA5QWvEXT6O9lcGYZUU6VByqjg/T2t45wdRTDSOeThzAc=
=dE78
-----END PGP SIGNATURE-----

--=-IsBlfaMsDAaUWMCzUWr2--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 14:21:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 10:21:17 2021
Received: from localhost ([127.0.0.1]:38030 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXOqC-0005PC-PH
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 10:21:16 -0400
Received: from mail-qv1-f53.google.com ([209.85.219.53]:41927)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mXOqB-0005Oz-Dh
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 10:21:15 -0400
Received: by mail-qv1-f53.google.com with SMTP id d20so2998961qvm.8
 for <50960 <at> debbugs.gnu.org>; Mon, 04 Oct 2021 07:21:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=r+Av7prnhxIm4sCH8NzO/+7p0utdcwNHlRp3ZzxqWmE=;
 b=VrAiMnicJreZ+nGtopdycqJRgu2rbuJbATdlvb8hnlOnNuXfYzs6t4OLmewOz6n6mY
 yyem7evK/CYnxT4izhH4y53HzZ3XXrOq+FZQUS402hhKfrBsghhRl8QW42dvh3oYdleV
 FvN7j4QwN6k4qVHKbMogHU19brLv49cMArcHDbOp0sM17ARXWLGou5F8q+d6CFlh+Kgi
 emiCPSyhvkjPw4g5pr48V/hUujWkAc/lo3sWCpQEYoOOvpIs7tVStm3XZDXVlNDPc4jE
 SJOiG15hHNSpIcaUQXqrENISW3HgYX8W9nGYmTgpUPN+IMIsOEiR8OgtiNVOCbfmv+TB
 r8Vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc:content-transfer-encoding;
 bh=r+Av7prnhxIm4sCH8NzO/+7p0utdcwNHlRp3ZzxqWmE=;
 b=PZT/Mv7jJX2B4v+f/s5ORA4UjaQkBZn2UCgKD7SVM5HrX1EhN1DiXQGZhx5ZZfrTim
 MdGkYbVEi7lGoHBUU9peIVBd5MhpD1yX+q1IJAb6nt1AZ+k/y6PJpbhiM4q+w8ElS8tk
 HAGWHJW0hpI8jIAIWyx8cUOSC8f3by16qd0an1pYmTp0wxcgbDWNWlC02bqUw4RsMzyg
 KEkzqo2hP7lWHAOgzZBVZcJL06sl7Uqt/UlDh7IQtv2hToiI7eM3JjCRi2wVZ6MtyitV
 sRZOB3y/U2QQJMQAt5u7pFj2ssYzYcBYJloYU78bk9c+Kaal8dUhGPkG3jOQSS5K+m7e
 GNiA==
X-Gm-Message-State: AOAM533od1il20icS6VItV1jLEQbawmzG7/zpqWD1XPbJTkdf+zePGoE
 SAJhUJTf4FSfMS0WRhVdUzyj+tcPAJWy2XfdQPA=
X-Google-Smtp-Source: ABdhPJxACuh72NYYTC4o0yLQoo5aF4oM1PHChPhIRz5Fw6AQUX54DldpU//CdTy7XhRohvOQFbMndFCBNGY/Ol54Ruk=
X-Received: by 2002:ad4:484a:: with SMTP id t10mr23569654qvy.55.1633357269786; 
 Mon, 04 Oct 2021 07:21:09 -0700 (PDT)
MIME-Version: 1.0
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
 <87ilyfy0q4.fsf@HIDDEN>
 <d169e493187d1de26c09dd1503e55cb5db982384.camel@HIDDEN>
 <87lf39ryle.fsf@HIDDEN>
In-Reply-To: <87lf39ryle.fsf@HIDDEN>
From: zimoun <zimon.toutoune@HIDDEN>
Date: Mon, 4 Oct 2021 16:20:58 +0200
Message-ID: <CAJ3okZ01u41eV+w=CjE_jVT1bqkmFZVQTwmzq+8g0ObM7RxqqQ@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, Maxime Devos <maximedevos@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Mon, 4 Oct 2021 at 10:52, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

> In such situations, I err on the side of not even trying.  The added
> complexity for a flaky result doesn=E2=80=99t pay off to me.  I prefer to=
 be
> upfront, document limitations, and let users handle them as they see
> fit.

I agree.  Just a flag for forcing seems be worth here.  For this
dependencies use-case or simply for debugging.

Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 13:42:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 09:42:27 2021
Received: from localhost ([127.0.0.1]:35961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXOEd-0003cX-LC
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 09:42:27 -0400
Received: from mail-wm1-f48.google.com ([209.85.128.48]:40544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mXOEZ-0003cG-NE
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 09:42:26 -0400
Received: by mail-wm1-f48.google.com with SMTP id
 t16-20020a1c7710000000b003049690d882so19650166wmi.5
 for <50960 <at> debbugs.gnu.org>; Mon, 04 Oct 2021 06:42:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=brioCLmYKR+ApYargtPQU0DTKDIP8XvppaeX8nzxIOg=;
 b=byRLxqfiiPuzduZzg356ymTnEBBlXK8KduErH8N/xCMSsZ6fxLY7hWROPpQSSd4ddN
 OyEQ/O79oQ/9D+AjytBjBktLiolW98XQBmQ8agsb3LFcbhPVQGDfpV4220aVh0wM/BVD
 WtEuIEZ+/6BJ55KkF6498UD+GWtpoaEGAvHz9MLORr7MKT0tG/5IQTKnhXkya4qrsceK
 iwI8EjfdyWabxN890x73IwSxrptgk3F/9qf0Dfavz2wgMnCpJ39bu7qVGEGf1Jaz5qfe
 8Lt6NC517AT0y32OSC2pzbzi6lsMxRvmdymsEhC3bHy/w3bHQOmmlvgD+owUST3NHdB6
 prUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=brioCLmYKR+ApYargtPQU0DTKDIP8XvppaeX8nzxIOg=;
 b=WT2tGhtpjloxBPGZEKXkvK+kucBPVejQwhwenSQIzlRyvpsFa6F+W9xe9a71ZXY9xX
 EXg69SEVSQXsVkCjxZmKfYzuNJzgUrCKBtY1f5pOAO/NNn+mm2T1Xd00w4kTY3jtQyF6
 4MrhJONx2XeVz4A9IGEXYLITKepvdqBvbjiWsVZkxwFg1Vjo4XxdCO31L/BBKQDEcDDE
 EQvw3VAGBm/ncip92OGC3c9ni18Pw7tQ7PtwJJOl2nM77v3mSuPOOkgR8G9e5wSUHTg+
 GbUP1hbm4OwqOYhT5W23OgpDHrl+SthJhbL0K6sFJMLYnHnxQwrM/inxnVOEUAWESYJr
 o+rQ==
X-Gm-Message-State: AOAM531+8gTpE0HruLS/0LLf/B2EphULzGg0FP3y4Rx0ovK/BK74Sq0z
 X8c2VIEm3z2Upb/rXCUk4gn9Bsze5DQ=
X-Google-Smtp-Source: ABdhPJxGnn9BtsBZXhQPgYQGq9SvCX9GtsocoJ3yuQk67FvdigyeT4JD4U55/h30RPbToJgmXCJX9w==
X-Received: by 2002:a7b:cb4f:: with SMTP id v15mr18233301wmj.21.1633354937227; 
 Mon, 04 Oct 2021 06:42:17 -0700 (PDT)
Received: from pfiuh02 ([193.48.40.241])
 by smtp.gmail.com with ESMTPSA id y15sm7948000wrp.44.2021.10.04.06.42.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 04 Oct 2021 06:42:16 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN> <868rz9ffck.fsf@HIDDEN>
 <87r1d1qj3v.fsf@HIDDEN> <86a6jpdqf2.fsf@HIDDEN>
 <878rz9q8q1.fsf@HIDDEN>
Date: Mon, 04 Oct 2021 15:42:03 +0200
In-Reply-To: <878rz9q8q1.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
 =?utf-8?Q?s?= message of "Mon, 04 Oct 2021 14:23:50 +0200")
Message-ID: <87zgrosy8k.fsf_-_@HIDDEN>
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-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon, 4 Oct 2021 at 14:23, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
> zimoun <zimon.toutoune@HIDDEN> skribis:

> > For sure, I agree =C2=ABwe owe our users stability=C2=BB.  That=E2=80=
=99s I translate into
> > =C2=ABthe real issue is to let people knowing such change=C2=BB. :-)
>
> No no.  The problem is that there *will* be material out there
> explaining Guix in terms of =E2=80=98guix environment=E2=80=99, people *w=
ill* stumble on
> it, and it=E2=80=99s important to keep it working long enough so people c=
an
> update their material.

We are saying the same, no?

Except that for me "people" and "material" are vague so I propose to add
a section to deal with this vagueness at removal time (maybe 2023 or
2024?) explaining how to switch from "guix enviornment" to "guix shell".
Therefore, people will stumble on this not-updated material, then they
will be able to run it with "guix shell" using the proposed section.
One could image:

  $ guix enviornment <old> <example> <how> <to> -- <use> <it>
  error: environment had be removed by commit: xxxxx.
  hint: Try `guix time-machine --commit=3Dyyyyy -- environment <old> <examp=
le> <how> <to> -- <use> <it>'
  Please read section "guix environment" in the manual.

where yyyy is that last commit right before the removal.  Or something
along this idea.


Well, we agree to speak about that when preparing v1.5 or v1.6 and we
are far from that. ;-)

Cheers,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 12:24:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 08:24:04 2021
Received: from localhost ([127.0.0.1]:35845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXN0m-0001dI-Ng
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 08:24:04 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43270)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXN0k-0001cl-1N
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 08:24:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50966)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXN0c-0001DR-65; Mon, 04 Oct 2021 08:23:55 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60538 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXN0a-0000o9-My; Mon, 04 Oct 2021 08:23:54 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN> <868rz9ffck.fsf@HIDDEN>
 <87r1d1qj3v.fsf@HIDDEN> <86a6jpdqf2.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 14:23:50 +0200
In-Reply-To: <86a6jpdqf2.fsf@HIDDEN> (zimoun's message of "Mon, 04 Oct 2021
 12:40:01 +0200")
Message-ID: <878rz9q8q1.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

zimoun <zimon.toutoune@HIDDEN> skribis:

> On Mon, 04 Oct 2021 at 10:39, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

[...]

>> As discussed in <https://issues.guix.gnu.org/38529#17>, removal is an
>> issue because of existing scripts but also because of learning material
>> around: MOOCs, articles, tutorials, etc.  These won=E2=80=99t be updated
>> overnight, and we owe our users stability.
>
> For sure, I agree =C2=ABwe owe our users stability=C2=BB.  That=E2=80=99s=
 I translate into
> =C2=ABthe real issue is to let people knowing such change=C2=BB. :-)

No no.  The problem is that there *will* be material out there
explaining Guix in terms of =E2=80=98guix environment=E2=80=99, people *wil=
l* stumble on
it, and it=E2=80=99s important to keep it working long enough so people can
update their material.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 10:48:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 06:48:14 2021
Received: from localhost ([127.0.0.1]:35778 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXLW1-0005Yi-Kr
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 06:48:13 -0400
Received: from mail-wm1-f41.google.com ([209.85.128.41]:50897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mXLVy-0005YO-2J
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 06:48:12 -0400
Received: by mail-wm1-f41.google.com with SMTP id j27so13122285wms.0
 for <50960 <at> debbugs.gnu.org>; Mon, 04 Oct 2021 03:48:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-transfer-encoding;
 bh=Hysui7VZqRP9HhRgp1lL30ZJt/UKFyBuxIj+rCi6Zfc=;
 b=fkfYjCt6xXj/m3/NmyCxw10dkseIR6/JWbHzThghK/zP5G/hilIsPusZl1FUhv3mTo
 U5/OlyKtJXcDxr7c2HMVBjXSoFW2s8V0EvC7ia9a1h+hWkUDPuBL5MCMjpqLyw9ZF6O+
 MIVYfGM8229a6/tyYA+pIFkOW0Ac1Akkd0JA1amVNgQXn1PtlFPFsaetYbvaDcUjygyM
 DIPSTn+LVOjsBUaRSVwuxiad/v0Fp0rGQvqd4A7diFGV66rbCxglVDQ6kpUEEHE14I8N
 LUOQZh6iXGJ10Q//RIKfLChcSsCTAcUfwMyh6U7oeVXntjUBxd3HJzPlb7RWEuasih8J
 DetQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=Hysui7VZqRP9HhRgp1lL30ZJt/UKFyBuxIj+rCi6Zfc=;
 b=mLCtZ6o6O74hQvNTHA4SqR2SfQRzzJDIABVx6K0m57U0DR6ZwuOmvrEg9aE4ca+Pc6
 hqMvyWVaSOLpXjb/oScOr+dF6uG8Y3Dtqc+aXCKl5yPqxt0Lpps9Wq4VRnVWwrNGRcSw
 5myRbwiXrQ+98tpTxy4NmHq2EDxX5CeYAxkkfI5LRMo+bHDK6yEPju7454oH+ZAAhjBE
 mix65AshrsYO2le1Xhl5aDk84wYMJ21WGKb0sMp05EdNokez2thIyopyzF1RrZzHZX+P
 /QwgFHZHCZppZp0S53JAe5nNCSRFwsGVM7MeTZC+z7DA/c1s2Ktl6Xm4kQtn2/pEDyxQ
 mmTw==
X-Gm-Message-State: AOAM531DwVTp30chgD5+NuJgdPMf8wxT8J7OQra2znBlbu+n0aEYQbHI
 TbQamzkXbuZGBIdH5JePxXPbQKYiJnHe+w==
X-Google-Smtp-Source: ABdhPJzTrtz9WdDN00SDxShtPwTKVBO5wqgT2UV+N9ZkMb7jSUK9F/LoH8hwxOvAbX8nXsX9YkkA+g==
X-Received: by 2002:a1c:f405:: with SMTP id z5mr17850740wma.72.1633344483870; 
 Mon, 04 Oct 2021 03:48:03 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id k22sm14337715wrd.59.2021.10.04.03.48.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 04 Oct 2021 03:48:03 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
In-Reply-To: <87r1d1qj3v.fsf@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN> <868rz9ffck.fsf@HIDDEN>
 <87r1d1qj3v.fsf@HIDDEN>
Date: Mon, 04 Oct 2021 12:40:01 +0200
Message-ID: <86a6jpdqf2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

On Mon, 04 Oct 2021 at 10:39, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

> It should be clear from the code that I generally prefer explicit over
> implicit :-), but I think Dave has a point when talking about
> conventions for this kind of developer tool.

Well, if you speak about this thread [1], the point is others are doing
so and it is an usability improvement. :-)

I am fine since somehow it is already the case with =E2=80=99make=E2=80=99 =
or all the
config files or many of us seem to simplify their workflow using direnv
or etc.  so yes it is probably handy to have conventions and automatic
load by default. :-)

1: <https://lists.gnu.org/archive/html/guix-devel/2017-08/msg00300.html>


>>> As for deprecation, I think there=E2=80=99s no rush.  I imagine there c=
ould be
>>> several phases, like: initially we only mention deprecation in the manu=
al,
>>> later on =E2=80=98guix environment=E2=80=99 starts emitting a warning, =
and later (I guess
>>> at least two years later, probably more) we ask ourselves whether to
>>> remove =E2=80=98guix environment=E2=80=99.  At this point keeping it do=
esn=E2=80=99t cost us much.
>>
>> Concretely, I propose this plan:
>>
>>  - v1.4: mention deprecation in the manual and remove from =E2=80=9Cguix=
 help=E2=80=9D
>>  - v1.5: emit a warning
>>  - v1.6: remove the command
>
> Could be like this.  I guess we could also slow down the plan if we
> observe that =E2=80=98guix environment=E2=80=99 sticks around longer than=
 we thought.

Bah, let reconsider this when preparing v1.6. ;-)  At the current
release rate, probably 2024. :-)

From my point of view, we should clearly document at v1.4 that this
command will be removed soon or later.


>> Well, I do not see why the removal should be an issue, because there is
>> =E2=80=9Cguix time-machine=E2=80=9D.  To me, the real issue is to let pe=
ople knowing
>> such change.
>
> As discussed in <https://issues.guix.gnu.org/38529#17>, removal is an
> issue because of existing scripts but also because of learning material
> around: MOOCs, articles, tutorials, etc.  These won=E2=80=99t be updated
> overnight, and we owe our users stability.

For sure, I agree =C2=ABwe owe our users stability=C2=BB.  That=E2=80=99s I=
 translate into
=C2=ABthe real issue is to let people knowing such change=C2=BB. :-)

As I am trying to explain, this scenario,

  guix environment <options> <packages>
  =E2=80=A6 wait several months or years =E2=80=A6
  guix pull
  guix environment <options> <packages>

will break because <packages>.  Therefore, one will have to fix these
very same scripts.  Even us, we are not able to maintain working scripts
for different points in time.  The example using =E2=80=9Cguix environment=
=E2=80=9D is
broken for the manual released at v1.3, as pointed here [2].

However, =E2=80=9Cguix environment=E2=80=9D will still work using =E2=80=9C=
guix time-machine=E2=80=9D.
Nothing is really broken, IMHO.

About learning materials, we could remove the command =E2=80=9Cguix environ=
ment=E2=80=9D
but keep a section in the manual explaining how to switch to the new
=E2=80=9Cguix shell=E2=80=9D.

Well, let discuss all that when preparing v1.5 or v1.6.  Something as
one or two years from now. ;-)  Which i

2: <http://issues.guix.gnu.org/47097>


Cheers,
simon





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 09:23:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 05:23:31 2021
Received: from localhost ([127.0.0.1]:35683 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXKC2-0002y4-Vy
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 05:23:31 -0400
Received: from pelzflorian.de ([5.45.111.108]:52084 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1mXKBz-0002xu-E3
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 05:23:29 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 4629836069D;
 Mon,  4 Oct 2021 11:23:26 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1633339406;
 bh=vaUW5qoqj/cNum4CLGZ6LPpMqiE8HfLRm2rgYX397Ok=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=HNSyfVKiPpZhxylce+aK+2aXcy1EgnKI7RaEba1KrZKMP3m8hogLC/nAoEL2GPnVO
 XrWgV0xCjFnvNdxkXGivw5RXeHOUdny4sPEaGRcJE/oIyostXVL3ABLVWnwYmY2B7k
 SJ+ukp3knIqx06kf7aA+Zew3L2Cq0gVKXOj2dyds=
Date: Mon, 4 Oct 2021 11:23:17 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <20211004092317.576ffl52qm2g2utr@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211002115958.rzupz4afq7elehq4@HIDDEN>
 <87sfxjzgsv.fsf_-_@HIDDEN>
 <20211002150851.7xa2wdb225dbjtpi@HIDDEN>
 <87ee91ryg1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87ee91ryg1.fsf@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon, Oct 04, 2021 at 10:22:54AM +0200, Ludovic Courtès wrote:
> "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:
> > Let’s say I have downloaded undesirable code to a file
> > /home/florian/Downloads/guix.scm and am hacking on source code in
> > /home/florian/Downloads/something/ where I run `guix shell`, but
> > /home/florian/Downloads/something/ does not in fact contain a
> > guix.scm file.  Now I’d have accidentally run the other guix.scm.
> 
> Sure, but it’s all under your control; it’s not very different from
> someone knowingly running “guix build -f guix.scm” on an untrusted file,
> is it?

What I meant is that I may wrongly expect a guix.scm file in
/home/florian/Downloads/something/, but it is not there, so things go
awry.

`guix shell` loading files by default would mean one would have to pay
attention to what one is doing, unlike `guix environment`.  For
example, not save unrelated (not even malicious) code by the name
guix.scm, and not run guix commands without inspecting what they’d do.
This I don’t like.



> We have the advantage that ‘guix shell’ is a new command, so we can
> document it from the start as behaving this way without arguments.

Many people don’t read manuals.

The probability of an accident is low, but it feels not robust.
I can live with either (and am very happy you and others keep
improving Guix), I just don’t think loading by default is a good idea.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 08:39:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 04:39:41 2021
Received: from localhost ([127.0.0.1]:35634 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXJVd-00088x-KL
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:39:41 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48788)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXJVc-00088m-BK
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:39:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44572)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXJVX-0004aJ-4V; Mon, 04 Oct 2021 04:39:35 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60532 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXJVW-0003Ql-SP; Mon, 04 Oct 2021 04:39:35 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: zimoun <zimon.toutoune@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN> <868rz9ffck.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 10:39:32 +0200
In-Reply-To: <868rz9ffck.fsf@HIDDEN> (zimoun's message of "Mon, 04 Oct 2021
 08:56:11 +0200")
Message-ID: <87r1d1qj3v.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

zimoun <zimon.toutoune@HIDDEN> skribis:

> On Sat, 02 Oct 2021 at 12:21, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
>
>>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98gui=
x.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>>      from the current directory or one of its ancestors.
>
> Personally, I do not like this default behaviour because explicit is
> better than implicit and in the face of ambiguity, refuse the temptation
> to guess; as any good Zen says. :-)

It should be clear from the code that I generally prefer explicit over
implicit :-), but I think Dave has a point when talking about
conventions for this kind of developer tool.

>> As for deprecation, I think there=E2=80=99s no rush.  I imagine there co=
uld be
>> several phases, like: initially we only mention deprecation in the manua=
l,
>> later on =E2=80=98guix environment=E2=80=99 starts emitting a warning, a=
nd later (I guess
>> at least two years later, probably more) we ask ourselves whether to
>> remove =E2=80=98guix environment=E2=80=99.  At this point keeping it doe=
sn=E2=80=99t cost us much.
>
> Concretely, I propose this plan:
>
>  - v1.4: mention deprecation in the manual and remove from =E2=80=9Cguix =
help=E2=80=9D
>  - v1.5: emit a warning
>  - v1.6: remove the command

Could be like this.  I guess we could also slow down the plan if we
observe that =E2=80=98guix environment=E2=80=99 sticks around longer than w=
e thought.

> Well, I do not see why the removal should be an issue, because there is
> =E2=80=9Cguix time-machine=E2=80=9D.  To me, the real issue is to let peo=
ple knowing
> such change.

As discussed in <https://issues.guix.gnu.org/38529#17>, removal is an
issue because of existing scripts but also because of learning material
around: MOOCs, articles, tutorials, etc.  These won=E2=80=99t be updated
overnight, and we owe our users stability.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 08:34:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 04:34:10 2021
Received: from localhost ([127.0.0.1]:35629 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXJQH-00081E-Vb
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:34:10 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47882)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXJQH-000813-5J
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:34:09 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44490)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXJQB-00088B-D6; Mon, 04 Oct 2021 04:34:03 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60530 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXJQA-0003Ov-CX; Mon, 04 Oct 2021 04:34:03 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Vagrant Cascadian <vagrant@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN> <871r53htdv.fsf@yucca>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 10:34:00 +0200
In-Reply-To: <871r53htdv.fsf@yucca> (Vagrant Cascadian's message of "Sat, 02
 Oct 2021 16:57:48 -0700")
Message-ID: <874k9xrxxj.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello!

Vagrant Cascadian <vagrant@HIDDEN> skribis:

> On 2021-10-02, Ludovic Court=C3=A8s wrote:

[...]

>>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98gui=
x.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>>      from the current directory or one of its ancestors.
>
> This sounds a little scary to me, just implicitly importing whatever
> happens to be lying around doesn't sound very guixy...

Right, it would be the first command that does that.

I became quite convinced that conventions and, thus, implicit arguments
can occasionally improve usability.  We use tools that operate this way
daily: =E2=80=98make=E2=80=99, =E2=80=98git=E2=80=99, etc.  Dave nicely arg=
ued about it:

  https://lists.gnu.org/archive/html/guix-devel/2017-08/msg00300.html

But yeah, it is a departure from what we=E2=80=99ve done so far, so we shou=
ld
take the time to think through it.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 08:23:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 04:23:14 2021
Received: from localhost ([127.0.0.1]:35583 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXJFa-0007gq-U9
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:23:14 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45922)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXJFW-0007fy-9i
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:23:06 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44350)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXJFQ-00028b-P8; Mon, 04 Oct 2021 04:22:56 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60528 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXJFQ-0003Zi-FT; Mon, 04 Oct 2021 04:22:56 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211002115958.rzupz4afq7elehq4@HIDDEN>
 <87sfxjzgsv.fsf_-_@HIDDEN>
 <20211002150851.7xa2wdb225dbjtpi@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 10:22:54 +0200
In-Reply-To: <20211002150851.7xa2wdb225dbjtpi@HIDDEN>
 (pelzflorian@HIDDEN's message of "Sat, 2 Oct 2021 17:08:51
 +0200")
Message-ID: <87ee91ryg1.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:

> On Sat, Oct 02, 2021 at 03:40:00PM +0200, Ludovic Court=C3=A8s wrote:
>> "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:
>> > On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Court=C3=A8s wrote:
>> >> 2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98gu=
ix.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>> >>    from the current directory or one of its ancestors.
>> > This however is concerning.  Users will not expect guix to execute
>> > arbitrary code.  Maybe print a suggestion to maybe --file the file
>> > instead.
>> I think it=E2=80=99s fine as long as, as in the case of =E2=80=98haunt b=
uild=E2=80=99 or =E2=80=98make=E2=80=99
>> or =E2=80=98git=E2=80=99, it=E2=80=99s properly documented.  Also, =E2=
=80=98guix shell=E2=80=99 unconditionally
>> writes a message.
>
> Let=E2=80=99s say I have downloaded undesirable code to a file
> /home/florian/Downloads/guix.scm and am hacking on source code in
> /home/florian/Downloads/something/ where I run `guix shell`, but
> /home/florian/Downloads/something/ does not in fact contain a
> guix.scm file.  Now I=E2=80=99d have accidentally run the other guix.scm.

Sure, but it=E2=80=99s all under your control; it=E2=80=99s not very differ=
ent from
someone knowingly running =E2=80=9Cguix build -f guix.scm=E2=80=9D on an un=
trusted file,
is it?

> Also `make` is typically used without arguments, but a novice `guix
> shell` user might know `guix shell program-a program-b` but is
> surprised when running `guix shell` without arguments in an untrusted
> directory.

We have the advantage that =E2=80=98guix shell=E2=80=99 is a new command, s=
o we can
document it from the start as behaving this way without arguments.

WDYT?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 08:20:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 04:20:06 2021
Received: from localhost ([127.0.0.1]:35575 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXJCX-0007ap-GO
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:20:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45276)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXJCV-0007ab-CG
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:19:56 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44292)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXJCP-0006gF-8i; Mon, 04 Oct 2021 04:19:49 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60526 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXJCJ-0003H1-De; Mon, 04 Oct 2021 04:19:49 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
 <87ilyfy0q4.fsf@HIDDEN>
 <d169e493187d1de26c09dd1503e55cb5db982384.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 10:19:41 +0200
In-Reply-To: <d169e493187d1de26c09dd1503e55cb5db982384.camel@HIDDEN>
 (Maxime Devos's message of "Sat, 02 Oct 2021 16:47:20 +0200")
Message-ID: <87lf39ryle.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Maxime Devos <maximedevos@HIDDEN> skribis:

> Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:12 [+0200]:
> [reordered]
>> > So I think the cache should also check if these dependencies have been=
 modified.
>> > To keep track of the dependencies, something like the =E2=80=98compile=
-all,compile:
>> > Keep track of dependencies of compiled modules.=E2=80=99 patch from
>> > <https://issues.guix.gnu.org/50384> could be used, though the 'include=
', 'load',
>> > 'include-from-path' and maybe 'use-modules' (if something like "guix s=
hell -Lextra-modules-directory ..."
>> > is done) macros would need to be replaced.
>>=20
>> Problem is that any attempt to keep track of dependencies is always an
>> approximation because macros can do anything=E2=80=94I can have my own m=
acro
>> that reads files at expansion time.  So I=E2=80=99m inclined to not even=
 try.
>
> I expect most people use 'include', 'load', 'include-from-path' or 'load-=
from-path'
> instead of writing their own macro reading files at expansion time, and i=
f they do
> write their own macro, I expect it would be implemented in terms of the f=
ormer anyway,
> so I expect replacing these macros and 'use-modules' to be sufficient, es=
pecially
> if the flag proposed below is available as =E2=80=98escape hatch=E2=80=99=
 for when the dependency
> tracking is insufficient.
>
> This is not merely an expansion-time problem, files loaded at 'load' or '=
eval' time
> are important as well.  E.g., consider the case where the manifest is som=
ething like
>
>   (list
>     (package
>       (inherit stuff)
>       (source (local-file "stuff" #:recursive? #t)))
>     other-packages ...)

In a =E2=80=98guix.scm=E2=80=99 file, =E2=80=98source=E2=80=99 doesn=E2=80=
=99t matter.  It does matter in a
manifest, but that sounds a bit less common.

> then all files inside 'stuff' are important as well.  I don't see how dep=
endencies
> could be tracked here without an excessive amount of 'stat' calls, maybe =
guix should
> ignore these dependencies (possibly with a warning, and a reference to th=
e manual
> documenting which dependencies are tracked and which are not?).=20

[...]

> A documented flag to always consider the cache stale seems good, though I=
 think
> at least the dependencies made with the common macros and procedures 'inc=
lude',
> 'load', 'include-from-path', 'load-from-path', 'use-modules' and non-recu=
rsive
> 'local-file' could be tracked, though this could be left as a TODO for la=
ter
> I suppose.

Tracking those uses reliably is impossible: there could be same-named
bindings that do other things, there could be custom macros, there could
be =E2=80=9Cdynamic arguments=E2=80=9D (whose value is not known statically=
), etc.  You
have to expand + evaluate the code to get better results, and even then,
there might be different paths in the code so you can=E2=80=99t be sure you=
 got
it right.

We could get an approximation for common uses by recognizing special
forms as you suggest.  But it=E2=80=99s just that, an approximation.

In such situations, I err on the side of not even trying.  The added
complexity for a flaky result doesn=E2=80=99t pay off to me.  I prefer to be
upfront, document limitations, and let users handle them as they see
fit.

WDYT?

A similar problem occurs with system provenance tracking, which saves
=E2=80=98configuration.scm=E2=80=99 but leaves it up to the user to preserv=
e additional
files if needed (info "(guix) Service Reference").

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 08:09:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 04:09:06 2021
Received: from localhost ([127.0.0.1]:35563 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXJ22-0007Ku-4r
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:09:06 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43526)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXJ20-0007KR-Cl
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:09:04 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43824)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXJ1u-0006W4-TD; Mon, 04 Oct 2021 04:08:58 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60524 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXJ1t-0002PF-8t; Mon, 04 Oct 2021 04:08:58 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <6c199526d88150c31461e3b7f9e76909217e658c.camel@HIDDEN>
 <87ee93y0n9.fsf@HIDDEN>
 <7c07bacb08ead4ee3f36b7ff034d3eff82a814ab.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 10:08:55 +0200
In-Reply-To: <7c07bacb08ead4ee3f36b7ff034d3eff82a814ab.camel@HIDDEN>
 (Maxime Devos's message of "Sat, 02 Oct 2021 16:22:42 +0200")
Message-ID: <877dettdns.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maxime Devos <maximedevos@HIDDEN> skribis:

> Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:14 [+0200]:
>> > Why only use the 'basename' of a file name instead of the full name?
>> > (Consider the case where a user has multiple "guix.scm" or "manifest.s=
cm".)
>> > This turns out to be unproblematic, because stat:dev and stat:ino is i=
ncluded
>> > as well, though including (a part of) the file name is superfluous bec=
ause
>> > stat:dev and stat:ino are included.
>> >=20
>> > Could you document the rationale for including the file name, and why =
only
>> > the basename is included instead of the full file name?
>>=20
>> Actually it=E2=80=99s probably not useful to include the file (base)name=
.  I
>> think initially I thought about distinguishing between guix.scm and
>> manifest.scm, since they return different kinds of objects, but dev/ino
>> is probably enough.  WDYT?
>
> Looking at https://lwn.net/Articles/866582/, it appears when BTRFS and NF=
S are
> combined, it is possible for two dev/ino pairs to be the same for differe=
nt files.
> It appears to be considered a bug but non-trivial to fix.  Thus, dev/ino =
apparently
> is not always sufficient, so it may be reasonable to include the file nam=
e.
>
> I would include the full file name, because the basename is often rather =
generic
> ("guix.scm", "manifest.scm"), though this depends on the habits of the us=
er.

OK, that makes sense to me, let=E2=80=99s do that.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 08:07:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 04:07:59 2021
Received: from localhost ([127.0.0.1]:35559 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXJ0w-0007Is-PG
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:07:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mXJ0v-0007If-7s
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 04:07:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43816)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mXJ0o-0005fe-QX; Mon, 04 Oct 2021 04:07:50 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60520 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1mXJ0o-0002La-Hl; Mon, 04 Oct 2021 04:07:50 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 04/10] DRAFT shell: By default load the
 local 'guix.scm' or 'manifest.scm' file.
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
 <80360a349abc0eb00a8645fe3e7b5f8008f33ec8.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 13 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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: Mon, 04 Oct 2021 10:07:48 +0200
In-Reply-To: <80360a349abc0eb00a8645fe3e7b5f8008f33ec8.camel@HIDDEN>
 (Maxime Devos's message of "Sat, 02 Oct 2021 16:15:21 +0200")
Message-ID: <87bl45tdpn.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Maxime,

Maxime Devos <maximedevos@HIDDEN> skribis:

> Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
>> +(define (find-file-in-parent-directories candidates)
>> +  "Find one of CANDIDATES in the current directory or one of its ancest=
ors."
>> +  (let loop ((directory (getcwd)))
>> +    (and (=3D (stat:uid (stat directory)) (getuid))
>> +         (or (any (lambda (candidate)
>> +                    (let ((candidate (string-append directory "/" candi=
date)))
>> +                      (and (file-exists? candidate) candidate)))
>> +                  candidates)
>> +             (loop (string-append directory "/..")))))) ;Unix ".." reso=
lution
>
> I do not recommend this.  What would happen if someone creates a temporar=
y directory
> "/tmp/stuff" do things in to throw away later (setting permissions approp=
riately),
> tries to create a guix.scm in that directory but misspells it as, say, gu=
ix.sm, and runs
> "guix shell" from within /tmp/stuff?  Then find-file-in-parent-directorie=
s would
> load /tmp/guix.scm (possibly created by a local attacker, assuming a mult=
i-user system),
> -- if it weren't for the (=3D (stat:uid (stat directory)) (getuid)).
>
> Because of the (=3D (stat:uid ...) (getuid)), this attack method is not p=
ossible.

Right.  :-)

In libgit2, =E2=80=98find_repo=E2=80=99 (called by =E2=80=98git_repository_=
discover=E2=80=99) stops at
device boundaries, which is wise.  But it doesn=E2=80=99t stop when the par=
ent
has a different owner (!).

Unlike the code above, it does lexical =E2=80=9C..=E2=80=9D resolution afte=
r first
calling realpath(3) on the directory name; not sure what to think about
this.  (The code of Git itself is harder to read for me.)

> However, it causes other issues.  Now it isn't possible for two users (th=
at trust
> each other), to set up a directory writable by both (e.g. with ACLs, or b=
y making
> the directory group-writable and placing the two users in the same group)=
, for
> working together, with a guix.scm usable by both.
>
> These can be two users on the same machine, or remotely via something lik=
e NFS,
> or a single person having multiple user accounts used for different purpo=
ses.

Well, sure, but that=E2=80=99s a very uncommon scenario, isn=E2=80=99t it?

I was actually hesitant about this find-in-parent behavior.  I find it
convenient that =E2=80=98git=E2=80=99 does that, for instance, so I thought=
 it might be
nice as well.

Thoughts?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 4 Oct 2021 06:57:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Oct 04 02:57:15 2021
Received: from localhost ([127.0.0.1]:35466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXHuV-0005W3-Fm
	for submit <at> debbugs.gnu.org; Mon, 04 Oct 2021 02:57:15 -0400
Received: from mail-wr1-f49.google.com ([209.85.221.49]:35557)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1mXHuQ-0005Vk-2b
 for 50960 <at> debbugs.gnu.org; Mon, 04 Oct 2021 02:57:14 -0400
Received: by mail-wr1-f49.google.com with SMTP id v25so18192631wra.2
 for <50960 <at> debbugs.gnu.org>; Sun, 03 Oct 2021 23:57:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:in-reply-to:references:date:message-id
 :mime-version:content-transfer-encoding;
 bh=Dpl/TYINRvLdH81mx3rPlh+7/UVaprDSv2QfQh6N6Mw=;
 b=NISUxuefwOXNS3VX7l6cUAYs+hcqwuOmtvTdxmk2pK+GXz3SvXYua8uba+WtuGhACg
 61dWimtQT5I2ivcbOPPTTqc+YbaxnfeZzR8zsReZXUNkfLAGqlFg4vxNmrIymF2jv0xi
 /Jpkm7i2wrSdDZAdh1rx/svRcU9ax3yT7mjHx3APbbb+Nl2yKtvUgfNtcfiuk+V2aUcn
 A7XNok732dXWk5nir9kmBq2mtFNBrdF1/rpVwN4h/QPNJW4Jr18ZoQ4FBO9GdzSpVNBD
 IHhlHhrP99J6WM288EltcbwXb8r5f4JqER1ZK/GT23BK3B3NMmrynqqCihyYiGcMiB23
 hXwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=Dpl/TYINRvLdH81mx3rPlh+7/UVaprDSv2QfQh6N6Mw=;
 b=1slgFN2LHjEcSSYLQpgnDb04aWIrDYsk16cOdUaOSfb9fcdzhYjpqpcrfcR4H1/9yv
 Ydmujsl35mNSD0mUpWVyAx4sWTj6Q2KajazSdLnxUv6hyZDoQjuD6Ah8K3I/p/Puzoyg
 qKlWJQjhUNtVgMEGmmi50lSlzchJgvf3luOqZKkbAAzhjqMscFPhOYnzhAhzaoDPA46A
 4e+emhyBjRoOKhNtqnZgFo9BogVx51AvHu9fWxkNdoSarFF4iyCES5EEEqse4SUh3KuS
 4ZWebetBzBY4LWC81sI+y2CCPDYnb7gBQk3XksT2AbbpDA5fnTyuCIhckDiOwDgR5XzL
 ugpw==
X-Gm-Message-State: AOAM531eyfqA0Ji9SI/WtejjW5wmoavbE45rRQUTzP1Oa8b8yOjI0ShG
 hA+p2vhitIXev7dzhBZC1AE=
X-Google-Smtp-Source: ABdhPJwU0j+DchvcO64hChM+6qy5c14k++WfIARJwSKUxYA1pcqTM7HojtH9dssaNfVaiYdqx+SSeA==
X-Received: by 2002:adf:ae1a:: with SMTP id x26mr676928wrc.30.1633330623479;
 Sun, 03 Oct 2021 23:57:03 -0700 (PDT)
Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e])
 by smtp.gmail.com with ESMTPSA id h15sm5008122wrt.0.2021.10.03.23.57.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 03 Oct 2021 23:57:03 -0700 (PDT)
From: zimoun <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
Date: Mon, 04 Oct 2021 08:56:11 +0200
Message-ID: <868rz9ffck.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

All looks good to me; from the surface, I have not looked at the
details.


On Sat, 02 Oct 2021 at 12:21, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:

>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.

Personally, I do not like this default behaviour because explicit is
better than implicit and in the face of ambiguity, refuse the temptation
to guess; as any good Zen says. :-)

Idem with the proposal =E2=80=99channels.scm=E2=80=99 and time-machine.


> As for deprecation, I think there=E2=80=99s no rush.  I imagine there cou=
ld be
> several phases, like: initially we only mention deprecation in the manual,
> later on =E2=80=98guix environment=E2=80=99 starts emitting a warning, an=
d later (I guess
> at least two years later, probably more) we ask ourselves whether to
> remove =E2=80=98guix environment=E2=80=99.  At this point keeping it does=
n=E2=80=99t cost us much.

Concretely, I propose this plan:

 - v1.4: mention deprecation in the manual and remove from =E2=80=9Cguix he=
lp=E2=80=9D
 - v1.5: emit a warning
 - v1.6: remove the command

Well, I do not see why the removal should be an issue, because there is
=E2=80=9Cguix time-machine=E2=80=9D.  To me, the real issue is to let peopl=
e knowing
such change.

Moreover, I am doubtful that the exact same command-line from v1.0 is
producing the same result with v1.3 for instance.  Not because of Guix
but because of the underlying packages.

For example, <http://issues.guix.gnu.org/47097>.


All the best,
simon




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 3 Oct 2021 22:50:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 03 18:50:34 2021
Received: from localhost ([127.0.0.1]:35096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mXAJV-0007cR-DZ
	for submit <at> debbugs.gnu.org; Sun, 03 Oct 2021 18:50:33 -0400
Received: from mail-io1-f44.google.com ([209.85.166.44]:38871)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cox.katherine.e@HIDDEN>) id 1mXAJP-0007c8-Qn
 for 50960 <at> debbugs.gnu.org; Sun, 03 Oct 2021 18:50:31 -0400
Received: by mail-io1-f44.google.com with SMTP id z184so4977482iof.5
 for <50960 <at> debbugs.gnu.org>; Sun, 03 Oct 2021 15:50:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=Y4f0+gFCdd5v5D3peC7FZ2nm/VOgrUmiUyrI3Z7Wxsg=;
 b=hPB/bd1DYA0Tu5ZAl0bVGUaCIvJ4HYgQHXNT4/IeGhscE/fprchVQ9zUUAzxb2nM1Q
 QiJmqCMW4ow3EzjnMhquXukTXpMUeerj1aq0tDVKax5PX8ruJFmO+pRKpB66BES0CvEG
 LIPf/qG8lQXFiycPS43e40vBGXyPVoVAHRJcuJXAAMzqz8UhAhNTuBgrQI9ezDw7pKTV
 xpVfiQoaTPbyBi36sJdSXMzgIOsEiA0rITKNNbaAHlJoxyzV3Fd1BIAfIGRvafEAEgbg
 eSNftrDOtR6nlT7BSH+VgXpAo7w6vHN9zsW+QUIxKmkiWP/w86AD6+xn5ZkQs65QcZXw
 YIxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=Y4f0+gFCdd5v5D3peC7FZ2nm/VOgrUmiUyrI3Z7Wxsg=;
 b=fHY70cndB07hfxi+F6+8XGZ5CruUwqulmgHA6F1d2WackpA1xCIeHbRbQ1J5ZIXfFv
 ex53boOuru4aysa6BBwa2nzWeMdtjrv37PY5PzJ2DopuPu0uyHk9oqFhsEfyMULvtn7F
 0WMd7dARND9+m0TULZ4Ev23iQJmVM/MJi330pjmYKSgd29ZdsWXAMG2LZLpzjGUfRvvy
 9vz0TfCkQwWtMlBgndh++3FUiILHccDsqTKvG+ZLYDo0VVK7T0pR6OQRfrh9rXai+eAO
 oNOzC/WOHqrUqlq7k4yz7MW9qYxVQfBL2bDjtfK3XPFYXMcZKsXll5ogEY3ANNLqPfN0
 v6aw==
X-Gm-Message-State: AOAM533zjC57ISZT9l6LQnR7tLIXGSnGlCRC3/eaYJusmqhFCTO73FD2
 6ucCMi/t9hGwTg1DfvlyV47Uld6P8xmSGA==
X-Google-Smtp-Source: ABdhPJyFdpYlOHBjPt6c+bcNqXZ9l1AB0YPPGlNcEu4msT96JKiFkHB4cA/PJJdf71Z0RXY9vz4ECQ==
X-Received: by 2002:a6b:fe18:: with SMTP id x24mr7172077ioh.119.1633301422190; 
 Sun, 03 Oct 2021 15:50:22 -0700 (PDT)
Received: from washu-v4 (172-221-246-205.res.spectrum.com. [172.221.246.205])
 by smtp.gmail.com with ESMTPSA id
 x8sm5246945ilq.62.2021.10.03.15.50.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 03 Oct 2021 15:50:21 -0700 (PDT)
From: Katherine Cox-Buday <cox.katherine.e@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] =?utf-8?B?4oCYZ3VpeCBzaGVsbOKAmQ==?= shebangs
References: <20211002102116.27726-1-ludo@HIDDEN> <87zgrry1at.fsf@HIDDEN>
Date: Sun, 03 Oct 2021 17:50:19 -0500
In-Reply-To: <87zgrry1at.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
 =?utf-8?Q?s?= message of "Sat, 02 Oct 2021 16:00:10 +0200")
Message-ID: <87k0itbu50.fsf@HIDDEN>
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-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Oh, I had another goal in mind, which was to make it easy to use =E2=80=
=98guix
> shell=E2=80=99 in shebangs.
>
> Problem is, since it=E2=80=99s called =E2=80=98guix shell=E2=80=99 and no=
t =E2=80=98guix-shell=E2=80=99, we have
> to use =E2=80=98/usr/bin/env -S=E2=80=99 anyway as the shebang so it spli=
ts arguments.
> And with =E2=80=98-S=E2=80=99, we can already do pretty much everything w=
e want.  Here=E2=80=99s
> a shell script:
>
> --8<---------------cut here---------------start------------->8---
> $ cat t.sh
> #!/usr/bin/env -S guix shell hello bash -- sh
> type -P hello
> hello
> --8<---------------cut here---------------end--------------->8---

I was already very excited about this patch series, and now I see this!

I wanted to point out that I don't think Guix's shebang substitution phases=
 know how to deal with ~env -S~, and I wish they would (I recently ran into=
 this). I can't really think of any use-cases for a Guix package which when=
 built contains a ~guix shell~ script, but I wanted to raise the possibilit=
y in case someone else can.

--=20
Katherine




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 3 Oct 2021 08:36:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Oct 03 04:36:50 2021
Received: from localhost ([127.0.0.1]:60968 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWwzK-0007XG-Hd
	for submit <at> debbugs.gnu.org; Sun, 03 Oct 2021 04:36:50 -0400
Received: from mail-ed1-f48.google.com ([209.85.208.48]:39861)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <anothersms@HIDDEN>) id 1mWwzI-0007Wo-Ej
 for 50960 <at> debbugs.gnu.org; Sun, 03 Oct 2021 04:36:49 -0400
Received: by mail-ed1-f48.google.com with SMTP id x7so50802697edd.6
 for <50960 <at> debbugs.gnu.org>; Sun, 03 Oct 2021 01:36:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=from:to:subject:in-reply-to:references:date:message-id:mime-version
 :content-transfer-encoding;
 bh=03LroDvrvFfshWJtbxlILIJbOcUEgEeP9wTevp7uFKo=;
 b=T61PnS4H36mC8HPIWhsR6v/QWhtWK12ejQm2YROtyne1piUT0ONHqKVjVE+Kw/acrq
 qDUzg9W08/D3swhs9xSgzbDWxxPm4Abov8kV6XeZdGn5vzfB4EA8GjEbkKNrtRKSP56/
 lqVT+H7rhytikgA34rxsbjyxBfzO9MczMg3CXZLQNWHdoKscIvOXwkrP1lRYy0yLpN5f
 VHUMxDp4Tg9ec+jDJPGEUY1vohBLvOq/5cJV+zKrwPgLtTUQddJdH7QncHqKS2577Edh
 6Y4/UcRUCvZaA0p6xbSf/eKsjhlApkPiy9gxcuLo9qBl3FR+ujwtqGK7u9r90/8MF2dL
 lyNw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:subject:in-reply-to:references:date
 :message-id:mime-version:content-transfer-encoding;
 bh=03LroDvrvFfshWJtbxlILIJbOcUEgEeP9wTevp7uFKo=;
 b=GQ/4GpPe7T2Q/albDz2xBKgjETDueRMhLPIN/cdUc9SYmrt5aOv8NC7foQFlkQz8jV
 R8MBx4sr2xAckE6ayKOPmJtNe+YUTu/e7GytQbbYADJmAJWAn1lCTeqE3/42nswTBStL
 LaplIOsaiDpMKdBqXTreUugQb4/TFa1ODGDMHVXLKERm3T5FZEuDB5HVuKtmbblGHHg3
 ZKEy9sMKrnqsO2s66nc32PEjCvvQGx0ICgCAm35TSPOOELWvLkgyf9LrNRfAm0L9qn5Z
 be1QOtQchCnUuMwxAjBcONJwYaQy1VOPN7yNMYxBR8baPO0WHiROVyhIm0jiI15DLSMH
 j0Ag==
X-Gm-Message-State: AOAM532MKT6e+jFUAhdnAoFH73SfJxcmiXOV9Lm/AJrDo/So3iUcGwoY
 xzxJnENyiX9DkItfXTfJpEk=
X-Google-Smtp-Source: ABdhPJxIXdvL+4Rc4btdaQvyxbDrY0G+dIp3JwF3J81+JRSl7SfKgoC7zPJpG/+BabkY7O4IJ86cyQ==
X-Received: by 2002:a17:907:7755:: with SMTP id
 kx21mr9145518ejc.463.1633250202275; 
 Sun, 03 Oct 2021 01:36:42 -0700 (PDT)
Received: from localhost (host-79-16-165-197.retail.telecomitalia.it.
 [79.16.165.197])
 by smtp.gmail.com with ESMTPSA id bj10sm4981857ejb.17.2021.10.03.01.36.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 03 Oct 2021 01:36:41 -0700 (PDT)
From: =?utf-8?Q?Nicol=C3=B2?= Balzarotti <anothersms@HIDDEN>
To: Vagrant Cascadian <vagrant@HIDDEN>, Ludovic =?utf-8?Q?Court=C3=A8s?=
 <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
In-Reply-To: <871r53htdv.fsf@yucca>
References: <20211002102116.27726-1-ludo@HIDDEN> <871r53htdv.fsf@yucca>
Date: Sun, 03 Oct 2021 10:36:40 +0200
Message-ID: <87zgrqijxj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi!

Vagrant Cascadian <vagrant@HIDDEN> writes:

> On 2021-10-02, Ludovic Court=C3=A8s wrote:
>> Here comes =E2=80=98guix shell=E2=80=99, a proposed replacement for =E2=
=80=98guix environment=E2=80=99!
>
> Yay!
>
>> =E2=80=98guix environment=E2=80=99 would stay around though, at least fo=
r some time,
>> probably for a long time.
>>
>> The differences to =E2=80=98guix environment=E2=80=99 are:
> ...
>>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98gui=
x.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>>      from the current directory or one of its ancestors.
>
> This sounds a little scary to me, just implicitly importing whatever
> happens to be lying around doesn't sound very guixy...
> [...]

What about doing something like what direnv[fn:1] does?

Quoting the website:
"direnv checks for the existence of a .envrc file in the current and
parent directories. If the file exists (and is authorized), it is loaded
into a bash sub-shell and all exported variables are then captured by
direnv and then made available to the current shell."

The difference between direnv and the current approach is that if the
file has never been "authorized", before it being imported you need to
run a command (direnv allow) to authorize it.  There's the
~/.config/direnv/allow dir which stores files named with the hash of the
content of the config, and whose content is just the path of the file
(don't know why this is needed).

This allows for automatic environment ({manifest,guix}.scm) file
selection AND a it's a bit more secure (it won't run arbitrary code
residing anywhere in the directory structure).

Except for this, I'd love to see guix shell merged, it will be a major
improvement over guix environment for my use cases.


Thanks!
Nicol=C3=B2

[fn:1] direnv.net




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 23:58:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 19:58:00 2021
Received: from localhost ([127.0.0.1]:60786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWotE-0002Dx-PS
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 19:58:00 -0400
Received: from cascadia.aikidev.net ([173.255.214.101]:60402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vagrant@HIDDEN>) id 1mWotC-0002Dj-A2
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 19:57:58 -0400
Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100b])
 (Authenticated sender: vagrant@HIDDEN)
 by cascadia.aikidev.net (Postfix) with ESMTPSA id 1909B1AA2C;
 Sat,  2 Oct 2021 16:57:52 -0700 (PDT)
From: Vagrant Cascadian <vagrant@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
Date: Sat, 02 Oct 2021 16:57:48 -0700
Message-ID: <871r53htdv.fsf@yucca>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 2021-10-02, Ludovic Court=C3=A8s wrote:
> Here comes =E2=80=98guix shell=E2=80=99, a proposed replacement for =E2=
=80=98guix environment=E2=80=99!

Yay!

> =E2=80=98guix environment=E2=80=99 would stay around though, at least for=
 some time,
> probably for a long time.
>
> The differences to =E2=80=98guix environment=E2=80=99 are:
...
>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.

This sounds a little scary to me, just implicitly importing whatever
happens to be lying around doesn't sound very guixy...

Wouldn't it be better to:

  guix shell guix.scm

or

  guix shell ./guix.scm

or

  guix shell --some-argument guix.scm


Or maybe I'm not understanding the idea all that well...


live well,
  vagrant

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYVjx/QAKCRDcUY/If5cW
qkqbAP4ztPWcB+iWaF4iGBwCG6KT26xZORGVFLuLSq3AKd6FBgD+JpB/6mlgkmLz
6eSG3kP4InjWlUdSL0908jVO6zz2xgs=
=a9aj
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 15:40:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 11:40:38 2021
Received: from localhost ([127.0.0.1]:60331 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWh7q-0006eD-5Y
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 11:40:38 -0400
Received: from dustycloud.org ([50.116.34.160]:58046)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cwebber@HIDDEN>) id 1mWh7o-0006e6-SE
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 11:40:33 -0400
Received: from twig (localhost [127.0.0.1])
 by dustycloud.org (Postfix) with ESMTPS id 06C562663C;
 Sat,  2 Oct 2021 11:40:31 -0400 (EDT)
References: <20211002102116.27726-1-ludo@HIDDEN>
User-agent: mu4e 1.6.6; emacs 27.2
From: Christine Lemmer-Webber <cwebber@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Date: Sat, 02 Oct 2021 09:03:34 -0400
In-reply-to: <20211002102116.27726-1-ludo@HIDDEN>
Message-ID: <87k0iv37eu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org, guix-patches@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hello Guix!
>
> Here comes =E2=80=98guix shell=E2=80=99, a proposed replacement for =E2=
=80=98guix environment=E2=80=99!
> =E2=80=98guix environment=E2=80=99 would stay around though, at least for=
 some time,
> probably for a long time.
>
> The differences to =E2=80=98guix environment=E2=80=99 are:
>
>   1. =E2=80=98--ad-hoc=E2=80=99 is the default.
>
>        =E2=80=98guix shell hello=E2=80=99 =E2=89=8D =E2=80=98guix environ=
ment --ad-hoc hello=E2=80=99
>        =E2=80=98guix shell -D hello git=E2=80=99 =E2=89=8D =E2=80=98guix =
environment hello --ad-hoc git=E2=80=99
>
>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.
>
>   3. =E2=80=98--load=E2=80=99/=E2=80=98-l=E2=80=99 is not =E2=80=98-f=E2=
=80=99/=E2=80=98--install-from-file=E2=80=99 for consistency with
>      =E2=80=98guix package=E2=80=99.
>
>   4. =E2=80=98guix shell=E2=80=99 without arguments maintains a cache, su=
ch that, the
>      second time you run it, it runs in ~0.1s (it does not even need to
>      connect to the daemon).
>
>      If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix s=
hell=E2=80=99, it recomputes
>      the environment, as is currently the case with =E2=80=98guix environ=
ment=E2=80=99.
>
> Here=E2=80=99s a summary of previous proposals:
>
>   - Dave Thompson: https://lists.gnu.org/archive/html/guix-devel/2017-08/=
msg00300.html
>     - [X] --ad-hoc is the default
>     - [X] caching
>     - [X] behavior with no arguments
>     - [ ] --load accepts <environment>
>     - [ ] Shepherd services
>     - [ ] 'guix environment --update' to explicitly update
>   - make --ad-hoc the default: https://issues.guix.gnu.org/38529
>     - [X] https://issues.guix.gnu.org/38529#17: proposal for a new subcom=
mand
>           deprecation of =E2=80=98guix environment=E2=80=99
>
> I think <environment> records and Shepherd services could come later.
> As for =E2=80=98--update=E2=80=99, I prefer the behavior implemented here=
 because it=E2=80=99s
> stateless and thus more predictable.
>
> Thoughts?  Are there other changes people would like to see?
>
> If there=E2=80=99s rough consensus I can work on v2 with documentation.  =
Please
> let=E2=80=99s keep the discussion focused.  :-)

You have my massive thumbs up.  Exciting stuff.

> As for deprecation, I think there=E2=80=99s no rush.  I imagine there cou=
ld be
> several phases, like: initially we only mention deprecation in the manual,
> later on =E2=80=98guix environment=E2=80=99 starts emitting a warning, an=
d later (I guess
> at least two years later, probably more) we ask ourselves whether to
> remove =E2=80=98guix environment=E2=80=99.  At this point keeping it does=
n=E2=80=99t cost us much.
>
> Thanks,
> Ludo=E2=80=99.
>
> Ludovic Court=C3=A8s (10):
>   packages: Add 'package-development-inputs'.
>   profiles: Add 'package->development-manifest'.
>   DRAFT Add 'guix shell'.
>   DRAFT shell: By default load the local 'guix.scm' or 'manifest.scm'
>     file.
>   environment: Add tests for '--profile'.
>   environment: Skip derivation computation when '--profile' is used.
>   environment: Do not connect to the daemon when '--profile' is used.
>   environment: Autoload some modules.
>   cache: Gracefully handle non-existent cache.
>   shell: Maintain a profile cache.
>
>  Makefile.am                         |   2 +
>  doc/guix.texi                       |  52 ++++++
>  guix/cache.scm                      |  10 +-
>  guix/packages.scm                   |  10 ++
>  guix/profiles.scm                   |  19 ++
>  guix/scripts/environment.scm        | 260 +++++++++++++++-------------
>  guix/scripts/shell.scm              | 254 +++++++++++++++++++++++++++
>  po/guix/POTFILES.in                 |   1 +
>  tests/guix-environment-container.sh |   8 +
>  tests/guix-environment.sh           |   7 +
>  tests/guix-shell.sh                 |  70 ++++++++
>  tests/packages.scm                  |  14 ++
>  tests/profiles.scm                  |   7 +
>  13 files changed, 594 insertions(+), 120 deletions(-)
>  create mode 100644 guix/scripts/shell.scm
>  create mode 100644 tests/guix-shell.sh





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Oct 2021 15:40:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 11:40:45 2021
Received: from localhost ([127.0.0.1]:60334 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWh7u-0006eQ-V5
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 11:40:45 -0400
Received: from lists.gnu.org ([209.51.188.17]:44608)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cwebber@HIDDEN>) id 1mWh7r-0006eG-Je
 for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 11:40:35 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58518)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <cwebber@HIDDEN>)
 id 1mWh7r-0000w2-BT
 for guix-patches@HIDDEN; Sat, 02 Oct 2021 11:40:35 -0400
Received: from dustycloud.org ([50.116.34.160]:38558)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <cwebber@HIDDEN>)
 id 1mWh7p-0001o6-I4; Sat, 02 Oct 2021 11:40:35 -0400
Received: from twig (localhost [127.0.0.1])
 by dustycloud.org (Postfix) with ESMTPS id 06C562663C;
 Sat,  2 Oct 2021 11:40:31 -0400 (EDT)
References: <20211002102116.27726-1-ludo@HIDDEN>
User-agent: mu4e 1.6.6; emacs 27.2
From: Christine Lemmer-Webber <cwebber@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Date: Sat, 02 Oct 2021 09:03:34 -0400
In-reply-to: <20211002102116.27726-1-ludo@HIDDEN>
Message-ID: <87k0iv37eu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=50.116.34.160;
 envelope-from=cwebber@HIDDEN; helo=dustycloud.org
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: 50960 <at> debbugs.gnu.org, guix-patches@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hello Guix!
>
> Here comes =E2=80=98guix shell=E2=80=99, a proposed replacement for =E2=
=80=98guix environment=E2=80=99!
> =E2=80=98guix environment=E2=80=99 would stay around though, at least for=
 some time,
> probably for a long time.
>
> The differences to =E2=80=98guix environment=E2=80=99 are:
>
>   1. =E2=80=98--ad-hoc=E2=80=99 is the default.
>
>        =E2=80=98guix shell hello=E2=80=99 =E2=89=8D =E2=80=98guix environ=
ment --ad-hoc hello=E2=80=99
>        =E2=80=98guix shell -D hello git=E2=80=99 =E2=89=8D =E2=80=98guix =
environment hello --ad-hoc git=E2=80=99
>
>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.
>
>   3. =E2=80=98--load=E2=80=99/=E2=80=98-l=E2=80=99 is not =E2=80=98-f=E2=
=80=99/=E2=80=98--install-from-file=E2=80=99 for consistency with
>      =E2=80=98guix package=E2=80=99.
>
>   4. =E2=80=98guix shell=E2=80=99 without arguments maintains a cache, su=
ch that, the
>      second time you run it, it runs in ~0.1s (it does not even need to
>      connect to the daemon).
>
>      If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix s=
hell=E2=80=99, it recomputes
>      the environment, as is currently the case with =E2=80=98guix environ=
ment=E2=80=99.
>
> Here=E2=80=99s a summary of previous proposals:
>
>   - Dave Thompson: https://lists.gnu.org/archive/html/guix-devel/2017-08/=
msg00300.html
>     - [X] --ad-hoc is the default
>     - [X] caching
>     - [X] behavior with no arguments
>     - [ ] --load accepts <environment>
>     - [ ] Shepherd services
>     - [ ] 'guix environment --update' to explicitly update
>   - make --ad-hoc the default: https://issues.guix.gnu.org/38529
>     - [X] https://issues.guix.gnu.org/38529#17: proposal for a new subcom=
mand
>           deprecation of =E2=80=98guix environment=E2=80=99
>
> I think <environment> records and Shepherd services could come later.
> As for =E2=80=98--update=E2=80=99, I prefer the behavior implemented here=
 because it=E2=80=99s
> stateless and thus more predictable.
>
> Thoughts?  Are there other changes people would like to see?
>
> If there=E2=80=99s rough consensus I can work on v2 with documentation.  =
Please
> let=E2=80=99s keep the discussion focused.  :-)

You have my massive thumbs up.  Exciting stuff.

> As for deprecation, I think there=E2=80=99s no rush.  I imagine there cou=
ld be
> several phases, like: initially we only mention deprecation in the manual,
> later on =E2=80=98guix environment=E2=80=99 starts emitting a warning, an=
d later (I guess
> at least two years later, probably more) we ask ourselves whether to
> remove =E2=80=98guix environment=E2=80=99.  At this point keeping it does=
n=E2=80=99t cost us much.
>
> Thanks,
> Ludo=E2=80=99.
>
> Ludovic Court=C3=A8s (10):
>   packages: Add 'package-development-inputs'.
>   profiles: Add 'package->development-manifest'.
>   DRAFT Add 'guix shell'.
>   DRAFT shell: By default load the local 'guix.scm' or 'manifest.scm'
>     file.
>   environment: Add tests for '--profile'.
>   environment: Skip derivation computation when '--profile' is used.
>   environment: Do not connect to the daemon when '--profile' is used.
>   environment: Autoload some modules.
>   cache: Gracefully handle non-existent cache.
>   shell: Maintain a profile cache.
>
>  Makefile.am                         |   2 +
>  doc/guix.texi                       |  52 ++++++
>  guix/cache.scm                      |  10 +-
>  guix/packages.scm                   |  10 ++
>  guix/profiles.scm                   |  19 ++
>  guix/scripts/environment.scm        | 260 +++++++++++++++-------------
>  guix/scripts/shell.scm              | 254 +++++++++++++++++++++++++++
>  po/guix/POTFILES.in                 |   1 +
>  tests/guix-environment-container.sh |   8 +
>  tests/guix-environment.sh           |   7 +
>  tests/guix-shell.sh                 |  70 ++++++++
>  tests/packages.scm                  |  14 ++
>  tests/profiles.scm                  |   7 +
>  13 files changed, 594 insertions(+), 120 deletions(-)
>  create mode 100644 guix/scripts/shell.scm
>  create mode 100644 tests/guix-shell.sh





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 15:09:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 11:09:03 2021
Received: from localhost ([127.0.0.1]:60258 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWgdL-0005ne-6d
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 11:09:03 -0400
Received: from pelzflorian.de ([5.45.111.108]:49940 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1mWgdJ-0005n8-RB
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 11:09:02 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 40C1036069D;
 Sat,  2 Oct 2021 17:09:00 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1633187340;
 bh=luT0CiCSAeSZww9AS5pp+DAtidQtxbwfutT+yerzEZ0=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=KhaGe7MkIarT70PbJjjW0PgzX8UR9axk/XUvWic0qbVjo0GRbxJ3kHHTJJ998MIgj
 6osi0+2Emv7ENZwXvKMTA2pPAlbTF7VX6UY3JpGZG0/IKPoEYPABvOl6aNmVJkkKTD
 9TOdAe4mmOpw1wodQIDhLv7pQWHW/evhi7iTtW0c=
Date: Sat, 2 Oct 2021 17:08:51 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <20211002150851.7xa2wdb225dbjtpi@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211002115958.rzupz4afq7elehq4@HIDDEN>
 <87sfxjzgsv.fsf_-_@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <87sfxjzgsv.fsf_-_@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, Oct 02, 2021 at 03:40:00PM +0200, Ludovic Courtès wrote:
> "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:
> > On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Courtès wrote:
> >> 2. ‘guix shell’, without arguments, loads ‘guix.scm’ or ‘manifest.scm’
> >>    from the current directory or one of its ancestors.
> > This however is concerning.  Users will not expect guix to execute
> > arbitrary code.  Maybe print a suggestion to maybe --file the file
> > instead.
> I think it’s fine as long as, as in the case of ‘haunt build’ or ‘make’
> or ‘git’, it’s properly documented.  Also, ‘guix shell’ unconditionally
> writes a message.

Let’s say I have downloaded undesirable code to a file
/home/florian/Downloads/guix.scm and am hacking on source code in
/home/florian/Downloads/something/ where I run `guix shell`, but
/home/florian/Downloads/something/ does not in fact contain a
guix.scm file.  Now I’d have accidentally run the other guix.scm.

Also `make` is typically used without arguments, but a novice `guix
shell` user might know `guix shell program-a program-b` but is
surprised when running `guix shell` without arguments in an untrusted
directory.

But yes, git hooks are dangerous too.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:47:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 10:47:30 2021
Received: from localhost ([127.0.0.1]:60205 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWgIU-00054h-3o
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:47:30 -0400
Received: from baptiste.telenet-ops.be ([195.130.132.51]:59208)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mWgIR-00054B-OY
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:47:28 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by baptiste.telenet-ops.be with bizsmtp
 id 12nR2600F0mfAB4012nRb3; Sat, 02 Oct 2021 16:47:26 +0200
Message-ID: <d169e493187d1de26c09dd1503e55cb5db982384.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Date: Sat, 02 Oct 2021 16:47:20 +0200
In-Reply-To: <87ilyfy0q4.fsf@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
 <87ilyfy0q4.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-VXvvPoJ3pi1mJOlysSMZ"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633186046; bh=UwL2SW5ygJmVbrIgs7F40UAV9B4p7ZQVspYjpR+h3QA=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=k2q0ImimdaxWF+vsSgdhTRujboSKYfGF9AxfsCAaKQzwCpaCzGkVY4bM5+a4Vu0sO
 11STxQ/j/p+900gSbP2cqHNDUyavao6z/QJn8X5i5Yt6XMyIGMqmveeGk+t//XA7pi
 6NZfu3UEXQfbzgDkkol+88ToqKr08G1+JRAMSdLButx4FQZFFe8R3r65hh3um2Ct/1
 U1YvjfbVHCsP41YctmNg+sYy6P99U5fcrLt4RYBOpgTk4RbNf89Yhz93z0wB3LWJRZ
 2zzZqyH5uqZL4v/azRrT9RIgJwupuMQpahiYtACXsogEQ7o9mdyhMQiR9BaMjL/9Yi
 bOSOMk4bNe+jg==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-VXvvPoJ3pi1mJOlysSMZ
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:12 [+0200]:
[reordered]
> > So I think the cache should also check if these dependencies have been =
modified.
> > To keep track of the dependencies, something like the =E2=80=98compile-=
all,compile:
> > Keep track of dependencies of compiled modules.=E2=80=99 patch from
> > <https://issues.guix.gnu.org/50384> could be used, though the 'include'=
, 'load',
> > 'include-from-path' and maybe 'use-modules' (if something like "guix sh=
ell -Lextra-modules-directory ..."
> > is done) macros would need to be replaced.
>=20
> Problem is that any attempt to keep track of dependencies is always an
> approximation because macros can do anything=E2=80=94I can have my own ma=
cro
> that reads files at expansion time.  So I=E2=80=99m inclined to not even =
try.

I expect most people use 'include', 'load', 'include-from-path' or 'load-fr=
om-path'
instead of writing their own macro reading files at expansion time, and if =
they do
write their own macro, I expect it would be implemented in terms of the for=
mer anyway,
so I expect replacing these macros and 'use-modules' to be sufficient, espe=
cially
if the flag proposed below is available as =E2=80=98escape hatch=E2=80=99 f=
or when the dependency
tracking is insufficient.

This is not merely an expansion-time problem, files loaded at 'load' or 'ev=
al' time
are important as well.  E.g., consider the case where the manifest is somet=
hing like

  (list
    (package
      (inherit stuff)
      (source (local-file "stuff" #:recursive? #t)))
    other-packages ...)

then all files inside 'stuff' are important as well.  I don't see how depen=
dencies
could be tracked here without an excessive amount of 'stat' calls, maybe gu=
ix should
ignore these dependencies (possibly with a warning, and a reference to the =
manual
documenting which dependencies are tracked and which are not?).=20

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:12 [+0200]:
> I=E2=80=99m not sure how to address it.  We=E2=80=99d need a cache key th=
at=E2=80=99s more
> precise than inode/mtime, yet cheap to compute.

The mtime of the file and the mtime of every dependency (ignoring modules f=
rom
Guile, Guix and channels to reduce the number of calls to 'stat').=20

> Perhaps we need to live with that limitation, document it, and provide a
> flag to force a rebuild?

A documented flag to always consider the cache stale seems good, though I t=
hink
at least the dependencies made with the common macros and procedures 'inclu=
de',
'load', 'include-from-path', 'load-from-path', 'use-modules' and non-recurs=
ive
'local-file' could be tracked, though this could be left as a TODO for late=
r
I suppose.

Greetings,
Maxime.

--=-VXvvPoJ3pi1mJOlysSMZ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhw+BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7q74AP4r7cPOVy4SvOcyF2gpDs/kVWL0
J/RNunvEiCSBtLoTNgD+IbIxStM2PdCQH2WbA9iN27BJ9cfJ3dHkzrDPuYG4/wk=
=nG4D
-----END PGP SIGNATURE-----

--=-VXvvPoJ3pi1mJOlysSMZ--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:22:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 10:22:47 2021
Received: from localhost ([127.0.0.1]:60180 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfuZ-0004ME-Cj
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:22:47 -0400
Received: from albert.telenet-ops.be ([195.130.137.90]:39356)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mWfuW-0004M3-Nj
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:22:45 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by albert.telenet-ops.be with bizsmtp
 id 12Ni260090mfAB4062NiEN; Sat, 02 Oct 2021 16:22:43 +0200
Message-ID: <7c07bacb08ead4ee3f36b7ff034d3eff82a814ab.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>
Date: Sat, 02 Oct 2021 16:22:42 +0200
In-Reply-To: <87ee93y0n9.fsf@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <6c199526d88150c31461e3b7f9e76909217e658c.camel@HIDDEN>
 <87ee93y0n9.fsf@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-5Q78Cene2ntdHSC8tJk3"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633184563; bh=my9/9Zew4VKRud5q7u9oxs7hf1oPjoiy/0TObI533WQ=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=W/ZoXY+K9z6ibO65RljhOz35ZyXGDZdUn8n9P20x/MTBMTs7nyM0PvoiIIgja3/OE
 5Viz7AY2cEtaGJpyeKyvnpAxgN6qwaBSI6uVl3LftxwBrGKjzEUJpljApgrsMvKNMM
 Ws6/fyYuc7BgBiV/RYiSWp6iHe4QGwoLuPAwgeftJv7rY6c8XfMXPTs5iwks82PZWR
 h0AdB8FTnUqWdWrTUPPkKbGdsCnrmyTnfFuhkKgTQkWskzdD69uw/PKqNe8hr0n58L
 vDcN5ccLI7siFiBroWlECaHgLDzHFgOaKFsNrR6poXnJ+Sr1KBy5QXpVGNH56QaqLh
 5pQrpyWqmQXeA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-5Q78Cene2ntdHSC8tJk3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 16:14 [+0200]:
> > Why only use the 'basename' of a file name instead of the full name?
> > (Consider the case where a user has multiple "guix.scm" or "manifest.sc=
m".)
> > This turns out to be unproblematic, because stat:dev and stat:ino is in=
cluded
> > as well, though including (a part of) the file name is superfluous beca=
use
> > stat:dev and stat:ino are included.
> >=20
> > Could you document the rationale for including the file name, and why o=
nly
> > the basename is included instead of the full file name?
>=20
> Actually it=E2=80=99s probably not useful to include the file (base)name.=
  I
> think initially I thought about distinguishing between guix.scm and
> manifest.scm, since they return different kinds of objects, but dev/ino
> is probably enough.  WDYT?

Looking at https://lwn.net/Articles/866582/, it appears when BTRFS and NFS =
are
combined, it is possible for two dev/ino pairs to be the same for different=
 files.
It appears to be considered a bug but non-trivial to fix.  Thus, dev/ino ap=
parently
is not always sufficient, so it may be reasonable to include the file name.

I would include the full file name, because the basename is often rather ge=
neric
("guix.scm", "manifest.scm"), though this depends on the habits of the user=
.

Greetings,
Maxime.

--=-5Q78Cene2ntdHSC8tJk3
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhrMhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nKHAQD6BCZGjPM4qeIqRrFG+WMLPnQV
PtHseP+LHLl7P3OKnQD/Q97JX9o16rY4wMSZajmE4shFgl73moiQmbT/XHJD9gc=
=rU4o
-----END PGP SIGNATURE-----

--=-5Q78Cene2ntdHSC8tJk3--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:15:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 10:15:33 2021
Received: from localhost ([127.0.0.1]:60141 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfnZ-00048f-3Y
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:15:33 -0400
Received: from xavier.telenet-ops.be ([195.130.132.52]:52424)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mWfnW-00048V-6S
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:15:31 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by xavier.telenet-ops.be with bizsmtp
 id 12FU2600P0mfAB4012FUvH; Sat, 02 Oct 2021 16:15:28 +0200
Message-ID: <80360a349abc0eb00a8645fe3e7b5f8008f33ec8.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 04/10] DRAFT shell: By default load the
 local 'guix.scm' or 'manifest.scm' file.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 02 Oct 2021 16:15:21 +0200
In-Reply-To: <20211002102240.27815-4-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-ETpBKpGpOGG12vovG6wO"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633184128; bh=MkvVs+r4JczBvz3OyueRDXwbNaT/0HhiBGaaSzWBMts=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=XGdaUDo0bC21qqyRPHFM0x3BkiNdrvWWR4OyRvGLOtZnfPXVSa7HWkH5AL7x4y8uX
 kEsU9QvtkS/7V9OkTGbex80/C5CmWfsxa2dzCO5prJoh94RbPLu1P5vVCO3YTUW47U
 cyPzP5NMfkZ1Bz4v/zI+4ueVAE+WfKGZcv/2zP/HVEwqhoBENnSPdtgDYijaosrT7G
 HHfFWH+xHM6XJ/aqJjgu2D7VtviHL1qEVaxqyAD+1qeb5YmSxUFzTsSANztU//glni
 ps4CbtY5Xag1l779kVU0kyGZlaM2Muh1b0wTomUFjjkjndWdrt3gzVLZKq/5qrEXa8
 GUI9eT4DiTCSw==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-ETpBKpGpOGG12vovG6wO
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
> +(define (find-file-in-parent-directories candidates)
> +  "Find one of CANDIDATES in the current directory or one of its ancesto=
rs."
> +  (let loop ((directory (getcwd)))
> +    (and (=3D (stat:uid (stat directory)) (getuid))
> +         (or (any (lambda (candidate)
> +                    (let ((candidate (string-append directory "/" candid=
ate)))
> +                      (and (file-exists? candidate) candidate)))
> +                  candidates)
> +             (loop (string-append directory "/..")))))) ;Unix ".." resol=
ution

I do not recommend this.  What would happen if someone creates a temporary =
directory
"/tmp/stuff" do things in to throw away later (setting permissions appropri=
ately),
tries to create a guix.scm in that directory but misspells it as, say, guix=
.sm, and runs
"guix shell" from within /tmp/stuff?  Then find-file-in-parent-directories =
would
load /tmp/guix.scm (possibly created by a local attacker, assuming a multi-=
user system),
-- if it weren't for the (=3D (stat:uid (stat directory)) (getuid)).

Because of the (=3D (stat:uid ...) (getuid)), this attack method is not pos=
sible.
However, it causes other issues.  Now it isn't possible for two users (that=
 trust
each other), to set up a directory writable by both (e.g. with ACLs, or by =
making
the directory group-writable and placing the two users in the same group), =
for
working together, with a guix.scm usable by both.

These can be two users on the same machine, or remotely via something like =
NFS,
or a single person having multiple user accounts used for different purpose=
s.

(I once created multiple user accounts on Debian: one regular purpose, one =
for reading
and games, and one for school, and made the =E2=80=98for-reading=E2=80=99 a=
nd =E2=80=98school=E2=80=99 home directory
readable by the =E2=80=98regular-purpose=E2=80=99 account.  It was occasion=
ally useful.)

Greetings,
Maxime.

--=-ETpBKpGpOGG12vovG6wO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhpehccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7h14AP4oGokYlwTAj7FIFC7JO93S/qm/
bYoetp8tXwpua6omJwEA4mbiRD/NwWir0VBFRneNqIBtnDu3yqHhHXCNtX2CewI=
=9g2s
-----END PGP SIGNATURE-----

--=-ETpBKpGpOGG12vovG6wO--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:14:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 10:14:28 2021
Received: from localhost ([127.0.0.1]:60136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfmV-00046W-Oz
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:14:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39994)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfmU-00046J-3a
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:14:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53676)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfmO-0002ZY-WC; Sat, 02 Oct 2021 10:14:21 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36482 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfmO-0004bc-Mj; Sat, 02 Oct 2021 10:14:20 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <6c199526d88150c31461e3b7f9e76909217e658c.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 11 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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, 02 Oct 2021 16:14:18 +0200
In-Reply-To: <6c199526d88150c31461e3b7f9e76909217e658c.camel@HIDDEN>
 (Maxime Devos's message of "Sat, 02 Oct 2021 15:52:35 +0200")
Message-ID: <87ee93y0n9.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maxime Devos <maximedevos@HIDDEN> skribis:

> Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
>> +(define (profile-cache-key file)
>> +  "Return the cache key for the profile corresponding to FILE, a 'guix.=
scm' or
>> +'manifest.scm' file, or #f if we lack channel information."
>> +  (match (current-channels)
>> +    (() #f)
>> +    (((=3D channel-commit commits) ...)
>> +     (let ((stat (stat file)))
>> +       (bytevector->base32-string
>> +        (sha256 (string->utf8
>> +                 (string-append (string-join commits) ":"
>> +                                (basename file) ":"
>> +                                (number->string (stat:dev stat)) ":"
>> +                                (number->string (stat:ino stat))))))))))
>
> Why only use the 'basename' of a file name instead of the full name?
> (Consider the case where a user has multiple "guix.scm" or "manifest.scm"=
.)
> This turns out to be unproblematic, because stat:dev and stat:ino is incl=
uded
> as well, though including (a part of) the file name is superfluous because
> stat:dev and stat:ino are included.
>
> Could you document the rationale for including the file name, and why only
> the basename is included instead of the full file name?

Actually it=E2=80=99s probably not useful to include the file (base)name.  I
think initially I thought about distinguishing between guix.scm and
manifest.scm, since they return different kinds of objects, but dev/ino
is probably enough.  WDYT?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:12:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 10:12:44 2021
Received: from localhost ([127.0.0.1]:60132 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfkq-00043q-CN
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:12:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39796)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfkp-00043c-Bd
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:12:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53630)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfkj-0001Tr-9K; Sat, 02 Oct 2021 10:12:37 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36480 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfki-0004P8-W9; Sat, 02 Oct 2021 10:12:37 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxime Devos <maximedevos@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
 <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 11 =?utf-8?Q?Vend=C3=A9miaire?= an 230 de la
 =?utf-8?Q?R=C3=A9volution?=
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, 02 Oct 2021 16:12:35 +0200
In-Reply-To: <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
 (Maxime Devos's message of "Sat, 02 Oct 2021 15:43:27 +0200")
Message-ID: <87ilyfy0q4.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maxime Devos <maximedevos@HIDDEN> skribis:

> Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
>> With this change, running "guix shell" (no arguments) is equivalent to:
>>=20
>>   guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm
>>=20
>> This is the cache miss.  On cache hit, it's equivalent to:
>>=20
>>   guix environment -p ~/.cache/guix/profiles/some-root
>>=20
>
> What if guix.scm is something like
>
> ;; Load custom package definitions
> (include "a-package.scm")
> (include "b-package.scm")
> (include "c-package.scm")
> (list a-package b-package c-package bash ...)
>
> and a-package.scm, b-package.scm or c-package.scm is modified?
> Then the cached profile should be rebuild, no?

It should, but it won=E2=80=99t; that=E2=80=99s a weakness of this mtime-ba=
sed caching
strategy.

I=E2=80=99m not sure how to address it.  We=E2=80=99d need a cache key that=
=E2=80=99s more
precise than inode/mtime, yet cheap to compute.

Perhaps we need to live with that limitation, document it, and provide a
flag to force a rebuild?

> So I think the cache should also check if these dependencies have been mo=
dified.
> To keep track of the dependencies, something like the =E2=80=98compile-al=
l,compile:
> Keep track of dependencies of compiled modules.=E2=80=99 patch from
> <https://issues.guix.gnu.org/50384> could be used, though the 'include', =
'load',
> 'include-from-path' and maybe 'use-modules' (if something like "guix shel=
l -Lextra-modules-directory ..."
> is done) macros would need to be replaced.

Problem is that any attempt to keep track of dependencies is always an
approximation because macros can do anything=E2=80=94I can have my own macro
that reads files at expansion time.  So I=E2=80=99m inclined to not even tr=
y.

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:01:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 10:01:05 2021
Received: from localhost ([127.0.0.1]:60112 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfZY-0003lp-Tz
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:01:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38174)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfZW-0003l9-Ai
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:01:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53404)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>) id 1mWfZQ-0001Mw-UQ
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:00:56 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36472 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>) id 1mWfYn-0007Zg-Nx
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 10:00:29 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: =?utf-8?B?4oCYZ3VpeCBzaGVsbOKAmQ==?= shebangs
References: <20211002102116.27726-1-ludo@HIDDEN>
Date: Sat, 02 Oct 2021 16:00:10 +0200
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN> ("Ludovic =?utf-8?Q?Cou?=
 =?utf-8?Q?rt=C3=A8s=22's?=
 message of "Sat, 2 Oct 2021 12:21:16 +0200")
Message-ID: <87zgrry1at.fsf@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:

> The differences to =E2=80=98guix environment=E2=80=99 are:
>
>   1. =E2=80=98--ad-hoc=E2=80=99 is the default.
>
>        =E2=80=98guix shell hello=E2=80=99 =E2=89=8D =E2=80=98guix environ=
ment --ad-hoc hello=E2=80=99
>        =E2=80=98guix shell -D hello git=E2=80=99 =E2=89=8D =E2=80=98guix =
environment hello --ad-hoc git=E2=80=99
>
>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.
>
>   3. =E2=80=98--load=E2=80=99/=E2=80=98-l=E2=80=99 is not =E2=80=98-f=E2=
=80=99/=E2=80=98--install-from-file=E2=80=99 for consistency with
>      =E2=80=98guix package=E2=80=99.
>
>   4. =E2=80=98guix shell=E2=80=99 without arguments maintains a cache, su=
ch that, the
>      second time you run it, it runs in ~0.1s (it does not even need to
>      connect to the daemon).
>
>      If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix s=
hell=E2=80=99, it recomputes
>      the environment, as is currently the case with =E2=80=98guix environ=
ment=E2=80=99.

Oh, I had another goal in mind, which was to make it easy to use =E2=80=98g=
uix
shell=E2=80=99 in shebangs.

Problem is, since it=E2=80=99s called =E2=80=98guix shell=E2=80=99 and not =
=E2=80=98guix-shell=E2=80=99, we have
to use =E2=80=98/usr/bin/env -S=E2=80=99 anyway as the shebang so it splits=
 arguments.
And with =E2=80=98-S=E2=80=99, we can already do pretty much everything we =
want.  Here=E2=80=99s
a shell script:

--8<---------------cut here---------------start------------->8---
$ cat t.sh
#!/usr/bin/env -S guix shell hello bash -- sh
type -P hello
hello
--8<---------------cut here---------------end--------------->8---

Should we simply document it or should we do something more?

For the record, =E2=80=98nix-shell=E2=80=99 has shebang support where it ca=
n interpret
=E2=80=9Cspecial=E2=80=9D lines as arguments:

  https://nixos.org/manual/nix/stable/#sec-nix-shell

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:52:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:52:40 2021
Received: from localhost ([127.0.0.1]:58385 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfRQ-00036K-My
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:52:40 -0400
Received: from michel.telenet-ops.be ([195.130.137.88]:56102)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mWfRO-000361-8o
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:52:39 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by michel.telenet-ops.be with bizsmtp
 id 11sc260050mfAB4061sc3S; Sat, 02 Oct 2021 15:52:36 +0200
Message-ID: <6c199526d88150c31461e3b7f9e76909217e658c.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 02 Oct 2021 15:52:35 +0200
In-Reply-To: <20211002102240.27815-10-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-t+LWauDpHLEuDihFj056"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633182756; bh=omF5ASZoi8snei6ZZr2erB3zRm0VaAk+dejiqYC/ilQ=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=mmL7eKkFsra3UDcugJJ+ZB29FFkoIvdm2ZkK0mUbZcTSyRsn7if8NHEmOjBWH0Vz1
 a646AEMrd2k14Zwza4jOijwHIHqoJ9d204KUxc5aRxQgJx3OcpUTaf36qzmLqyKHVw
 TGI5IgdX6t39fXYqx2fbq/mOyiv5FK8P70e6dyleCIPP5IQXSaCxl0X24RbufCvSa+
 Sa/cd13ECAlHdio9l3w/B+7TaSmdLOkobjbrLzv3r2DEmAcda575hLA3IJz+dkK94D
 fw5GlX75+yYyEyapV8LRco0At6CnQ4BpwTO5fHQ5AK07dRyjUCGoZu7jzke+sm3R19
 YBw0CoqpHQgMA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-t+LWauDpHLEuDihFj056
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
> +(define (profile-cache-key file)
> +  "Return the cache key for the profile corresponding to FILE, a 'guix.s=
cm' or
> +'manifest.scm' file, or #f if we lack channel information."
> +  (match (current-channels)
> +    (() #f)
> +    (((=3D channel-commit commits) ...)
> +     (let ((stat (stat file)))
> +       (bytevector->base32-string
> +        (sha256 (string->utf8
> +                 (string-append (string-join commits) ":"
> +                                (basename file) ":"
> +                                (number->string (stat:dev stat)) ":"
> +                                (number->string (stat:ino stat))))))))))

Why only use the 'basename' of a file name instead of the full name?
(Consider the case where a user has multiple "guix.scm" or "manifest.scm".)
This turns out to be unproblematic, because stat:dev and stat:ino is includ=
ed
as well, though including (a part of) the file name is superfluous because
stat:dev and stat:ino are included.

Could you document the rationale for including the file name, and why only
the basename is included instead of the full file name?

Greetings,
Maxime.

--=-t+LWauDpHLEuDihFj056
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhkIxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ibCAPsGdx+zzlusF1H+ukK1zNmhBuVV
dMZ9ckNiSz2XOoQxfAD+JkzSnybdAHlIxyOm/ARE4P8tJDEgxXsKOnX6tYqrlwE=
=BuKD
-----END PGP SIGNATURE-----

--=-t+LWauDpHLEuDihFj056--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:52:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:52:16 2021
Received: from localhost ([127.0.0.1]:58381 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfR2-000347-FB
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:52:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfR1-00033v-Ls
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:52:15 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53306)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfQw-0000cW-1J; Sat, 02 Oct 2021 09:52:10 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36470 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfQv-0008S2-Nv; Sat, 02 Oct 2021 09:52:09 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Jelle Licht <jlicht@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN> <86mtnrpuoa.fsf@HIDDEN>
Date: Sat, 02 Oct 2021 15:52:08 +0200
In-Reply-To: <86mtnrpuoa.fsf@HIDDEN> (Jelle Licht's message of "Sat, 02 Oct
 2021 12:50:29 +0200")
Message-ID: <87bl47zg8n.fsf_-_@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi!

Jelle Licht <jlicht@HIDDEN> skribis:

> At the risk of doing exactly not that; since it will(/might) already
> provide some automagic conveniences, perhaps it makes sense to
> additionally load a guix-channels.scm.
>
> I understand that there would be some duplication of functionality
> w.r.t. =E2=80=98guix time-machine -C guix-channels.scm -- shell ...=E2=80=
=99, but if we
> already go the DWIW-route, why not go all the way? I think this should
> only apply when running =E2=80=98guix shell=E2=80=99 without arguments, i=
f that was
> unclear.

Oh, it=E2=80=99s tempting yeah, but=E2=80=A6  (1) only =E2=80=98time-machin=
e=E2=80=99 and =E2=80=98pull=E2=80=99 deal
with channels currently, so it=E2=80=99d feel kind of weird to take care of=
 that
here, and (2) pulling a specific channel is resource-intensive as you
know, much more than anything else, so I=E2=80=99d rather not have that hap=
pen
automatically.

But yeah, I agree that it could be useful.  Maybe a first step we could
make is have =E2=80=98time-machine=E2=80=99 load =E2=80=98channels.scm=E2=
=80=99, such that those who
want it can type:

  guix time-machine -- shell

?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:46:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:46:58 2021
Received: from localhost ([127.0.0.1]:58325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfLu-0002oU-LU
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:46:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35924)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfLt-0002oH-0d
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:46:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53186)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfLn-00021V-Ka; Sat, 02 Oct 2021 09:46:51 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36468 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfLn-0007rH-Au; Sat, 02 Oct 2021 09:46:51 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-6-ludo@HIDDEN>
 <c2b770e4c418bd113e39f089e2a118422ef25cc4.camel@HIDDEN>
Date: Sat, 02 Oct 2021 15:46:49 +0200
In-Reply-To: <c2b770e4c418bd113e39f089e2a118422ef25cc4.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 02 Oct 2021 13:39:05 +0200")
Message-ID: <87h7dzzghi.fsf_-_@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

> Am Samstag, den 02.10.2021, 12:22 +0200 schrieb Ludovic Court=C3=A8s:
>> * guix/scripts/environment.scm (guix-environment*): Bypass calls to
>> 'package-derivation' and to 'manifest->derivation' when PROFILE is
>> true.
> This only affects `guix shell' and not `guix environment', right?

No, it affects =E2=80=98guix environment=E2=80=99 (it=E2=80=99s in environm=
ent.scm).  It=E2=80=99s an
optimization of =E2=80=98guix environment -p=E2=80=99, but its observable b=
ehavior is
unchanged; it=E2=80=99s just faster.

> Then again, if the following holds
>>   If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix she=
ll=E2=80=99, it recomputes
>>   the environment, as is currently the case with =E2=80=98guix environme=
nt=E2=80=99.
> then the behaviour of guix environment should also be consistent with
> what it did before, but with the added cache of guix shell.  Am I
> reading this correctly?

The cache itself is only in =E2=80=98guix shell=E2=80=99, in the no-argumen=
t case:

  https://issues.guix.gnu.org/50960#9

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:43:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:43:37 2021
Received: from localhost ([127.0.0.1]:58315 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfIe-0002iT-Ob
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:43:36 -0400
Received: from laurent.telenet-ops.be ([195.130.137.89]:59552)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mWfIc-0002iK-Uz
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:43:36 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by laurent.telenet-ops.be with bizsmtp
 id 11jY260080mfAB4011jYWg; Sat, 02 Oct 2021 15:43:33 +0200
Message-ID: <91012c32e4f8b04beae71378d44787a81055391a.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 10/10] shell: Maintain a profile cache.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 02 Oct 2021 15:43:27 +0200
In-Reply-To: <20211002102240.27815-10-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-10-ludo@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-7niR6W+BhW4SS3n3wP77"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633182213; bh=gk2qrfUolCvdz/3dj1TMCB3r/ZEAhO5ZiVQ4oKV3B4Q=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=FVtJLDzpeTOvy6FQgkx3KWGBHivNh5rPNBi7Q/FXd7vOwH7cqvHNE2JYcbGMh+jaW
 i7zrQa4mN/IvO1KB7gq+DkXSo7jL4RgrDMxWKOwCqAvqAUi0Al4TI9EplXZ/BgCgJ9
 Sk/vb6t+uhyXm/YYzVacb+auJ49xvc1DiIyqL4+cD/rEUgPVrdXRFB82nCHv9G9BAx
 wOch7SwS5FHGrINTb+pemUDVJRRjvHcx3NaE1pCLJJCERVYbj0jfs6jlspZ6wBOTlC
 SOP5P8AkFNYj1meKbnyxxzsmRsM//SYYhvmNEcn6GcY8zZZ7JQfpeUIkLonHrEVlrr
 mbfdFsAtvsURQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-7niR6W+BhW4SS3n3wP77
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
> With this change, running "guix shell" (no arguments) is equivalent to:
>=20
>   guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm
>=20
> This is the cache miss.  On cache hit, it's equivalent to:
>=20
>   guix environment -p ~/.cache/guix/profiles/some-root
>=20

What if guix.scm is something like

;; Load custom package definitions
(include "a-package.scm")
(include "b-package.scm")
(include "c-package.scm")
(list a-package b-package c-package bash ...)

and a-package.scm, b-package.scm or c-package.scm is modified?
Then the cached profile should be rebuild, no?

I use something like that for my operating system definition
(though with -L and use-modules).  It would be nice if this worked
for "guix shell" as well.

So I think the cache should also check if these dependencies have been modi=
fied.
To keep track of the dependencies, something like the =E2=80=98compile-all,=
compile:
Keep track of dependencies of compiled modules.=E2=80=99 patch from
<https://issues.guix.gnu.org/50384> could be used, though the 'include', 'l=
oad',
'include-from-path' and maybe 'use-modules' (if something like "guix shell =
-Lextra-modules-directory ..."
is done) macros would need to be replaced.

Greetings,
Maxime.

--=-7niR6W+BhW4SS3n3wP77
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhh/xccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7iVYAQCEq4K0E44VpESXGHkGswfRcBbG
Mxm6kspIO3UOyPqV+wEAp26SJiJ651QxY4UGqeGQRXf0hS95YF8Bn4Dk25SZbgk=
=5gE1
-----END PGP SIGNATURE-----

--=-7niR6W+BhW4SS3n3wP77--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:43:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:43:30 2021
Received: from localhost ([127.0.0.1]:58311 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfIY-0002iA-FZ
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:43:30 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35494)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfIX-0002hw-NG
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:43:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53130)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfIS-00089E-Gc; Sat, 02 Oct 2021 09:43:24 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36466 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfIS-0007bI-6v; Sat, 02 Oct 2021 09:43:24 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Liliana Marie Prikler <liliana.prikler@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
 <1c5d7a3d62da1b495a14b850a1b56b2a410b2405.camel@HIDDEN>
Date: Sat, 02 Oct 2021 15:43:22 +0200
In-Reply-To: <1c5d7a3d62da1b495a14b850a1b56b2a410b2405.camel@HIDDEN>
 (Liliana Marie Prikler's message of "Sat, 02 Oct 2021 13:52:03 +0200")
Message-ID: <87mtnrzgn9.fsf_-_@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Liliana Marie Prikler <liliana.prikler@HIDDEN> skribis:

> Am Samstag, den 02.10.2021, 12:22 +0200 schrieb Ludovic Court=C3=A8s:
>> [...]
>> +(define (auto-detect-manifest opts)
>> +  "If OPTS do not specify packages or a manifest, load a
>> \"guix.scm\" or
>> +\"manifest.scm\" file from the current directory or one of its
>> ancestors.
>> +Return the modified OPTS."
>> +  (define (options-contain-payload? opts)
>> +    (match opts
>> +      (() #f)
>> +      ((('package . _) . _) #t)
>> +      ((('load . _) . _) #t)
>> +      ((('manifest . _) . _) #t)
>> +      ((('expression . _) . _) #t)
>> +      ((_ . rest) (options-contain-payload? rest))))
>> +
>> +  (if (options-contain-payload? opts)
>> +      opts
>> +      (match (find-file-in-parent-directories '("guix.scm"
>> "manifest.scm"))
>> +        (#f
>> +         (warning (G_ "no packages specified; creating an empty
>> environment~%"))
>> +         opts)
>> +        (file
>> +         (info (G_ "loading environment from '~a'...~%") file)
>> +         (match (basename file)
>> +           ("guix.scm"
>> +            (alist-cons 'load `(package ,file) opts))
>> +           ("manifest.scm"
>> +            (alist-cons 'manifest file opts)))))))
>> [...]
> What would happen on the top-level of the Guix source tree or deep
> inside the tree of a guile package that deals with manifests, that
> aren't necessarily related to Guix?

You mean a directory that contains a file named =E2=80=98guix.scm=E2=80=99 =
or
=E2=80=98manifest.scm=E2=80=99 but that happens to do something completely =
unrelated?

We can never rule this out, but I=E2=80=99d say it=E2=80=99s unlikely (thes=
e two
conventions are rather well established) and it=E2=80=99s up to the user to=
 pay
attention.

WDYT?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:40:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:40:10 2021
Received: from localhost ([127.0.0.1]:58303 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWfFK-0002dA-MH
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:40:10 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35112)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWfFI-0002cp-5o
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:40:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53084)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfFC-0005rv-DR; Sat, 02 Oct 2021 09:40:02 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36464 helo=ribbon)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWfFC-0007KD-46; Sat, 02 Oct 2021 09:40:02 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
Subject: Re: bug#50960: [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
References: <20211002102116.27726-1-ludo@HIDDEN>
 <20211002115958.rzupz4afq7elehq4@HIDDEN>
Date: Sat, 02 Oct 2021 15:40:00 +0200
In-Reply-To: <20211002115958.rzupz4afq7elehq4@HIDDEN>
 (pelzflorian@HIDDEN's message of "Sat, 2 Oct 2021 14:10:25
 +0200")
Message-ID: <87sfxjzgsv.fsf_-_@HIDDEN>
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-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> skribis:

> On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Court=C3=A8s wrote:
>>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98gui=
x.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>>      from the current directory or one of its ancestors.
>
> This however is concerning.  Users will not expect guix to execute
> arbitrary code.  Maybe print a suggestion to maybe --file the file
> instead.
>
> Maybe I should not have such expectations but IMHO Guix is not like
> `haunt build`, which is expected to load haunt.scm.

I think it=E2=80=99s fine as long as, as in the case of =E2=80=98haunt buil=
d=E2=80=99 or =E2=80=98make=E2=80=99
or =E2=80=98git=E2=80=99, it=E2=80=99s properly documented.  Also, =E2=80=
=98guix shell=E2=80=99 unconditionally
writes a message.

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 13:29:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 09:29:00 2021
Received: from localhost ([127.0.0.1]:58299 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWf4W-0002MT-K2
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:29:00 -0400
Received: from xavier.telenet-ops.be ([195.130.132.52]:57824)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@HIDDEN>) id 1mWf4U-0002MJ-IO
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 09:28:59 -0400
Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be
 ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d])
 by xavier.telenet-ops.be with bizsmtp
 id 11Uw260070mfAB4011UwV9; Sat, 02 Oct 2021 15:28:57 +0200
Message-ID: <5686bf529c9ea7fe5e8a34d9116dfc317c7f1745.camel@HIDDEN>
Subject: Re: [bug#50960] [PATCH 09/10] cache: Gracefully handle non-existent
 cache.
From: Maxime Devos <maximedevos@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 02 Oct 2021 15:28:51 +0200
In-Reply-To: <20211002102240.27815-9-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-9-ludo@HIDDEN>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-E+Ms8J0BLT+itdLIQQJh"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21;
 t=1633181337; bh=Qn5SAtfmx/cZZNftRStB/KsMUP7ZoS265V7uRhs0CH0=;
 h=Subject:From:To:Date:In-Reply-To:References;
 b=gsMk0UOYJk3ok5A/TtkjsJdlhjmOF4hvBres41jhN92Nj3A3YIc43+hm7l1xb8ARK
 1tcwqMaVWnAqo+VDPuqZBbbQp+5hjlaC4Ixs7Ao10OA8I1j6/afp0TfiGJrOlS7PGv
 R/QO8Z/Qk6tM5glpnjeigNGLIH2IU93GCn6B31ICqDjRexI0py5bdQsWCIgoKcMEyA
 roQtoZcJ65JfOZfALdqN0jW13b+oq/HxbqzuCoPdFMlSOrAAn4UqhFXxOWeqDNVRnY
 df7/17zfKF2jM8ClRJg0lAJugP026Xhn4i/seS5xJIvgfMS41yxATE1PDdXkhNd7Dc
 bgSexW700SiAA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--=-E+Ms8J0BLT+itdLIQQJh
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s schreef op za 02-10-2021 om 12:22 [+0200]:
> * guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT
> when writing EXPIRY-FILE.
> ---
>  guix/cache.scm | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>=20
> diff --git a/guix/cache.scm b/guix/cache.scm
> index 0401a9d428..51009809bd 100644
> --- a/guix/cache.scm
> +++ b/guix/cache.scm
> @@ -101,7 +101,13 @@ CLEANUP-PERIOD denotes the minimum time between two =
cache cleanups."
>                                    #:now now
>                                    #:entry-expiration entry-expiration
>                                    #:delete-entry delete-entry)
> -    (call-with-output-file expiry-file
> -      (cute write (time-second now) <>))))
> +    (catch 'system-error
> +      (lambda ()
> +        (call-with-output-file expiry-file
> +          (cute write (time-second now) <>)))
> +      (lambda args
> +        ;; ENOENT means CACHE does not exist.
> +        (unless (=3D ENOENT (system-error-errno args))

And EROFS perhaps, such that "guix shell" works even if the root file syste=
m was
remounted read-only for some reason and all the necessary derivations have =
already
been built.

Greetings,
Maxime.

--=-E+Ms8J0BLT+itdLIQQJh
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYVhekxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nAEAPwKOGXBXLXxya7HiaIWjRAUbp0K
b1b/0zFzzMF4Hn2e+QEA72Q2UB9KwoJfTVA3rKwqH7wa4BmQLmEhvgucBUxZRAw=
=HxkF
-----END PGP SIGNATURE-----

--=-E+Ms8J0BLT+itdLIQQJh--





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 12:10:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 08:10:36 2021
Received: from localhost ([127.0.0.1]:58142 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWdqe-0000Hu-6L
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 08:10:36 -0400
Received: from pelzflorian.de ([5.45.111.108]:49780 helo=mail.pelzflorian.de)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pelzflorian@HIDDEN>) id 1mWdqc-0000Hk-6O
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 08:10:35 -0400
Received: from pelzflorian.localdomain (unknown [5.45.111.108])
 by mail.pelzflorian.de (Postfix) with ESMTPSA id 04F5436069D;
 Sat,  2 Oct 2021 14:10:32 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de;
 s=mail; t=1633176633;
 bh=4ip6G+LobULb+YsonJ8gfGtslvJ4m5xOVTafYMSSWn4=;
 h=Date:From:To:Cc:Subject:References:In-Reply-To;
 b=hl5XH9pvMt/9ifqT8Mo7TiRefmV3GLy+1z6Gv/pjHjYMjf047FlvikTc8jTMkf8Jq
 K/OKlpAHDkWEek3Ofqj79VA3DujVNr2iQA/y92ckvJ4zS4BBN+1+w891S3JbJiVNQ1
 i80+QJd63lFxw91lyssRlS79pHA7kl7zAhROMe8o=
Date: Sat, 2 Oct 2021 14:10:25 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
Message-ID: <20211002115958.rzupz4afq7elehq4@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: 50960 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

guix shell is very interesting, but:

On Sat, Oct 02, 2021 at 12:21:16PM +0200, Ludovic Courtès wrote:
>   2. ‘guix shell’, without arguments, loads ‘guix.scm’ or ‘manifest.scm’
>      from the current directory or one of its ancestors.

This however is concerning.  Users will not expect guix to execute
arbitrary code.  Maybe print a suggestion to maybe --file the file
instead.

Maybe I should not have such expectations but IMHO Guix is not like
`haunt build`, which is expected to load haunt.scm.

Regards,
Florian




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 11:52:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 07:52:11 2021
Received: from localhost ([127.0.0.1]:58122 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWdYp-0008En-6n
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 07:52:11 -0400
Received: from mail-wm1-f68.google.com ([209.85.128.68]:37885)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1mWdYo-0008EX-Cq
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 07:52:10 -0400
Received: by mail-wm1-f68.google.com with SMTP id
 j10-20020a1c230a000000b0030d523b6693so2842496wmj.2
 for <50960 <at> debbugs.gnu.org>; Sat, 02 Oct 2021 04:52:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:subject:from:to:date:in-reply-to:references:user-agent
 :mime-version:content-transfer-encoding;
 bh=pKzigFsDS9I7hQNCLaZ1iWxZo+LKwmCTSltRdKXV8lQ=;
 b=OcnVZ1MFKvNyaaGM0zt10aDl9oQtFjB5SYOaCObSc0YX/hXjvM2TvQINz5U0g8X1hv
 5m4oSq+IjTdpuo5kvkloUEszXXTDklUgI7361Ul6xhAvPFu2+ool9FfFzugjMPM1DgFR
 EsqOYqlDFNzuoHowk+8Ph2juKdY9cIJTnPmRjVEU5duFzMfurRmPz/rRyYi4hZVmSFKz
 uEzh5ZT87N4gOv3aJ7U6IZse359jxktMx1PBgmOvF/fbGBT2zW9hbFWAdUr3raFB//j0
 G7KqrsPjKrLHOFV3Qd0bgFWEkJ698gF3ySyehAB21AVhu8rp4p0FbtShi9VF3UJqaCeM
 U97Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to
 :references:user-agent:mime-version:content-transfer-encoding;
 bh=pKzigFsDS9I7hQNCLaZ1iWxZo+LKwmCTSltRdKXV8lQ=;
 b=fcxJA1/65LYQjQ07AJIURy7Mg3DwfBfO31/EDlVN4RsJ8wJ8270re3kmdAKJtd7483
 c6iInRTK5AlQSInuJG+xRIp38c5KIfBlKDC//tm2AByeD9HBcTNa28Z7+yB0hM2JgFXM
 ieeeq3qvRjsCeO8QWlJ/Y6clhGMW+R39E1cYKlsT5iHYQSS0eu28aa9XLYEftncm5XUW
 kzg1GwQVX3Ns+seKjJ0mPdk1/QLysfNOD3EdfKDKb6M1xQsIpckjEfi1Iszdm6Cj0D7x
 Fmn/QYcke+dbrY8cklnoWhfD/awngi0VrCugPpo7XZpsOL33SkrEaPYfKwJKcS2HVAlo
 8lvQ==
X-Gm-Message-State: AOAM531P9HokFyEoDOVjtKwLj9n5PIj5JqwjQOyHOjYcjlgrCko2p+o5
 yDx/hLci7ScZ4fVk1oX2/5E=
X-Google-Smtp-Source: ABdhPJx6kM8WgJWgTSb0N7o9yYtEtgGZWpY4eeKAQ+aFihc5IeYcG6/leEbGvuGA8OZ9FEmqxclgmg==
X-Received: by 2002:a05:600c:154f:: with SMTP id
 f15mr9351469wmg.92.1633175524475; 
 Sat, 02 Oct 2021 04:52:04 -0700 (PDT)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id p6sm3861736wrj.95.2021.10.02.04.52.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 02 Oct 2021 04:52:03 -0700 (PDT)
Message-ID: <1c5d7a3d62da1b495a14b850a1b56b2a410b2405.camel@HIDDEN>
Subject: Re: [PATCH 04/10] DRAFT shell: By default load the local 'guix.scm'
 or 'manifest.scm' file.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 02 Oct 2021 13:52:03 +0200
In-Reply-To: <20211002102240.27815-4-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-4-ludo@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

Am Samstag, den 02.10.2021, 12:22 +0200 schrieb Ludovic Courtès:
> [...]
> +(define (auto-detect-manifest opts)
> +  "If OPTS do not specify packages or a manifest, load a
> \"guix.scm\" or
> +\"manifest.scm\" file from the current directory or one of its
> ancestors.
> +Return the modified OPTS."
> +  (define (options-contain-payload? opts)
> +    (match opts
> +      (() #f)
> +      ((('package . _) . _) #t)
> +      ((('load . _) . _) #t)
> +      ((('manifest . _) . _) #t)
> +      ((('expression . _) . _) #t)
> +      ((_ . rest) (options-contain-payload? rest))))
> +
> +  (if (options-contain-payload? opts)
> +      opts
> +      (match (find-file-in-parent-directories '("guix.scm"
> "manifest.scm"))
> +        (#f
> +         (warning (G_ "no packages specified; creating an empty
> environment~%"))
> +         opts)
> +        (file
> +         (info (G_ "loading environment from '~a'...~%") file)
> +         (match (basename file)
> +           ("guix.scm"
> +            (alist-cons 'load `(package ,file) opts))
> +           ("manifest.scm"
> +            (alist-cons 'manifest file opts)))))))
> [...]
What would happen on the top-level of the Guix source tree or deep
inside the tree of a guile package that deals with manifests, that
aren't necessarily related to Guix?  I think we should try searching
for something less ambiguous first (".guix-shell/manifest" perhaps?)
and maybe also provide further options after manifest.scm (e.g. build-
aux/guix.scm or etc/guix.scm)

WDYT?





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 11:39:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 07:39:14 2021
Received: from localhost ([127.0.0.1]:58087 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWdMI-0007qD-88
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 07:39:14 -0400
Received: from mail-wr1-f68.google.com ([209.85.221.68]:38455)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <liliana.prikler@HIDDEN>) id 1mWdMG-0007q0-Nq
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 07:39:13 -0400
Received: by mail-wr1-f68.google.com with SMTP id u18so19779162wrg.5
 for <50960 <at> debbugs.gnu.org>; Sat, 02 Oct 2021 04:39:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=message-id:subject:from:to:date:in-reply-to:references:user-agent
 :mime-version:content-transfer-encoding;
 bh=D+NBk/yv+56WCewDkcNuUKG1f+W9MWIVFt3V7K52REk=;
 b=l7NteclwUpt+f0P3GOS/ERTm3CH0sKt+7kbMJGzblrUSfV4bNmGaVBguNRK54DOeGb
 y2VJFGCiu8bJniUjkW44zLkYBrbIsQhKBmx0g/TC6kVZ5uS1I0Z1rKu8QC5a6FynZyPu
 e7FcvXAZuuuE4kyyqGifN0tpE0B+DtKesyEyAY3UlqyOEi78EXi0ekcPfpIEvIgFbkXF
 dGvqIhuvh4tS5Px6qWMYkK7wP/d5HesAAmZYRm8fVMYMma8Pih2l8m6gdzP2aZOdeYDZ
 6EC9q0J6UJqpju1oeiDCMQzM/qeFYICEcu8XyR6vPaZBtDyTbQV0hvSbLA0qGO0vdtxU
 kqBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to
 :references:user-agent:mime-version:content-transfer-encoding;
 bh=D+NBk/yv+56WCewDkcNuUKG1f+W9MWIVFt3V7K52REk=;
 b=1D/IpIpZqIr/Wz60Imo/Do2NpYA1TtjjFn4iqpHqd56r2I+UkafnMPn4Vt0OA8pEoR
 oeA+yTdjjCqzn3qvfJ9ychlSOKljQ0f6ACk9UosP/u/tupYMqo2KCYmaDxLNsDHTps0R
 HnKB2FD9xkN/5SrKP4iRDLTGyVn4gE6MfAziLSpgTbQeLJ7+GzMKHVuB8pJUliuFxkY1
 mG2Hs4/6eBV2mtCMomv3HELGMA3gLeKHPJEA67HvD1AIrx43o6YQxNZ7pplZi7v1RZ3Z
 wvqWMIey5A3gNTpkmF/E3Ve7epC2+M4MzjU2hD2ggYbEVKK2IrDqf73NA4wtzh5wnmld
 idSg==
X-Gm-Message-State: AOAM530oQ/3UqLoLVFom7doRY88xEM6zzHw80WXEhvccDjsZkIzeQ0U+
 mtHySEYnIabltxbpxO27G9bG1dGtuXY=
X-Google-Smtp-Source: ABdhPJxd/6WTpxDOWk4TY0a5ClVOCLHHwUJ9OQ//dwvVk8Sc+6RpEa8ORpM0CJaCfpD+JEBtiQo+mQ==
X-Received: by 2002:adf:dc90:: with SMTP id r16mr3157803wrj.221.1633174747153; 
 Sat, 02 Oct 2021 04:39:07 -0700 (PDT)
Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at.
 [85.127.52.93])
 by smtp.gmail.com with ESMTPSA id j11sm4349155wru.11.2021.10.02.04.39.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 02 Oct 2021 04:39:06 -0700 (PDT)
Message-ID: <c2b770e4c418bd113e39f089e2a118422ef25cc4.camel@HIDDEN>
Subject: Re: [PATCH 06/10] environment: Skip derivation computation when
 '--profile' is used.
From: Liliana Marie Prikler <liliana.prikler@HIDDEN>
To: Ludovic =?ISO-8859-1?Q?Court=E8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Date: Sat, 02 Oct 2021 13:39:05 +0200
In-Reply-To: <20211002102240.27815-6-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
 <20211002102240.27815-6-ludo@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.2 
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Am Samstag, den 02.10.2021, 12:22 +0200 schrieb Ludovic Courtès:
> * guix/scripts/environment.scm (guix-environment*): Bypass calls to
> 'package-derivation' and to 'manifest->derivation' when PROFILE is
> true.
This only affects `guix shell' and not `guix environment', right?  If
not, does the outward behaviour of `guix environment' stay the same
considering this patch and 07/10?  There might be people relying on the
way `guix environment' *currently* works, who would need to be informed
about that change.

Then again, if the following holds
>   If you run ‘guix pull’ and run again ‘guix shell’, it recomputes
>   the environment, as is currently the case with ‘guix environment’.
then the behaviour of guix environment should also be consistent with
what it did before, but with the added cache of guix shell.  Am I
reading this correctly?

Regards,
Liliana





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:50:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:50:35 2021
Received: from localhost ([127.0.0.1]:57997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcbD-00028Y-2V
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:50:35 -0400
Received: from mail1.fsfe.org ([217.69.89.151]:43130)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jlicht@HIDDEN>) id 1mWcbA-00028M-GJ
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:50:33 -0400
From: Jelle Licht <jlicht@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 50960 <at> debbugs.gnu.org
Subject: Re: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix
 environment'
In-Reply-To: <20211002102116.27726-1-ludo@HIDDEN>
References: <20211002102116.27726-1-ludo@HIDDEN>
Date: Sat, 02 Oct 2021 12:50:29 +0200
Message-ID: <86mtnrpuoa.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hello Guix!
>
> Here comes =E2=80=98guix shell=E2=80=99, a proposed replacement for =E2=
=80=98guix environment=E2=80=99!
Suddenly thousands(/dozens?) of shell scripts fear for their continued
existence :-)

>   2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix=
.scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99
>      from the current directory or one of its ancestors.
<snip>
>   4. =E2=80=98guix shell=E2=80=99 without arguments maintains a cache, su=
ch that, the
>      second time you run it, it runs in ~0.1s (it does not even need to
>      connect to the daemon).
>
>      If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix s=
hell=E2=80=99, it recomputes
>      the environment, as is currently the case with =E2=80=98guix environ=
ment=E2=80=99.
<snip>
> Thoughts?  Are there other changes people would like to see?
>
> If there=E2=80=99s rough consensus I can work on v2 with documentation.  =
Please
> let=E2=80=99s keep the discussion focused.  :-)

At the risk of doing exactly not that; since it will(/might) already
provide some automagic conveniences, perhaps it makes sense to
additionally load a guix-channels.scm.

I understand that there would be some duplication of functionality
w.r.t. =E2=80=98guix time-machine -C guix-channels.scm -- shell ...=E2=80=
=99, but if we
already go the DWIW-route, why not go all the way? I think this should
only apply when running =E2=80=98guix shell=E2=80=99 without arguments, if =
that was
unclear.

Love the proposal
- Jelle




Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:13 2021
Received: from localhost ([127.0.0.1]:57973 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAj-0007XT-FK
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33130)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAV-0007UK-JG
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49196)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAQ-0007dr-2w; Sat, 02 Oct 2021 06:22:54 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAP-0007gb-KL; Sat, 02 Oct 2021 06:22:54 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 05/10] environment: Add tests for '--profile'.
Date: Sat,  2 Oct 2021 12:22:35 +0200
Message-Id: <20211002102240.27815-5-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This is a followup to a643deac2de81755a1843a3b41dd53857678bebc.

* tests/guix-environment-container.sh, tests/guix-environment.sh: Add
tests for '--profile'.
---
 tests/guix-environment-container.sh | 8 ++++++++
 tests/guix-environment.sh           | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index f2d15c8d0c..2e238c501d 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -44,6 +44,14 @@ else
     test $? = 42
 fi
 
+# Try '--root' and '--profile'.
+root="$tmpdir/root"
+guix environment -C --ad-hoc --bootstrap guile-bootstrap -r "$root" -- guile --version
+guix environment -C -p "$root" --bootstrap -- guile --version
+path1=$(guix environment -C -p "$root" --bootstrap -- guile -c '(display (getenv "PATH"))')
+path2=$(guix environment -C --ad-hoc --bootstrap guile-bootstrap  -- guile -c '(display (getenv "PATH"))')
+test "$path1" = "$path2"
+
 # Make sure "localhost" resolves.
 guix environment --container --ad-hoc --bootstrap guile-bootstrap \
      -- guile -c '(exit (pair? (getaddrinfo "localhost" "80")))'
diff --git a/tests/guix-environment.sh b/tests/guix-environment.sh
index afadcbe195..f4fc2e39ed 100644
--- a/tests/guix-environment.sh
+++ b/tests/guix-environment.sh
@@ -119,6 +119,13 @@ test `readlink "$gcroot"` = "$expected"
 guix environment --bootstrap -r "$gcroot" --ad-hoc guile-bootstrap \
      -- guile -c 1
 test `readlink "$gcroot"` = "$expected"
+
+# Make sure '-p' works as expected.
+test $(guix environment -p "$gcroot" -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT') = "$expected"
+paths1="$(guix environment -p "$gcroot" --search-paths)"
+paths2="$(guix environment --bootstrap --ad-hoc guile-bootstrap --search-paths)"
+test "$paths1" = "$paths2"
+
 rm "$gcroot"
 
 # Try '-r' with a relative file name.
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:13 2021
Received: from localhost ([127.0.0.1]:57971 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAj-0007XM-3g
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33150)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAY-0007UY-Li
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49206)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAT-0007hX-G3; Sat, 02 Oct 2021 06:22:57 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAT-0007gb-6e; Sat, 02 Oct 2021 06:22:57 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 10/10] shell: Maintain a profile cache.
Date: Sat,  2 Oct 2021 12:22:40 +0200
Message-Id: <20211002102240.27815-10-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

With this change, running "guix shell" (no arguments) is equivalent to:

  guix environment -r ~/.cache/guix/profiles/some-root -l guix.scm

This is the cache miss.  On cache hit, it's equivalent to:

  guix environment -p ~/.cache/guix/profiles/some-root

... which can run in 0.1s.

* guix/scripts/shell.scm (auto-detect-manifest): Looked for a cached GC
root to the profile and use it.
(%profile-cache-directory): New variable.
(profile-cache-key, profile-cached-gc-root): New procedures.
(guix-shell)[cache-entries, entry-expiration]: New procedures.
Add call to 'maybe-remove-expired-cache-entries'.
---
 guix/scripts/shell.scm | 90 +++++++++++++++++++++++++++++++++++++++---
 1 file changed, 84 insertions(+), 6 deletions(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 2f15befbd3..7c116cc770 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -29,6 +29,15 @@
   #:use-module (srfi srfi-37)
   #:use-module (srfi srfi-71)
   #:use-module (ice-9 match)
+  #:autoload   (guix base32) (bytevector->base32-string)
+  #:autoload   (rnrs bytevectors) (string->utf8)
+  #:autoload   (guix utils) (cache-directory)
+  #:autoload   (guix describe) (current-channels)
+  #:autoload   (guix channels) (channel-commit)
+  #:autoload   (gcrypt hash) (sha256)
+  #:use-module ((guix build utils) #:select (mkdir-p))
+  #:use-module (guix cache)
+  #:use-module ((ice-9 ftw) #:select (scandir))
   #:export (guix-shell))
 
 (define (show-help)
@@ -161,16 +170,85 @@ Return the modified OPTS."
          (warning (G_ "no packages specified; creating an empty environment~%"))
          opts)
         (file
+         ;; Load environment from FILE; if possible, use/maintain a GC root to
+         ;; the corresponding profile in cache.
          (info (G_ "loading environment from '~a'...~%") file)
-         (match (basename file)
-           ("guix.scm"
-            (alist-cons 'load `(package ,file) opts))
-           ("manifest.scm"
-            (alist-cons 'manifest file opts)))))))
+         (let* ((root (profile-cached-gc-root file))
+                (stat (and root (false-if-exception (lstat root)))))
+           (if (and stat
+                    (<= (stat:mtime ((@ (guile) stat) file))
+                        (stat:mtime stat)))
+               (let ((now (current-time)))
+                 ;; Update the atime on ROOT to reflect usage.
+                 (utime root
+                        now (stat:mtime stat)
+                        0 (stat:mtimensec stat)
+                        AT_SYMLINK_NOFOLLOW)
+                 (alist-cons 'profile root opts)) ;load right away
+               (let ((opts (match (basename file)
+                             ("guix.scm"
+                              (alist-cons 'load `(package ,file) opts))
+                             ("manifest.scm"
+                              (alist-cons 'manifest file opts)))))
+                 (if (and root (not (assq-ref opts 'gc-root)))
+                     (begin
+                       (if stat
+                           (delete-file root)
+                           (mkdir-p (dirname root)))
+                       (alist-cons 'gc-root root opts))
+                     opts))))))))
+
+
+;;;
+;;; Profile cache.
+;;;
+
+(define %profile-cache-directory
+  ;; Directory where profiles created by 'guix shell' alone (without extra
+  ;; options) are cached.
+  (make-parameter (string-append (cache-directory #:ensure? #f)
+                                 "/profiles")))
+
+(define (profile-cache-key file)
+  "Return the cache key for the profile corresponding to FILE, a 'guix.scm' or
+'manifest.scm' file, or #f if we lack channel information."
+  (match (current-channels)
+    (() #f)
+    (((= channel-commit commits) ...)
+     (let ((stat (stat file)))
+       (bytevector->base32-string
+        (sha256 (string->utf8
+                 (string-append (string-join commits) ":"
+                                (basename file) ":"
+                                (number->string (stat:dev stat)) ":"
+                                (number->string (stat:ino stat))))))))))
+
+(define (profile-cached-gc-root file)
+  "Return the cached GC root for FILE, a 'guix.scm' or 'manifest.scm' file, or
+#f if we lack information to cache it."
+  (match (profile-cache-key file)
+    (#f  #f)
+    (key (string-append (%profile-cache-directory) "/" key))))
 
 
 (define-command (guix-shell . args)
   (category development)
   (synopsis "spawn one-off software environments")
 
-  (guix-environment* (parse-args args)))
+  (define (cache-entries directory)
+    (filter-map (match-lambda
+                  ((or "." "..") #f)
+                  (file (string-append directory "/" file)))
+                (or (scandir directory) '())))
+
+  (define* (entry-expiration file)
+    ;; Return the time at which FILE, a cached profile, is considered expired.
+    (match (false-if-exception (lstat file))
+      (#f 0)                       ;FILE may have been deleted in the meantime
+      (st (+ (stat:atime st) (* 60 60 24 7)))))
+
+  (let ((result (guix-environment* (parse-args args))))
+    (maybe-remove-expired-cache-entries (%profile-cache-directory)
+                                        cache-entries
+                                        #:entry-expiration entry-expiration)
+    result))
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:13 2021
Received: from localhost ([127.0.0.1]:57969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAi-0007XE-Rf
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33146)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAY-0007UW-0t
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49204)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAS-0007gK-RS; Sat, 02 Oct 2021 06:22:56 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAS-0007gb-I5; Sat, 02 Oct 2021 06:22:56 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 09/10] cache: Gracefully handle non-existent cache.
Date: Sat,  2 Oct 2021 12:22:39 +0200
Message-Id: <20211002102240.27815-9-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/cache.scm (maybe-remove-expired-cache-entries): Ignore ENOENT
when writing EXPIRY-FILE.
---
 guix/cache.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/guix/cache.scm b/guix/cache.scm
index 0401a9d428..51009809bd 100644
--- a/guix/cache.scm
+++ b/guix/cache.scm
@@ -101,7 +101,13 @@ CLEANUP-PERIOD denotes the minimum time between two cache cleanups."
                                   #:now now
                                   #:entry-expiration entry-expiration
                                   #:delete-entry delete-entry)
-    (call-with-output-file expiry-file
-      (cute write (time-second now) <>))))
+    (catch 'system-error
+      (lambda ()
+        (call-with-output-file expiry-file
+          (cute write (time-second now) <>)))
+      (lambda args
+        ;; ENOENT means CACHE does not exist.
+        (unless (= ENOENT (system-error-errno args))
+          (apply throw args))))))
 
 ;;; cache.scm ends here
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:12 2021
Received: from localhost ([127.0.0.1]:57967 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAi-0007X1-FP
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33142)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAX-0007UP-Bz
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:02 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49202)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAS-0007fe-6g; Sat, 02 Oct 2021 06:22:56 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAR-0007gb-TF; Sat, 02 Oct 2021 06:22:56 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 08/10] environment: Autoload some modules.
Date: Sat,  2 Oct 2021 12:22:38 +0200
Message-Id: <20211002102240.27815-8-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This further speeds up the 'guix environment -p PROFILE' case.

* guix/scripts/environment.scm: Autoload a bunch of modules.
---
 guix/scripts/environment.scm | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index e23d52df39..05a43659da 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -34,15 +34,18 @@
   #:use-module (guix scripts)
   #:use-module (guix scripts build)
   #:use-module (guix transformations)
-  #:use-module (gnu build linux-container)
-  #:use-module (gnu build accounts)
-  #:use-module ((guix build syscalls) #:select (set-network-interface-up))
-  #:use-module (gnu system linux-container)
+  #:autoload   (gnu build linux-container) (call-with-container %namespaces
+                                            user-namespace-supported?
+                                            unprivileged-user-namespace-supported?
+                                            setgroups-supported?)
+  #:autoload   (gnu build accounts) (password-entry group-entry
+                                     password-entry-name password-entry-directory
+                                     write-passwd write-group)
+  #:autoload   (guix build syscalls) (set-network-interface-up)
   #:use-module (gnu system file-systems)
-  #:use-module (gnu packages)
-  #:use-module (gnu packages bash)
-  #:use-module ((gnu packages bootstrap)
-                #:select (bootstrap-executable %bootstrap-guile))
+  #:autoload   (gnu packages) (specification->package+output)
+  #:autoload   (gnu packages bash) (bash)
+  #:autoload   (gnu packages bootstrap) (bootstrap-executable %bootstrap-guile)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:12 2021
Received: from localhost ([127.0.0.1]:57965 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAi-0007Wt-0p
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33138)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAW-0007UO-Mu
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49200)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAR-0007fV-Hn; Sat, 02 Oct 2021 06:22:55 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAR-0007gb-89; Sat, 02 Oct 2021 06:22:55 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 07/10] environment: Do not connect to the daemon when
 '--profile' is used.
Date: Sat,  2 Oct 2021 12:22:37 +0200
Message-Id: <20211002102240.27815-7-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This further speeds up the 'guix environment -p PROFILE' case.

* guix/scripts/environment.scm (guix-environment*)[store-needed?]: New
variable.
[with-store/maybe]: New macro.
Use it instead of 'with-store', and remove 'with-build-handler' form.
---
 guix/scripts/environment.scm | 169 +++++++++++++++++++----------------
 1 file changed, 93 insertions(+), 76 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 32f376fdd2..e23d52df39 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -691,6 +691,26 @@ command-line option processing with 'parse-command-line'."
            (mappings   (pick-all opts 'file-system-mapping))
            (white-list (pick-all opts 'inherit-regexp)))
 
+      (define store-needed?
+        ;; Whether connecting to the daemon is needed.
+        (or container? (not profile)))
+
+      (define-syntax-rule (with-store/maybe store exp ...)
+        ;; Evaluate EXP... with STORE bound to a connection, unless
+        ;; STORE-NEEDED? is false, in which case STORE is bound to #f.
+        (let ((proc (lambda (store) exp ...)))
+          (if store-needed?
+              (with-store s
+                (set-build-options-from-command-line s opts)
+                (with-build-handler (build-notifier #:use-substitutes?
+                                                    (assoc-ref opts 'substitutes?)
+                                                    #:verbosity
+                                                    (assoc-ref opts 'verbosity)
+                                                    #:dry-run?
+                                                    (assoc-ref opts 'dry-run?))
+                  (proc s)))
+              (proc #f))))
+
       (when container? (assert-container-features))
 
       (when (and (not container?) link-prof?)
@@ -701,88 +721,85 @@ command-line option processing with 'parse-command-line'."
         (leave (G_ "--no-cwd cannot be used without --container~%")))
 
 
-      (with-store store
-        (with-build-handler (build-notifier #:use-substitutes?
-                                            (assoc-ref opts 'substitutes?)
-                                            #:verbosity
-                                            (assoc-ref opts 'verbosity)
-                                            #:dry-run?
-                                            (assoc-ref opts 'dry-run?))
-          (with-status-verbosity (assoc-ref opts 'verbosity)
-            (define manifest-from-opts
-              (options/resolve-packages store opts))
+      (with-store/maybe store
+        (with-status-verbosity (assoc-ref opts 'verbosity)
+          (define manifest-from-opts
+            (options/resolve-packages store opts))
 
-            (define manifest
-              (if profile
-                  (profile-manifest profile)
-                  manifest-from-opts))
+          (define manifest
+            (if profile
+                (profile-manifest profile)
+                manifest-from-opts))
 
-            (when (and profile
-                       (> (length (manifest-entries manifest-from-opts)) 0))
-              (leave (G_ "'--profile' cannot be used with package options~%")))
+          (when (and profile
+                     (> (length (manifest-entries manifest-from-opts)) 0))
+            (leave (G_ "'--profile' cannot be used with package options~%")))
 
-            (when (null? (manifest-entries manifest))
-              (warning (G_ "no packages specified; creating an empty environment~%")))
+          (when (null? (manifest-entries manifest))
+            (warning (G_ "no packages specified; creating an empty environment~%")))
 
-            (set-build-options-from-command-line store opts)
+          ;; Use the bootstrap Guile when requested.
+          (parameterize ((%graft? (assoc-ref opts 'graft?))
+                         (%guile-for-build
+                          (and store-needed?
+                               (package-derivation
+                                store
+                                (if bootstrap?
+                                    %bootstrap-guile
+                                    (default-guile))))))
+            (run-with-store store
+              ;; Containers need a Bourne shell at /bin/sh.
+              (mlet* %store-monad ((bash       (environment-bash container?
+                                                                 bootstrap?
+                                                                 system))
+                                   (prof-drv   (if profile
+                                                   (return #f)
+                                                   (manifest->derivation
+                                                    manifest system bootstrap?)))
+                                   (profile -> (if profile
+                                                   (readlink* profile)
+                                                   (derivation->output-path prof-drv)))
+                                   (gc-root -> (assoc-ref opts 'gc-root)))
 
-            ;; Use the bootstrap Guile when requested.
-            (parameterize ((%graft? (assoc-ref opts 'graft?))
-                           (%guile-for-build
-                            (and (or container? (not profile))
-                                 (package-derivation
-                                  store
-                                  (if bootstrap?
-                                      %bootstrap-guile
-                                      (default-guile))))))
-              (run-with-store store
-                ;; Containers need a Bourne shell at /bin/sh.
-                (mlet* %store-monad ((bash       (environment-bash container?
-                                                                   bootstrap?
-                                                                   system))
-                                     (prof-drv   (if profile
-                                                     (return #f)
-                                                     (manifest->derivation
-                                                      manifest system bootstrap?)))
-                                     (profile -> (if profile
-                                                     (readlink* profile)
-                                                     (derivation->output-path prof-drv)))
-                                     (gc-root -> (assoc-ref opts 'gc-root)))
-
-                  ;; First build the inputs.  This is necessary even for
-                  ;; --search-paths.  Additionally, we might need to build bash for
-                  ;; a container.
-                  (mbegin %store-monad
+                ;; First build the inputs.  This is necessary even for
+                ;; --search-paths.  Additionally, we might need to build bash for
+                ;; a container.
+                (mbegin %store-monad
+                  (mwhen store-needed?
                     (built-derivations (append
                                            (if prof-drv (list prof-drv) '())
-                                           (if (derivation? bash) (list bash) '())))
-                    (mwhen gc-root
-                      (register-gc-root profile gc-root))
+                                           (if (derivation? bash) (list bash) '()))))
+                  (mwhen gc-root
+                    (register-gc-root profile gc-root))
 
-                    (cond
-                     ((assoc-ref opts 'search-paths)
-                      (show-search-paths profile manifest #:pure? pure?)
-                      (return #t))
-                     (container?
-                      (let ((bash-binary
-                             (if bootstrap?
-                                 (derivation->output-path bash)
-                                 (string-append (derivation->output-path bash)
-                                                "/bin/sh"))))
-                        (launch-environment/container #:command command
-                                                      #:bash bash-binary
-                                                      #:user user
-                                                      #:user-mappings mappings
-                                                      #:profile profile
-                                                      #:manifest manifest
-                                                      #:white-list white-list
-                                                      #:link-profile? link-prof?
-                                                      #:network? network?
-                                                      #:map-cwd? (not no-cwd?))))
+                  (cond
+                   ((assoc-ref opts 'search-paths)
+                    (show-search-paths profile manifest #:pure? pure?)
+                    (return #t))
+                   (container?
+                    (let ((bash-binary
+                           (if bootstrap?
+                               (derivation->output-path bash)
+                               (string-append (derivation->output-path bash)
+                                              "/bin/sh"))))
+                      (launch-environment/container #:command command
+                                                    #:bash bash-binary
+                                                    #:user user
+                                                    #:user-mappings mappings
+                                                    #:profile profile
+                                                    #:manifest manifest
+                                                    #:white-list white-list
+                                                    #:link-profile? link-prof?
+                                                    #:network? network?
+                                                    #:map-cwd? (not no-cwd?))))
 
-                     (else
-                      (return
-                       (exit/status
-                        (launch-environment/fork command profile manifest
-                                                 #:white-list white-list
-                                                 #:pure? pure?)))))))))))))))
+                   (else
+                    (return
+                     (exit/status
+                      (launch-environment/fork command profile manifest
+                                               #:white-list white-list
+                                               #:pure? pure?))))))))))))))
+
+;;; Local Variables:
+;;; (put 'with-store/maybe 'scheme-indent-function 1)
+;;; End:
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:12 2021
Received: from localhost ([127.0.0.1]:57963 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAh-0007Wl-Os
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33134)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAW-0007UL-2L
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49198)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAQ-0007eo-Ss; Sat, 02 Oct 2021 06:22:54 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAQ-0007gb-E9; Sat, 02 Oct 2021 06:22:54 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 06/10] environment: Skip derivation computation when
 '--profile' is used.
Date: Sat,  2 Oct 2021 12:22:36 +0200
Message-Id: <20211002102240.27815-6-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/scripts/environment.scm (guix-environment*): Bypass calls to
'package-derivation' and to 'manifest->derivation' when PROFILE is
true.
---
 guix/scripts/environment.scm | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 77956fc018..32f376fdd2 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -729,18 +729,21 @@ command-line option processing with 'parse-command-line'."
             ;; Use the bootstrap Guile when requested.
             (parameterize ((%graft? (assoc-ref opts 'graft?))
                            (%guile-for-build
-                            (package-derivation
-                             store
-                             (if bootstrap?
-                                 %bootstrap-guile
-                                 (default-guile)))))
+                            (and (or container? (not profile))
+                                 (package-derivation
+                                  store
+                                  (if bootstrap?
+                                      %bootstrap-guile
+                                      (default-guile))))))
               (run-with-store store
                 ;; Containers need a Bourne shell at /bin/sh.
                 (mlet* %store-monad ((bash       (environment-bash container?
                                                                    bootstrap?
                                                                    system))
-                                     (prof-drv   (manifest->derivation
-                                                  manifest system bootstrap?))
+                                     (prof-drv   (if profile
+                                                     (return #f)
+                                                     (manifest->derivation
+                                                      manifest system bootstrap?)))
                                      (profile -> (if profile
                                                      (readlink* profile)
                                                      (derivation->output-path prof-drv)))
@@ -750,9 +753,9 @@ command-line option processing with 'parse-command-line'."
                   ;; --search-paths.  Additionally, we might need to build bash for
                   ;; a container.
                   (mbegin %store-monad
-                    (built-derivations (if (derivation? bash)
-                                           (list prof-drv bash)
-                                           (list prof-drv)))
+                    (built-derivations (append
+                                           (if prof-drv (list prof-drv) '())
+                                           (if (derivation? bash) (list bash) '())))
                     (mwhen gc-root
                       (register-gc-root profile gc-root))
 
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:11 2021
Received: from localhost ([127.0.0.1]:57961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAh-0007Wd-AF
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAU-0007UI-EU
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:22:59 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49194)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAP-0007ct-8y; Sat, 02 Oct 2021 06:22:53 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAO-0007gb-Tv; Sat, 02 Oct 2021 06:22:53 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 04/10] DRAFT shell: By default load the local 'guix.scm' or
 'manifest.scm' file.
Date: Sat,  2 Oct 2021 12:22:34 +0200
Message-Id: <20211002102240.27815-4-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

DRAFT: Add doc.

* guix/scripts/shell.scm (parse-args): Add call to 'auto-detect-manifest'.
(find-file-in-parent-directories, auto-detect-manifest): New procedures.
* tests/guix-shell.sh: Add test.
---
 guix/scripts/shell.scm | 44 ++++++++++++++++++++++++++++++++++++++++--
 tests/guix-shell.sh    | 16 +++++++++++++++
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index 6a4b7a5092..2f15befbd3 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -22,6 +22,8 @@
   #:autoload   (guix scripts build) (show-build-options-help)
   #:autoload   (guix transformations) (show-transformation-options-help)
   #:use-module (guix scripts)
+  #:use-module (guix packages)
+  #:use-module (guix profiles)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-37)
@@ -121,13 +123,51 @@ interactive shell in that environment.\n"))
   ;; The '--' token is used to separate the command to run from the rest of
   ;; the operands.
   (let ((args command (break (cut string=? "--" <>) args)))
-    (let ((opts (parse-command-line args %options (list %default-options)
-                                    #:argument-handler handle-argument)))
+    (let ((opts (auto-detect-manifest
+                 (parse-command-line args %options (list %default-options)
+                                     #:argument-handler handle-argument))))
       (match command
         (() opts)
         (("--") opts)
         (("--" command ...) (alist-cons 'exec command opts))))))
 
+(define (find-file-in-parent-directories candidates)
+  "Find one of CANDIDATES in the current directory or one of its ancestors."
+  (let loop ((directory (getcwd)))
+    (and (= (stat:uid (stat directory)) (getuid))
+         (or (any (lambda (candidate)
+                    (let ((candidate (string-append directory "/" candidate)))
+                      (and (file-exists? candidate) candidate)))
+                  candidates)
+             (loop (string-append directory "/..")))))) ;Unix ".." resolution
+
+(define (auto-detect-manifest opts)
+  "If OPTS do not specify packages or a manifest, load a \"guix.scm\" or
+\"manifest.scm\" file from the current directory or one of its ancestors.
+Return the modified OPTS."
+  (define (options-contain-payload? opts)
+    (match opts
+      (() #f)
+      ((('package . _) . _) #t)
+      ((('load . _) . _) #t)
+      ((('manifest . _) . _) #t)
+      ((('expression . _) . _) #t)
+      ((_ . rest) (options-contain-payload? rest))))
+
+  (if (options-contain-payload? opts)
+      opts
+      (match (find-file-in-parent-directories '("guix.scm" "manifest.scm"))
+        (#f
+         (warning (G_ "no packages specified; creating an empty environment~%"))
+         opts)
+        (file
+         (info (G_ "loading environment from '~a'...~%") file)
+         (match (basename file)
+           ("guix.scm"
+            (alist-cons 'load `(package ,file) opts))
+           ("manifest.scm"
+            (alist-cons 'manifest file opts)))))))
+
 
 (define-command (guix-shell . args)
   (category development)
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
index f08637f7ff..498c1c5515 100644
--- a/tests/guix-shell.sh
+++ b/tests/guix-shell.sh
@@ -31,6 +31,16 @@ guix shell --bootstrap --pure guile-bootstrap -- guile --version
 # '--ad-hoc' is a thing of the past.
 ! guix shell --ad-hoc guile-bootstrap
 
+# Honoring the local 'manifest.scm' file.
+cat > "$tmpdir/manifest.scm" <<EOF
+(specifications->manifest '("guile-bootstrap"))
+EOF
+profile1="$(cd "$tmpdir"; guix shell --bootstrap -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT')"
+profile2="$(guix shell --bootstrap guile-bootstrap -- "$SHELL" -c 'echo $GUIX_ENVIRONMENT')"
+test -n "$profile1"
+test "$profile1" = "$profile2"
+rm "$tmpdir/manifest.scm"
+
 if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
 then
     # Compute the build environment for the initial GNU Make.
@@ -51,4 +61,10 @@ then
 
     # 'make-boot0' itself must not be listed.
     ! guix gc --references "$profile" | grep make-boot0
+
+    # Honoring the local 'guix.scm' file.
+    echo '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/guix.scm"
+    (cd "$tmpdir"; guix shell --bootstrap --search-paths --pure > "b")
+    cmp "$tmpdir/a" "$tmpdir/b"
+    rm "$tmpdir/guix.scm"
 fi
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:11 2021
Received: from localhost ([127.0.0.1]:57954 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAW-0007V8-Pu
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33120)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAT-0007UG-TX
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:22:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49192)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAO-0007ci-IF; Sat, 02 Oct 2021 06:22:52 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAO-0007gb-8c; Sat, 02 Oct 2021 06:22:52 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 03/10] DRAFT Add 'guix shell'.
Date: Sat,  2 Oct 2021 12:22:33 +0200
Message-Id: <20211002102240.27815-3-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludovic.courtes@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Ludovic Courtès <ludovic.courtes@HIDDEN>

DRAFT: Add doc.  Print deprecation warning for 'guix environment'?

* guix/scripts/shell.scm, tests/guix-shell.sh: New files.
* Makefile.am (MODULES): Add 'shell.scm'.
(SH_TESTS): Add 'tests/guix-shell.sh'.
* guix/scripts/environment.scm (show-environment-options-help): New
procedure.
(show-help): Use it.
(guix-environment*): New procedure.
(guix-environment): Use it.
* po/guix/POTFILES.in: Add it.
---
 Makefile.am                  |   2 +
 guix/scripts/environment.scm |  52 +++++++++-----
 guix/scripts/shell.scm       | 136 +++++++++++++++++++++++++++++++++++
 po/guix/POTFILES.in          |   1 +
 tests/guix-shell.sh          |  54 ++++++++++++++
 5 files changed, 228 insertions(+), 17 deletions(-)
 create mode 100644 guix/scripts/shell.scm
 create mode 100644 tests/guix-shell.sh

diff --git a/Makefile.am b/Makefile.am
index b66789fa0b..c28c8799ec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -315,6 +315,7 @@ MODULES =					\
   guix/scripts/import/stackage.scm		\
   guix/scripts/import/texlive.scm  		\
   guix/scripts/environment.scm			\
+  guix/scripts/shell.scm			\
   guix/scripts/publish.scm			\
   guix/scripts/edit.scm				\
   guix/scripts/size.scm				\
@@ -550,6 +551,7 @@ SH_TESTS =					\
   tests/guix-authenticate.sh			\
   tests/guix-environment.sh			\
   tests/guix-environment-container.sh		\
+  tests/guix-shell.sh				\
   tests/guix-graph.sh				\
   tests/guix-describe.sh			\
   tests/guix-repl.sh     			\
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 54f48a7482..77956fc018 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -50,7 +50,11 @@
   #:use-module (srfi srfi-37)
   #:use-module (srfi srfi-98)
   #:export (assert-container-features
-            guix-environment))
+            guix-environment
+            guix-environment*
+            show-environment-options-help
+            (%options . %environment-options)
+            (%default-options . %environment-default-options)))
 
 (define %default-shell
   (or (getenv "SHELL") "/bin/sh"))
@@ -66,23 +70,16 @@ do not augment existing environment variables with additional search paths."
                (newline)))
             (profile-search-paths profile manifest)))
 
-(define (show-help)
-  (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
-Build an environment that includes the dependencies of PACKAGE and execute
-COMMAND or an interactive shell in that environment.\n"))
+(define (show-environment-options-help)
+  "Print help about options shared between 'guix environment' and 'guix
+shell'."
   (display (G_ "
   -e, --expression=EXPR  create environment for the package that EXPR
                          evaluates to"))
   (display (G_ "
-  -l, --load=FILE        create environment for the package that the code within
-                         FILE evaluates to"))
-  (display (G_ "
   -m, --manifest=FILE    create environment with the manifest from FILE"))
   (display (G_ "
   -p, --profile=PATH     create environment from profile at PATH"))
-  (display (G_ "
-      --ad-hoc           include all specified packages in the environment instead
-                         of only their inputs"))
   (display (G_ "
       --pure             unset existing environment variables"))
   (display (G_ "
@@ -118,7 +115,24 @@ COMMAND or an interactive shell in that environment.\n"))
   (display (G_ "
   -v, --verbosity=LEVEL  use the given verbosity LEVEL"))
   (display (G_ "
-      --bootstrap        use bootstrap binaries to build the environment"))
+      --bootstrap        use bootstrap binaries to build the environment")))
+
+(define (show-help)
+  (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
+Build an environment that includes the dependencies of PACKAGE and execute
+COMMAND or an interactive shell in that environment.\n"))
+  (warning (G_ "This command is deprecated in favor of 'guix shell'.\n"))
+  (newline)
+
+  ;; These two options are left out in 'guix shell'.
+  (display (G_ "
+  -l, --load=FILE        create environment for the package that the code within
+                         FILE evaluates to"))
+  (display (G_ "
+      --ad-hoc           include all specified packages in the environment instead
+                         of only their inputs"))
+
+  (show-environment-options-help)
   (newline)
   (show-build-options-help)
   (newline)
@@ -649,11 +663,15 @@ message if any test fails."
 
 (define-command (guix-environment . args)
   (category development)
-  (synopsis "spawn one-off software environments")
+  (synopsis "spawn one-off software environments (deprecated)")
 
+  (guix-environment* (parse-args args)))
+
+(define (guix-environment* opts)
+  "Run the 'guix environment' command on OPTS, an alist resulting for
+command-line option processing with 'parse-command-line'."
   (with-error-handling
-    (let* ((opts       (parse-args args))
-           (pure?      (assoc-ref opts 'pure))
+    (let* ((pure?      (assoc-ref opts 'pure))
            (container? (assoc-ref opts 'container?))
            (link-prof? (assoc-ref opts 'link-profile?))
            (network?   (assoc-ref opts 'network?))
@@ -724,8 +742,8 @@ message if any test fails."
                                      (prof-drv   (manifest->derivation
                                                   manifest system bootstrap?))
                                      (profile -> (if profile
-                                                   (readlink* profile)
-                                                   (derivation->output-path prof-drv)))
+                                                     (readlink* profile)
+                                                     (derivation->output-path prof-drv)))
                                      (gc-root -> (assoc-ref opts 'gc-root)))
 
                   ;; First build the inputs.  This is necessary even for
diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
new file mode 100644
index 0000000000..6a4b7a5092
--- /dev/null
+++ b/guix/scripts/shell.scm
@@ -0,0 +1,136 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts shell)
+  #:use-module (guix ui)
+  #:use-module (guix scripts environment)
+  #:autoload   (guix scripts build) (show-build-options-help)
+  #:autoload   (guix transformations) (show-transformation-options-help)
+  #:use-module (guix scripts)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:use-module (srfi srfi-71)
+  #:use-module (ice-9 match)
+  #:export (guix-shell))
+
+(define (show-help)
+  (display (G_ "Usage: guix shell [OPTION] PACKAGES... [-- COMMAND...]
+Build an environment that includes PACKAGES and execute COMMAND or an
+interactive shell in that environment.\n"))
+  (newline)
+
+  ;; These two options differ from 'guix environment'.
+  (display (G_ "
+  -D, --development      include the development inputs of the next package"))
+  (display (G_ "
+  -f, --install-from-file=FILE
+                         install the package that the code within FILE
+                         evaluates to"))
+
+  (show-environment-options-help)
+  (newline)
+  (show-build-options-help)
+  (newline)
+  (show-transformation-options-help)
+  (newline)
+  (display (G_ "
+  -h, --help             display this help and exit"))
+  (display (G_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define (tag-package-arg opts arg)
+  "Return a two-element list with the form (TAG ARG) that tags ARG with either
+'ad-hoc' in OPTS has the 'ad-hoc?' key set to #t, or 'inputs' otherwise."
+  (if (assoc-ref opts 'ad-hoc?)
+      `(ad-hoc-package ,arg)
+      `(package ,arg)))
+
+(define (ensure-ad-hoc alist)
+  (if (assq-ref alist 'ad-hoc?)
+      alist
+      `((ad-hoc? . #t) ,@alist)))
+
+(define (wrapped-option opt)
+  "Wrap OPT, a SRFI-37 option, such that its processor always adds the
+'ad-hoc?' flag to the resulting alist."
+  (option (option-names opt)
+          (option-required-arg? opt)
+          (option-optional-arg? opt)
+          (compose ensure-ad-hoc (option-processor opt))))
+
+(define %options
+  ;; Specification of the command-line options.
+  (let ((to-remove '("ad-hoc" "inherit" "load" "help" "version")))
+    (append
+        (list (option '(#\h "help") #f #f
+                      (lambda args
+                        (show-help)
+                        (exit 0)))
+              (option '(#\V "version") #f #f
+                      (lambda args
+                        (show-version-and-exit "guix shell")))
+
+              (option '(#\D "development") #f #f
+                      (lambda (opt name arg result)
+                        ;; Temporarily remove the 'ad-hoc?' flag from result.
+                        ;; The next option will put it back thanks to
+                        ;; 'wrapped-option'.
+                        (alist-delete 'ad-hoc? result)))
+
+              ;; For consistency with 'guix package', support '-f' rather than
+              ;; '-l' like 'guix environment' does.
+              (option '(#\f "install-from-file") #t #f
+                      (lambda (opt name arg result)
+                        (alist-cons 'load (tag-package-arg result arg)
+                                    result))))
+        (filter-map (lambda (opt)
+                      (and (not (any (lambda (name)
+                                       (member name to-remove))
+                                     (option-names opt)))
+                           (wrapped-option opt)))
+                    %environment-options))))
+
+(define %default-options
+  `((ad-hoc? . #t)                                ;always true
+    ,@%environment-default-options))
+
+(define (parse-args args)
+  "Parse the list of command line arguments ARGS."
+  (define (handle-argument arg result)
+    (alist-cons 'package (tag-package-arg result arg)
+                (ensure-ad-hoc result)))
+
+  ;; The '--' token is used to separate the command to run from the rest of
+  ;; the operands.
+  (let ((args command (break (cut string=? "--" <>) args)))
+    (let ((opts (parse-command-line args %options (list %default-options)
+                                    #:argument-handler handle-argument)))
+      (match command
+        (() opts)
+        (("--") opts)
+        (("--" command ...) (alist-cons 'exec command opts))))))
+
+
+(define-command (guix-shell . args)
+  (category development)
+  (synopsis "spawn one-off software environments")
+
+  (guix-environment* (parse-args args)))
diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in
index f5b76bf582..f8abeb2d38 100644
--- a/po/guix/POTFILES.in
+++ b/po/guix/POTFILES.in
@@ -99,6 +99,7 @@ guix/derivations.scm
 guix/scripts/archive.scm
 guix/scripts/build.scm
 guix/scripts/environment.scm
+guix/scripts/shell.scm
 guix/scripts/time-machine.scm
 guix/scripts/import/cpan.scm
 guix/scripts/import/crate.scm
diff --git a/tests/guix-shell.sh b/tests/guix-shell.sh
new file mode 100644
index 0000000000..f08637f7ff
--- /dev/null
+++ b/tests/guix-shell.sh
@@ -0,0 +1,54 @@
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2021 Ludovic Courtès <ludo@HIDDEN>
+#
+# This file is part of GNU Guix.
+#
+# GNU Guix is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# GNU Guix is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# Test the 'guix shell' alias.
+#
+
+guix shell --version
+
+tmpdir="t-guix-shell-$$"
+trap 'rm -r "$tmpdir"' EXIT
+mkdir "$tmpdir"
+
+guix shell --bootstrap --pure guile-bootstrap -- guile --version
+
+# '--ad-hoc' is a thing of the past.
+! guix shell --ad-hoc guile-bootstrap
+
+if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
+then
+    # Compute the build environment for the initial GNU Make.
+    guix shell --bootstrap --no-substitutes --search-paths --pure \
+         -D -e '(@ (guix tests) gnu-make-for-tests)' > "$tmpdir/a"
+
+    # Make sure bootstrap binaries are in the profile.
+    profile=`grep "^export PATH" "$tmpdir/a" | sed -r 's|^.*="(.*)/bin"|\1|'`
+
+    # Make sure the bootstrap binaries are all listed where they belong.
+    grep -E "^export PATH=\"$profile/bin\""         "$tmpdir/a"
+    grep -E "^export CPATH=\"$profile/include\""    "$tmpdir/a"
+    grep -E "^export LIBRARY_PATH=\"$profile/lib\"" "$tmpdir/a"
+    for dep in bootstrap-binaries-0 gcc-bootstrap-0 glibc-bootstrap-0
+    do
+	guix gc --references "$profile" | grep "$dep"
+    done
+
+    # 'make-boot0' itself must not be listed.
+    ! guix gc --references "$profile" | grep make-boot0
+fi
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:23:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:23:00 2021
Received: from localhost ([127.0.0.1]:57951 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAW-0007Uz-5h
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:23:00 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33116)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAT-0007UF-RC
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:22:58 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49190)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAN-0007c3-TB; Sat, 02 Oct 2021 06:22:51 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAN-0007gb-JG; Sat, 02 Oct 2021 06:22:51 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 02/10] profiles: Add 'package->development-manifest'.
Date: Sat,  2 Oct 2021 12:22:32 +0200
Message-Id: <20211002102240.27815-2-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211002102240.27815-1-ludo@HIDDEN>
References: <20211002102240.27815-1-ludo@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludovic.courtes@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

From: Ludovic Courtès <ludovic.courtes@HIDDEN>

* guix/profiles.scm (package->development-manifest): New procedure.
* guix/scripts/environment.scm (input->manifest-entry)
(package-environment-inputs): Remove.
* guix/scripts/environment.scm (options/resolve-packages): Use
'package->development-manifest' instead of 'package-environment-inputs'.
* tests/profiles.scm ("package->development-manifest"): New test.
---
 doc/guix.texi                | 11 +++++++++++
 guix/profiles.scm            | 19 +++++++++++++++++++
 guix/scripts/environment.scm | 27 +++++----------------------
 tests/profiles.scm           |  7 +++++++
 4 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 49399e792b..bc3f5a537b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3340,6 +3340,17 @@ objects, like this:
  '("emacs" "guile@@2.2" "guile@@2.2:debug"))
 @end lisp
 
+@findex package->development-manifest
+You might also want to create a manifest for all the dependencies of a
+package, rather than the package itself:
+
+@lisp
+(package->development-manifest (specification->package "emacs"))
+@end lisp
+
+The example above gives you all the software required to develop Emacs,
+similar to what @command{guix environment emacs} provides.
+
 @xref{export-manifest, @option{--export-manifest}}, to learn how to
 obtain a manifest file from an existing profile.
 
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 2486f91d09..9f30349c69 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -124,6 +124,7 @@
 
             profile-manifest
             package->manifest-entry
+            package->development-manifest
             packages->manifest
             ca-certificate-bundle
             %default-profile-hooks
@@ -400,6 +401,24 @@ file name."
                      (properties properties))))
     entry))
 
+(define* (package->development-manifest package
+                                        #:optional
+                                        (system (%current-system))
+                                        #:key target)
+  "Return a manifest for the \"development inputs\" of PACKAGE for SYSTEM,
+optionally when cross-compiling to TARGET.  Development inputs include both
+explicit and implicit inputs of PACKAGE."
+  (manifest
+   (filter-map (match-lambda
+                 ((label (? package? package))
+                  (package->manifest-entry package))
+                 ((label (? package? package) output)
+                  (package->manifest-entry package output))
+                 ;; TODO: Support <inferior-package>.
+                 (_
+                  #f))
+               (package-development-inputs package system #:target target))))
+
 (define (packages->manifest packages)
   "Return a list of manifest entries, one for each item listed in PACKAGES.
 Elements of PACKAGES can be either package objects or package/string tuples
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index d555969b27..54f48a7482 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -66,24 +66,6 @@ do not augment existing environment variables with additional search paths."
                (newline)))
             (profile-search-paths profile manifest)))
 
-(define (input->manifest-entry input)
-  "Return a manifest entry for INPUT, or #f if INPUT does not correspond to a
-package."
-  (match input
-    ((_ (? package? package))
-     (package->manifest-entry package))
-    ((_ (? package? package) output)
-     (package->manifest-entry package output))
-    (_
-     #f)))
-
-(define (package-environment-inputs package)
-  "Return a list of manifest entries corresponding to the transitive input
-packages for PACKAGE."
-  ;; Remove non-package inputs such as origin records.
-  (filter-map input->manifest-entry
-              (package-development-inputs package system)))
-
 (define (show-help)
   (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
 Build an environment that includes the dependencies of PACKAGE and execute
@@ -297,11 +279,11 @@ for the corresponding packages."
       ((? package? package)
        (if (eq? mode 'ad-hoc-package)
            (list (package->manifest-entry* package))
-           (package-environment-inputs package)))
+           (manifest-entries (package->development-manifest package))))
       (((? package? package) (? string? output))
        (if (eq? mode 'ad-hoc-package)
            (list (package->manifest-entry* package output))
-           (package-environment-inputs package)))
+           (manifest-entries (package->development-manifest package))))
       ((lst ...)
        (append-map (cut packages->outputs <> mode) lst))))
 
@@ -313,8 +295,9 @@ for the corresponding packages."
                                  (specification->package+output spec)))
                      (list (package->manifest-entry* package output))))
                   (('package 'package (? string? spec))
-                   (package-environment-inputs
-                    (transform (specification->package+output spec))))
+                   (manifest-entries
+                    (package->development-manifest
+                     (transform (specification->package+output spec)))))
                   (('expression mode str)
                    ;; Add all the outputs of the package STR evaluates to.
                    (packages->outputs (read/eval str) mode))
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 06a0387221..cac5b73347 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -265,6 +265,13 @@
            (manifest-transaction-removal-candidate? guile-2.0.9 t)
            (null? install) (null? downgrade) (null? upgrade)))))
 
+(test-assert "package->development-manifest"
+  (let ((manifest (package->development-manifest packages:hello)))
+    (every (lambda (name)
+             (manifest-installed? manifest
+                                  (manifest-pattern (name name))))
+           '("gcc" "binutils" "glibc" "coreutils" "grep" "sed"))))
+
 (test-assertm "profile-derivation"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at 50960 <at> debbugs.gnu.org:


Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 10:22:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:22:59 2021
Received: from localhost ([127.0.0.1]:57946 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWcAT-0007UZ-Vf
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:22:59 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33114)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWcAS-0007UB-H9
 for 50960 <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:22:56 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49188)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAN-0007b7-Bf; Sat, 02 Oct 2021 06:22:51 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36460 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWcAJ-0007gb-7w; Sat, 02 Oct 2021 06:22:51 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: 50960 <at> debbugs.gnu.org
Subject: [PATCH 01/10] packages: Add 'package-development-inputs'.
Date: Sat,  2 Oct 2021 12:22:31 +0200
Message-Id: <20211002102240.27815-1-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50960
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

* guix/packages.scm (package-development-inputs): New procedure.
* guix/scripts/environment.scm (package-environment-inputs): Use it.
* tests/packages.scm ("package-development-inputs")
("package-development-inputs, cross-compilation"): New tests.
* doc/guix.texi (package Reference): Document it.
---
 doc/guix.texi                | 41 ++++++++++++++++++++++++++++++++++++
 guix/packages.scm            | 10 +++++++++
 guix/scripts/environment.scm |  2 +-
 tests/packages.scm           | 14 ++++++++++++
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a72a726b54..49399e792b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6847,6 +6847,47 @@ cross-compiling:
 It is an error to refer to @code{this-package} outside a package definition.
 @end deffn
 
+@cindex development inputs, of a package
+@cindex implicit inputs, of a package
+Sometimes you will want to obtain the list of inputs needed to
+@emph{develop} a package---all the inputs that are visible when the
+package is compiled.  This is what the @code{package-development-inputs}
+procedure returns.
+
+@deffn {Scheme Procedure} package-development-inputs @var{package} @
+   [@var{system}] [#:target #f]
+Return the list of inputs required by @var{package} for development
+purposes on @var{system}.  When @var{target} is true, return the inputs
+needed to cross-compile @var{package} from @var{system} to
+@var{triplet}, where @var{triplet} is a triplet such as
+@code{"aarch64-linux-gnu"}.
+
+Note that the result includes both explicit inputs and implicit
+inputs---inputs automatically added by the build system (@pxref{Build
+Systems}).  Let us take the @code{hello} package to illustrate that:
+
+@lisp
+(use-modules (gnu packages base) (guix packages))
+
+hello
+@result{} #<package hello@@2.10 gnu/packages/base.scm:79 7f585d4f6790>
+
+(package-direct-inputs hello)
+@result{} ()
+
+(package-development-inputs hello)
+@result{} (("source" @dots{}) ("tar" #<package tar@@1.32 @dots{}>) @dots{})
+@end lisp
+
+In this example, @code{package-direct-inputs} returns the empty list,
+because @code{hello} has zero explicit dependencies.  Conversely,
+@code{package-development-inputs} includes inputs implicitly added by
+@code{gnu-build-system} that are required to build @code{hello}: tar,
+gzip, GCC, libc, Bash, and more.  To visualize it, @command{guix graph
+hello} would show you explicit inputs, whereas @command{guix graph -t
+bag hello} would include implicit inputs (@pxref{Invoking guix graph}).
+@end deffn
+
 Because packages are regular Scheme objects that capture a complete
 dependency graph and associated build procedures, it is often useful to
 write procedures that take a package and return a modified version
diff --git a/guix/packages.scm b/guix/packages.scm
index 8c3a0b0b7b..43e0130793 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -153,6 +153,7 @@
             bag-transitive-host-inputs
             bag-transitive-build-inputs
             bag-transitive-target-inputs
+            package-development-inputs
             package-closure
 
             default-guile
@@ -1070,6 +1071,15 @@ dependencies are known to build on SYSTEM."
                  (%current-system (bag-system bag)))
     (transitive-inputs (bag-target-inputs bag))))
 
+(define* (package-development-inputs package
+                                     #:optional (system (%current-system))
+                                     #:key target)
+  "Return the list of inputs required by PACKAGE for development purposes on
+SYSTEM.  When TARGET is true, return the inputs needed to cross-compile
+PACKAGE from SYSTEM to TRIPLET, where TRIPLET is a triplet such as
+\"aarch64-linux-gnu\"."
+  (bag-transitive-inputs (package->bag package system target)))
+
 (define* (package-closure packages #:key (system (%current-system)))
   "Return the closure of PACKAGES on SYSTEM--i.e., PACKAGES and the list of
 packages they depend on, recursively."
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 6958bd6238..d555969b27 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -82,7 +82,7 @@ package."
 packages for PACKAGE."
   ;; Remove non-package inputs such as origin records.
   (filter-map input->manifest-entry
-              (bag-transitive-inputs (package->bag package))))
+              (package-development-inputs package system)))
 
 (define (show-help)
   (display (G_ "Usage: guix environment [OPTION]... PACKAGE... [-- COMMAND...]
diff --git a/tests/packages.scm b/tests/packages.scm
index 3756877270..266b5aeb7a 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -353,6 +353,20 @@
           (package-transitive-supported-systems d)
           (package-transitive-supported-systems e))))
 
+(test-assert "package-development-inputs"
+  ;; Note: Due to propagated inputs, 'package-development-inputs' returns a
+  ;; couple more inputs, such as 'linux-libre-headers'.
+  (lset<= equal?
+          `(("source" ,(package-source hello)) ,@(standard-packages))
+          (package-development-inputs hello)))
+
+(test-assert "package-development-inputs, cross-compilation"
+  (lset<= equal?
+          `(("source" ,(package-source hello))
+            ,@(standard-cross-packages "mips64el-linux-gnu" 'host)
+            ,@(standard-cross-packages "mips64el-linux-gnu" 'target))
+          (package-development-inputs hello #:target "mips64el-linux-gnu")))
+
 (test-assert "package-closure"
   (let-syntax ((dummy-package/no-implicit
                 (syntax-rules ()
-- 
2.33.0





Information forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Oct 2021 10:21:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Oct 02 06:21:39 2021
Received: from localhost ([127.0.0.1]:57928 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mWc96-0007RW-Oq
	for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:21:39 -0400
Received: from lists.gnu.org ([209.51.188.17]:55002)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1mWc94-0007RQ-Gq
 for submit <at> debbugs.gnu.org; Sat, 02 Oct 2021 06:21:31 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38050)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1mWc94-0001bP-9z
 for guix-patches@HIDDEN; Sat, 02 Oct 2021 06:21:30 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49164)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWc94-0006TD-2W; Sat, 02 Oct 2021 06:21:30 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36458 helo=gnu.org)
 by fencepost.gnu.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1)
 (envelope-from <ludo@HIDDEN>)
 id 1mWc93-0007Yz-OL; Sat, 02 Oct 2021 06:21:29 -0400
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 00/10] Add 'guix shell' to subsume 'guix environment'
Date: Sat,  2 Oct 2021 12:21:16 +0200
Message-Id: <20211002102116.27726-1-ludo@HIDDEN>
X-Mailer: git-send-email 2.33.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello Guix!

Here comes ‘guix shell’, a proposed replacement for ‘guix environment’!
‘guix environment’ would stay around though, at least for some time,
probably for a long time.

The differences to ‘guix environment’ are:

  1. ‘--ad-hoc’ is the default.

       ‘guix shell hello’ ≍ ‘guix environment --ad-hoc hello’
       ‘guix shell -D hello git’ ≍ ‘guix environment hello --ad-hoc git’

  2. ‘guix shell’, without arguments, loads ‘guix.scm’ or ‘manifest.scm’
     from the current directory or one of its ancestors.

  3. ‘--load’/‘-l’ is not ‘-f’/‘--install-from-file’ for consistency with
     ‘guix package’.

  4. ‘guix shell’ without arguments maintains a cache, such that, the
     second time you run it, it runs in ~0.1s (it does not even need to
     connect to the daemon).

     If you run ‘guix pull’ and run again ‘guix shell’, it recomputes
     the environment, as is currently the case with ‘guix environment’.

Here’s a summary of previous proposals:

  - Dave Thompson: https://lists.gnu.org/archive/html/guix-devel/2017-08/msg00300.html
    - [X] --ad-hoc is the default
    - [X] caching
    - [X] behavior with no arguments
    - [ ] --load accepts <environment>
    - [ ] Shepherd services
    - [ ] 'guix environment --update' to explicitly update
  - make --ad-hoc the default: https://issues.guix.gnu.org/38529
    - [X] https://issues.guix.gnu.org/38529#17: proposal for a new subcommand
          deprecation of ‘guix environment’

I think <environment> records and Shepherd services could come later.
As for ‘--update’, I prefer the behavior implemented here because it’s
stateless and thus more predictable.

Thoughts?  Are there other changes people would like to see?

If there’s rough consensus I can work on v2 with documentation.  Please
let’s keep the discussion focused.  :-)

As for deprecation, I think there’s no rush.  I imagine there could be
several phases, like: initially we only mention deprecation in the manual,
later on ‘guix environment’ starts emitting a warning, and later (I guess
at least two years later, probably more) we ask ourselves whether to
remove ‘guix environment’.  At this point keeping it doesn’t cost us much.

Thanks,
Ludo’.

Ludovic Courtès (10):
  packages: Add 'package-development-inputs'.
  profiles: Add 'package->development-manifest'.
  DRAFT Add 'guix shell'.
  DRAFT shell: By default load the local 'guix.scm' or 'manifest.scm'
    file.
  environment: Add tests for '--profile'.
  environment: Skip derivation computation when '--profile' is used.
  environment: Do not connect to the daemon when '--profile' is used.
  environment: Autoload some modules.
  cache: Gracefully handle non-existent cache.
  shell: Maintain a profile cache.

 Makefile.am                         |   2 +
 doc/guix.texi                       |  52 ++++++
 guix/cache.scm                      |  10 +-
 guix/packages.scm                   |  10 ++
 guix/profiles.scm                   |  19 ++
 guix/scripts/environment.scm        | 260 +++++++++++++++-------------
 guix/scripts/shell.scm              | 254 +++++++++++++++++++++++++++
 po/guix/POTFILES.in                 |   1 +
 tests/guix-environment-container.sh |   8 +
 tests/guix-environment.sh           |   7 +
 tests/guix-shell.sh                 |  70 ++++++++
 tests/packages.scm                  |  14 ++
 tests/profiles.scm                  |   7 +
 13 files changed, 594 insertions(+), 120 deletions(-)
 create mode 100644 guix/scripts/shell.scm
 create mode 100644 tests/guix-shell.sh

-- 
2.33.0





Acknowledgement sent to Ludovic Courtès <ludo@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#50960; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 13 Oct 2021 17:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.