Andreas Enge <andr...@enge.fr> skribis: > $ guix-package -i hello > > This creates a link $HOME/.guix-profile to $PERUSER/guix-profile; the > latter points to the newly created $PERUSER/guix-profile-1-link > > $ guix-package --roll-back > error: no previous profile; not rolling back > > No links are changed. I think in this case, rollback should create the > "empty profile" and have $PERUSER/guix-profile-1-link point to it.
And what if you roll back once you’re at the empty profile? It seems more intuitive for me to error out like this, because there was really nothing but nothingness before “hello” was installed. :-) WDYT? > $ guix-package -i freetype > > This creates $PERUSER/guix-profile-2-link and updates the links as > expected. > > $ guix-package --roll-back > switching from generation 2 to 1 > > Unexpectedly, $PERUSER/guix-profile-2-link is not deleted, but > $PERUSER/guix-profile now points to $PERUSER/guix-profile-1-link. This is expected (same behavior as nix-env.) Profile generations are not deleted unless you explicitly do so; this is what guarantees that one can roll back anywhere they want. Also, part of the plan is to have a ‘--switch-generation’ option, like nix-env, which allows users to jump directly to the generation of their choice. > But we need to delete the second profile link, as shown by the > following: > > $ guix-package -i file > Now $PERUSER/guix-profile-3-link is created, pointing to an environment > containing hello and file. > > $ guix-package --roll-back > switching from generation 3 to 2 > > Now, we go back to generation 2, containing hello and the mysteriously > reappeared freetype. Yes, I’ve thought about it, as noted in guix-package and tests/guix-package.sh. :-) This could be solved by adding the number of the generation we come from in each new manifest, and then getting the number of the generation to roll-back to from the manifest (we’d then have a DAG of generations, as opposed to a flat list.) But I wonder if this is really worth the trouble. In my experience, a scenario like the one above rarely happens, if ever. WDYT? Thanks, Ludo’.