From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Rollback problems Date: Wed, 23 Jan 2013 23:58:46 +0100 Message-ID: <87mwvzsdzt.fsf@gnu.org> References: <201301232148.46744.andreas@enge.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty9HO-0005qp-PQ for bug-guix@gnu.org; Wed, 23 Jan 2013 17:58:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ty9HN-0000uC-EG for bug-guix@gnu.org; Wed, 23 Jan 2013 17:58:50 -0500 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:29638) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty9HN-0000u8-7w for bug-guix@gnu.org; Wed, 23 Jan 2013 17:58:49 -0500 In-Reply-To: <201301232148.46744.andreas@enge.fr> (Andreas Enge's message of "Wed, 23 Jan 2013 21:48:46 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Andreas Enge Cc: bug-guix@gnu.org Andreas Enge skribis: > $ guix-package -i hello > > This creates a link $HOME/.guix-profile to $PERUSER/guix-profile; the=20 > 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=20 > "empty profile" and have $PERUSER/guix-profile-1-link point to it.=20 And what if you roll back once you=E2=80=99re at the empty profile? It seems more intuitive for me to error out like this, because there was really nothing but nothingness before =E2=80=9Chello=E2=80=9D was installed= . :-) WDYT? > $ guix-package -i freetype > > This creates $PERUSER/guix-profile-2-link and updates the links as=20 > expected. > > $ guix-package --roll-back > switching from generation 2 to 1 > > Unexpectedly, $PERUSER/guix-profile-2-link is not deleted, but=20 > $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 =E2=80=98--switch-generation=E2=80=99 o= ption, 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=20 > 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=20 > reappeared freetype. Yes, I=E2=80=99ve 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=E2=80=99d 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=E2=80=99.