unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Timothy Washington <twashing@gmail.com>
To: Kaelyn <kaelyn.alexi@protonmail.com>
Cc: Simon Tournier <zimon.toutoune@gmail.com>,
	Guix Devel <guix-devel@gnu.org>
Subject: Re: Howto reference a custom package from a manifest
Date: Wed, 24 May 2023 16:25:23 -0400	[thread overview]
Message-ID: <CAADtM-Yy2M1NptnYs87zk5gPurzqVq+LgZR41pQeeujjraqQpQ@mail.gmail.com> (raw)
In-Reply-To: <h2kLGPyiA9HoHdqyEV5DeykWf9AmQXYLRcFaeZ45bBk4VCKZAY0wxaIdcL_RdTtqv6gTn2KBsVaZLVUy-ri21Xm0_tkWs_PmwIrdYS9WSTU=@protonmail.com>

[-- Attachment #1: Type: text/plain, Size: 6187 bytes --]

*.* This is expected. When you ran the "guix package -L ~/dotfiles/ -m
~/dotfiles/guix/packages/manifest.scm" command above, that not only built
the manifest but also
used the manifest to create a new generation of
/home/twashing/.guix-profile.

Ah I see.

*.* If you run "guix package --list-generations" you should see a list of
all of the existing (numbered) generations with the currently active
generation 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
generation of your default guix profile,
which should contain the packages in your manifest.

*.* 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
packages (including through using manifests with "-m"),
and create a new generation when the set of installed packages changes.

*.* /home/twashing/.guix-profile is a symlink to
/var/guix/profiles/per-user/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 of those numbered symlinks points to the actual profile in
/gnu/store,
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
symlink to /gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile.

This is really useful for my understanding. Thank-you!

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
restarting 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"

Are tools in generations cumulative?
And how can I load the cumulative sum of all my generations, and any custom
profiles I create?

Thanks again
Tim


On Tue, 23 May 2023 at 12:39, Kaelyn <kaelyn.alexi@protonmail.com> wrote:

> Hi Tim,
>
> ------- Original Message -------
> On Monday, May 22nd, 2023 at 8:20 PM, Timothy Washington <
> twashing@gmail.com> wrote:
>
>
> > Yes that was it! I added "(native-inputs (list perl python))" to my
> package 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.scm #
> 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 just
> built
> > /home/twashing/.config/guix/current
> > /home/twashing/.guix-profile
>
> This is expected. When you ran the "guix package -L ~/dotfiles/ -m
> ~/dotfiles/guix/packages/manifest.scm" command above, that not only built
> the manifest but also used the manifest to create a new generation of
> /home/twashing/.guix-profile. If you run "guix package --list-generations"
> you should see a list of all of the existing (numbered) generations with
> the currently active generation 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 generation of your default guix profile,
> which should contain the packages in your manifest.
>
> 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 packages (including through using manifests
> with "-m"), and create a new generation when the set of installed packages
> changes. /home/twashing/.guix-profile is a symlink to
> /var/guix/profiles/per-user/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 of those
> numbered symlinks points to the actual profile in /gnu/store, 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 symlink to /gnu/store/sqaz4ff2nshfizfh8ymbzllia6lsgnfv-profile.
>
> >
> >
> > 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.
>
> 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
> any 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").
>
> > ii. But for "/gnu/store/*-profile/", would you just loop over those
> profile directories, and run each "/gnu/store/*-profile/etc/profile"?
>
> 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
> them all would result in many conflicts and other troubles, including
> having unpredictable and likely outdated versions of commands being picked
> up before newer counterparts.
>
> Cheers,
> Kaelyn
>

[-- Attachment #2: Type: text/html, Size: 8075 bytes --]

  reply	other threads:[~2023-05-29 16:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAADtM-b6Fpv9DPCRV_5ji+GBSESODOqL-SOEQh-G=6bL0XEetg@mail.gmail.com>
     [not found] ` <875y8oz4ab.fsf@gmail.com>
     [not found]   ` <CAADtM-bc9FU6B+k5UaJctk3+T2aPO_z2edp=SM5LoZgd5JeNYA@mail.gmail.com>
2023-05-21 16:46     ` Howto reference a custom package from a manifest Simon Tournier
2023-05-21 20:35       ` Timothy Washington
2023-05-22  8:41         ` issue with packaging 'rustscan' Simon Tournier
2023-05-22  9:56           ` Tobias Kortkamp
2023-05-22 20:21             ` Timothy Washington
2023-05-22 18:17         ` Howto reference a custom package from a manifest Kaelyn
2023-05-22 20:20           ` Timothy Washington
2023-05-23 16:39             ` Kaelyn
2023-05-24 20:25               ` Timothy Washington [this message]
2023-05-24 22:16                 ` Kaelyn
2023-05-26 23:27                   ` Timothy Washington
2023-05-23 16:54             ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2023-05-24 20:10               ` Timothy Washington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAADtM-Yy2M1NptnYs87zk5gPurzqVq+LgZR41pQeeujjraqQpQ@mail.gmail.com \
    --to=twashing@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=kaelyn.alexi@protonmail.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).