From patchwork Sat Oct 2 10:21:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 355 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 588E227BBE3; Sat, 2 Oct 2021 11:22:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E9EC527BBE1 for ; Sat, 2 Oct 2021 11:22:11 +0100 (BST) Received: from localhost ([::1]:51612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWc9j-0001id-2k for patchwork@mira.cbaines.net; Sat, 02 Oct 2021 06:22:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWc9d-0001iT-2h for guix-patches@gnu.org; Sat, 02 Oct 2021 06:22:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWc9a-0006uX-HK for guix-patches@gnu.org; Sat, 02 Oct 2021 06:22:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWc9a-0007SI-9I for guix-patches@gnu.org; Sat, 02 Oct 2021 06:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] [PATCH 00/10] Add 'guix shell' to subsume 'guix environment' Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 10:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50960@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163317009928626 (code B ref -1); Sat, 02 Oct 2021 10:22:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Oct 2021 10:21:39 +0000 Received: from localhost ([127.0.0.1]:57928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWc96-0007RW-Oq for submit@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 ) id 1mWc94-0007RQ-Gq for submit@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 ) id 1mWc94-0001bP-9z for guix-patches@gnu.org; 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 ) 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 ) id 1mWc93-0007Yz-OL; Sat, 02 Oct 2021 06:21:29 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 2 Oct 2021 12:21:16 +0200 Message-Id: <20211002102116.27726-1-ludo@gnu.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 - [ ] 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 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