From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qPKpBgGNbmSAPQEASxT56A (envelope-from ) for ; Thu, 25 May 2023 00:17:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gJjNBQGNbmRNNwEAG6o9tA (envelope-from ) for ; Thu, 25 May 2023 00:17:37 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CEB433892B for ; Thu, 25 May 2023 00:17:36 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1wnH-0006MD-It; Wed, 24 May 2023 18:17:19 -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 1q1wnF-0006Lx-Nx for guix-devel@gnu.org; Wed, 24 May 2023 18:17:17 -0400 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1wnD-0004Gv-9C for guix-devel@gnu.org; Wed, 24 May 2023 18:17:17 -0400 Date: Wed, 24 May 2023 22:16:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1684966623; x=1685225823; bh=yVwYrHt2wB48y9bMos7KjhKxVu8GQG2xWKD27ndqnlI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=CPcyNpAcjQCtexMX0Za1jO6J0mwOHy0fgYXWp/nKrdLYrs3N1WP98iug1/cqxgRIH EQVn0dwtsFlQ9AUvawkop1Ta9dj3vZzloTGSKWiry7LKMJx4xVbVSsGYrx/io+vs/p OZYbA1nbcjCLH74KnoygX8t5NVpv4yTVUdvECAdWfFq1S240fa5R3yC7C88ZbkTNM7 YvS2fPvmVmmUkZ6UGQzyCsRDpXUrdsE5cssz54/aTWRKV/qg9w9qEpS2tjwbVEzuJU BtefA/VQ0kwvGxkJPAmTPzFgs2NwnzhjuLGL4YRiro7wJJAr+hB6pGOfNLA/qYq9Re u/w5ljrel6/lA== To: Timothy Washington From: Kaelyn Cc: Simon Tournier , Guix Devel Subject: Re: Howto reference a custom package from a manifest Message-ID: In-Reply-To: References: <875y8oz4ab.fsf@gmail.com> Feedback-ID: 34709329:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.22; envelope-from=kaelyn.alexi@protonmail.com; helo=mail-4322.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, WEIRD_QUOTING=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684966656; a=rsa-sha256; cv=none; b=Ei6xLR/VsmX1UGx1RD4P4Hn4cGDeXbRNAMR64dr8lWuQH6zK0vAXL00dZXX79fr9DsN+c/ YGxlK1Xyypn9kIV3s6DudduXM9hCdHAfWm8jGl72N03tfdp4QR1PHgOETg3nS7g0oOiDxg goC+OLBnX5dW7lcm4yC/bxZczOgb/ADMNtsSBa2N9XRdX3he/2Jg0W3N3VF3f6MIKogVK8 GmBKEX4UI802e+kaCwf9SejcOJqAD9UZyCtiVrOnUWUWnTy1iEOXTBb+YqZR83lmDaJ/7O WMUkPVJm83UKW87gcN2GU1Lj0tZZJY1cHG8pDNzUO9qSnY7oeDNZ/WdE64wwIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=CPcyNpAc; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684966656; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=yVwYrHt2wB48y9bMos7KjhKxVu8GQG2xWKD27ndqnlI=; b=HqNhIdivUklNxoUh2hSGAtuasbWhNuYi7z6pHwdC6xJqJq9AseeV2FPaCz4+uWEzju5Io5 Rixgnr1iBjSvwrsKhGEAWXyLUrFKbA86fxqAbLr77EpGJN09pWefSVNpFghg8xGcjNEZ3C jTxZIWKaxftn3ewE1ANsvqHMEgJe/xgk3iF9Bny3zg/ftxvmKeDMIWD1k63no4qqEyjJQ+ 5YO+sA3RaQZUTi9c06JVRpgT3gZR/blnuw/bQHNHf86Qn50xW6virJg81NiGb+tSmWwiG0 aqkAFyEbaz/E+4bpTbFc4GdKOvCP3PYJy8Zia0Y0juA5xmlGm2bQr2ZsEQ0YPA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=CPcyNpAc; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.82 X-Spam-Score: -4.82 X-Migadu-Queue-Id: CEB433892B X-TUID: BIP5axD5C2R1 ------- Original Message ------- On Wednesday, May 24th, 2023 at 8:25 PM, Timothy Washington wrote: > . This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/do= tfiles/guix/packages/manifest.scm" command above, that not only built the m= anifest but also > used the manifest to create a new generation of /home/twashing/.guix-prof= ile. >=20 > Ah I see. >=20 > . If you run "guix package --list-generations" you should see a list of a= ll of the existing (numbered) generations with the currently active generat= ion marked > (it's typically the last / latest generation, and should be in this case)= . > . Running "guix package -I" will list the packages in the current generat= ion of your default guix profile, > which should contain the packages in your manifest. >=20 > . To go into more details about how profiles work: unless you specify the= "-p" argument to "guix package", > it will operate on your default profile when installing or removing packa= ges (including through using manifests with "-m"), > and create a new generation when the set of installed packages changes. >=20 > . /home/twashing/.guix-profile is a symlink to /var/guix/profiles/per-use= r/twashing/guix-profile, > which in turn is a symlink to one of the numbered symlinks in that same /= var/guix directory (i.e. if your current generation number is 14, then /var= /guix/profiles/per-user/twashing/guix-profile will point to /var/guix/profi= les/per-user/twashing/guix-profile-14-link). >=20 > . Each of those numbered symlinks points to the actual profile in /gnu/st= ore, > so using that hypothetical generation 14 as the one created by your "guix= package -m" command above, > /var/guix/profiles/per-user/twashing/guix-profile-14-link would be a syml= ink to /gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile. >=20 > This is really useful for my understanding. Thank-you! >=20 > But when I restart my machine, the currently installed tools (from "guix = package -i foo") are not available on login. > For example, I manually ran "guix package -i tree git". And after restart= ing my machine, those were no longer available, even though presumably they= should have been part of my latest generation. > I do remember trying to load the tools like below. But git and tree were = still not available. > ". /home/twashing/.guix-profile/etc/profile" >=20 > Are tools in generations cumulative? They are when installed or removed via "guix package -i" and "guix package = -r". Updating your profile using a manifest is not cumulative--the new gene= ration of your profile will have exactly the set of packages in the manifes= t. You can then use "guix package -i" and "guix package -r" to modify the i= nstalled set, but the set will be reset if/when "guix package -m my-manifes= t.scm" is run. > And how can I load the cumulative sum of all my generations, and any cust= om profiles I create? The most reproducible way to maintain the set of packages in your default p= rofile is to include them in your manifest (e.g. adding git and tree to the= list of packages included in the manifest, then running "guix package -m y= our-manifest.scm" again). The generations of a profile are like git commits= or filesystem snapshots in that they represent the profile at different po= ints in time, and they aren't really meant to be composed together. If you'= d like to maintain separate profiles for different sets of packages or grou= ps of functionality instead of installing all the things you need in your d= efault profile, I might recommend taking a look at the Guix Cookbook, in pa= rticular https://guix.gnu.org/cookbook/en/html_node/Guix-Profiles-in-Practi= ce.html. On a different tack, if you have no issue with installing all of the packag= es you need in a single profile using a manifest, and you'd like a way of m= anaging at least some of your home configuration (shell aliases, simple con= fig files, etc), there is also "guix home" for a declarative way of specify= those pieces: https://guix.gnu.org/en/manual/devel/en/html_node/Home-Confi= guration.html. In a manner of speaking, it is to your home directory what "= guix system" is to the OS when booting Guix. Cheers, Kaelyn >=20 > Thanks againTim >=20 > On Tue, 23 May 2023 at 12:39, Kaelyn wrote: >=20 > > Hi Tim, > >=20 > > ------- Original Message ------- > > On Monday, May 22nd, 2023 at 8:20 PM, Timothy Washington wrote: > >=20 > >=20 > > > Yes that was it! I added "(native-inputs (list perl python))" to my p= ackage definition. > > > $ guix build -L ~/dotfiles/ rust-rustscan # A. Now builds again! > > > /gnu/store/4bldy27x1f2mzjqg5jd176nrawl98y1y-rust-rustscan-2.1.1 > > > > > > $ guix package -L ~/dotfiles/ -m ~/dotfiles/guix/packages/manifest.sc= m # B. Now also builds! > > > ... > > > The following derivation will be built: > > > /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv > > > > > > ... > > > > > > guix package --list-profiles # C. does NOT show the custom profile ju= st built > > > /home/twashing/.config/guix/current > > > /home/twashing/.guix-profile > >=20 > > This is expected. When you ran the "guix package -L ~/dotfiles/ -m ~/do= tfiles/guix/packages/manifest.scm" command above, that not only built the m= anifest but also used the manifest to create a new generation of /home/twas= hing/.guix-profile. If you run "guix package --list-generations" you should= see a list of all of the existing (numbered) generations with the currentl= y active generation marked (it's typically the last / latest generation, an= d should be in this case). Running "guix package -I" will list the packages= in the current generation of your default guix profile, which should conta= in the packages in your manifest. > >=20 > > To go into more details about how profiles work: unless you specify the= "-p" argument to "guix package", it will operate on your default profile w= hen installing or removing packages (including through using manifests with= "-m"), and create a new generation when the set of installed packages chan= ges. /home/twashing/.guix-profile is a symlink to /var/guix/profiles/per-us= er/twashing/guix-profile, which in turn is a symlink to one of the numbered= symlinks in that same /var/guix directory (i.e. if your current generation= number is 14, then /var/guix/profiles/per-user/twashing/guix-profile will = point to /var/guix/profiles/per-user/twashing/guix-profile-14-link). Each o= f those numbered symlinks points to the actual profile in /gnu/store, so us= ing that hypothetical generation 14 as the one created by your "guix packag= e -m" command above, /var/guix/profiles/per-user/twashing/guix-profile-14-l= ink would be a symlink to /gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profi= le. > >=20 > > > > > > > > > cat /gnu/store/xll763hpl7mvdkxd3kf8f98pygarzh41-profile.drv # D. DOES= show the new profile in /gnu/store > > > Derive([("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile",= "","")], ... ("out","/gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile"),= ("preferLocalBuild","1")]) > > > > > > > > > i. Using a direct "guix build" gives you a directory in "/gnu/store".= And you can add that bin to your PATH. > >=20 > > This is fragile and will work only as long as the package exists under = /gnu/store. Which is to say, this method will break as soon as "guix gc" is= run unless the package happens to be "live" as a member or dependency of a= ny existing generation of the system profile or other profiles (the profile= generation symlinks like the guix-profile-14-link mentioned above are the = garbage collector roots for guix, as can be seen with "guix gc --list-roots= "). > >=20 > > > ii. But for "/gnu/store/*-profile/", would you just loop over those p= rofile directories, and run each "/gnu/store/*-profile/etc/profile"? > >=20 > > This is a very bad idea, as many or most of those "/gnu/store/*-profile= " directories are different generations of the same profile, and sourcing t= hem all would result in many conflicts and other troubles, including having= unpredictable and likely outdated versions of commands being picked up bef= ore newer counterparts. > >=20 > > Cheers, > > Kaelyn