[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wishlist: “repack” generations history of profile

From: zimoun
Subject: Re: wishlist: “repack” generations history of profile
Date: Mon, 23 May 2022 18:58:01 +0200

Hi Ludo,

On Mon, 23 May 2022 at 17:42, Ludovic Courtès <> wrote:

> Exactly!  ‘guix pull’ profiles are entirely reproducible: we can rebuild
> them from the output of ‘guix describe’.
> So ‘guix gc’ (or something) could automatically remove old generation
> symlinks and instead store the output of ‘guix describe’.  That way,
> ‘--list-generations’ or ‘--switch-generations’ could transparently
> display the info or rebuild the generation.

I have in mind to remove all except the manifest file.

--8<---------------cut here---------------start------------->8---
$ tree -L 1 $(readlink -f ~/.config/guix/current)
├── bin -> /gnu/store/fnfzidl79gjdki2d8v2ghn6a42n75rqc-guix-58f372776/bin
├── etc
├── lib
├── manifest
└── share

4 directories, 1 file
--8<---------------cut here---------------end--------------->8---

After ’guix gc’ (or something), it would read:

--8<---------------cut here---------------start------------->8---
└── manifest

0 directories, 1 file
--8<---------------cut here---------------end--------------->8---

And similarly for regular profile, it would become after ’guix gc’ (or

--8<---------------cut here---------------start------------->8---
$ tree -L 1 $(readlink -f ~/.guix-profile)
└── manifest

0 directories, 1 file
--8<---------------cut here---------------end--------------->8---

instead of the 7 directories I get today.

Well, I am not enough familiar with various internals as the SQL
database and the daemon to have an opinion about the technical issues.

Or maybe, it is easier to remove as today but save the relevant
information elsewhere.  WDYT?

> System and Home generations are usually, but not necessarily,
> reproducible: usually the channel info + config file are enough to
> rebuild them, but in theory the config file might refer to resources not
> known to Guix (e.g., SSH key files, modules, whatever).  That said, we
> could arrange so that ‘guix gc -d’ keeps the metadata around.
> For regular profiles, we might do the same, but no guarantee we can
> rebuild them, unless all the packages come from the same channels (which
> is the case if the profile was built with ‘guix package -m’).

Yes.  The same limitation as --export-manifest and --export-channels.
Somehow, if the full history is kept, we should be able to reproduce.
However, it could be slow or inefficient.

Today, I manually store the output of “guix describe” before I
manipulate a profile.  This channels.scm output is tracked by Git as
part of my project.  Then I run “git log” to find the previous state of
interest and go back using,

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

which is fine and works well.  Probably the good practise. :-)

Instead of this external tracking, I would like to allow this workflow:

    guix package -p project --list-generations
    guix package -p project --switch-generation=12

whatever the sysadmin collect about the old generations.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]