From patchwork Mon Oct 16 12:43:02 2023 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: 54867 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 F02E327BBEB; Mon, 16 Oct 2023 13:45:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 44F3727BBE2 for ; Mon, 16 Oct 2023 13:45:07 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qsMxl-0006dM-TR; Mon, 16 Oct 2023 08:44:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsMxb-0006aT-3U for guix-patches@gnu.org; Mon, 16 Oct 2023 08:44:40 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsMxa-0007JO-6v for guix-patches@gnu.org; Mon, 16 Oct 2023 08:44:38 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qsMxy-0008Mh-VO for guix-patches@gnu.org; Mon, 16 Oct 2023 08:45:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66577] [PATCH 3/4] doc: cookbook: Suggest =?utf-8?b?4oCYZ3Vp?= =?utf-8?b?eCBzaGVsbOKAmQ==?= as an alternative to multiple profiles. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Oct 2023 12:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66577 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66577@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 66577-submit@debbugs.gnu.org id=B66577.169746026832075 (code B ref 66577); Mon, 16 Oct 2023 12:45:02 +0000 Received: (at 66577) by debbugs.gnu.org; 16 Oct 2023 12:44:28 +0000 Received: from localhost ([127.0.0.1]:55467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsMxP-0008LB-J7 for submit@debbugs.gnu.org; Mon, 16 Oct 2023 08:44:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsMxN-0008Kr-9W for 66577@debbugs.gnu.org; Mon, 16 Oct 2023 08:44:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsMwg-000784-8z; Mon, 16 Oct 2023 08:43:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=d3oi5uupG96JyFR1gLHUQV0Id0gOlZzFwqDJ5qByVM0=; b=fASC7vZdpBNo8vwR+4QB XnM1+Q6bfvfniWLgGcow/njBbNH2CplrFQqmiBp1AbC3VmBNbhY0rKdWc/lAXwl9DPtQKgQD+B2KE c27fNJGUsaiR6stg5olafO8sMMLB2p+O7y37QQ2/j+T/IHaVjs/xsqfpr03paqhXp6+e51IOx5Ntp yJOA1rlJFHUJoTO/8SlG3Ysv5bSVXBDCqIl/hCEudWbwler+m1QljGjhNAwrHSUxUv4rcZNwMLp83 PR3/1WpbjiLsLRmqEn5IjMnL8UZkBhQ7wwt/rCrUWEnO3fJmf7dwXB/9zUH5Smlj0OtLMdKkwo+PT u5SIxc0FYAm8vw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 16 Oct 2023 14:43:02 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Multiple profiles are relatively hard to set up and maintain, especially for newcomers. Thus, suggest ‘guix shell’ as an alternative. * doc/guix-cookbook.texi (Guix Profiles in Practice): Add note linking to ‘guix shell’. (The benefits of manifests): Remove outdated info about ‘guix environment’ and profiles that may be GC’d. Update. --- doc/guix-cookbook.texi | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi index 712c131a51..1259f6aac7 100644 --- a/doc/guix-cookbook.texi +++ b/doc/guix-cookbook.texi @@ -3714,7 +3714,7 @@ Guix Profiles in Practice @section Guix Profiles in Practice Guix provides a very useful feature that may be quite foreign to newcomers: -@emph{profiles}. They are a way to group package installations together and all users +@dfn{profiles}. They are a way to group package installations together and all users on the same system are free to use as many profiles as they want. Whether you're a developer or not, you may find that multiple profiles bring you @@ -3722,6 +3722,16 @@ Guix Profiles in Practice @emph{traditional package managers}, they are very convenient to use once you've understood how to set them up. +@quotation Note +This section is an opinionated guide on the use of multiple profiles. +It predates @command{guix shell} and its fast profile cache +(@pxref{Invoking guix shell,,, guix, GNU Guix Reference Manual}). + +In many cases, you may find that using @command{guix shell} to set up +the environment you need, when you need it, is less work that +maintaining a dedicated profile. Your call! +@end quotation + If you are familiar with Python's @samp{virtualenv}, you can think of a profile as a kind of universal @samp{virtualenv} that can hold any kind of software whatsoever, not just Python software. Furthermore, profiles are self-sufficient: they capture @@ -4034,29 +4044,12 @@ The benefits of manifests they ``pin'' packages in the store, which prevents them from being garbage-collected (@pxref{Invoking guix gc,,, guix, GNU Guix Reference Manual}) and ensures that they will still be available at any point in -the future. +the future. The @command{guix shell} command also protects +recently-used profiles from garbage collection; profiles that have not +been used for a while may be garbage-collected though, along with the +packages they refer to. -Let's take an example: - -@enumerate -@item -We have an environment for hacking on a project for which there isn't a Guix -package yet. We build the environment using a manifest, and then run @code{guix - environment -m manifest.scm}. So far so good. - -@item -Many weeks pass and we have run a couple of @code{guix pull} in the mean time. -Maybe a dependency from our manifest has been updated; or we may have run -@code{guix gc} and some packages needed by our manifest have been -garbage-collected. - -@item -Eventually, we set to work on that project again, so we run @code{guix shell - -m manifest.scm}. But now we have to wait for Guix to build and install -stuff! -@end enumerate - -Ideally, we could spare the rebuild time. And indeed we can, all we need is to +To be 100% sure that a given profile will never be collected, install the manifest to a profile and use @code{GUIX_PROFILE=/the/profile; . "$GUIX_PROFILE"/etc/profile} as explained above: this guarantees that our hacking environment will be available at all times.