From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 16 05:51:27 2018 Received: (at 31841) by debbugs.gnu.org; 16 Jun 2018 09:51:27 +0000 Received: from localhost ([127.0.0.1]:51001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU7rj-0007Wr-0O for submit@debbugs.gnu.org; Sat, 16 Jun 2018 05:51:27 -0400 Received: from world.peace.net ([64.112.178.59]:57350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fU7rh-0007We-CH for 31841@debbugs.gnu.org; Sat, 16 Jun 2018 05:51:25 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fU7rb-0002eZ-5Y; Sat, 16 Jun 2018 05:51:19 -0400 From: Mark H Weaver To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: bug#31841: ./pre-inst-env guix system no longer works without ~/.config/guix References: <8736xopz0q.fsf@netris.org> <87bmccuwbu.fsf@mdc-berlin.de> <87o9gctgrm.fsf@gnu.org> <87po0snp5g.fsf@netris.org> <87602kro0h.fsf@gnu.org> <874li31wx7.fsf@g1.i-did-not-set--mail-host-address--so-tickle-me> <87sh5nqgtf.fsf@gnu.org> Date: Sat, 16 Jun 2018 05:50:00 -0400 In-Reply-To: <87sh5nqgtf.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 16 Jun 2018 10:25:00 +0200") Message-ID: <87po0r3vsn.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31841 Cc: Ricardo Wurmus , 31841@debbugs.gnu.org, myglc2@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > myglc2@gmail.com skribis: > >> Based on this thread I am now making guix like this ... >> >> guix environment guix --ad-hoc guile-sqlite3 --root=3Dbuild-env -- make = [MAKECMDGOALS] >> >> ... and using it like this ... >> >> source build-env/etc/profile >> ./pre-inst-env guix COMMAND ARGS... > > Yeah we can improve the doc. Currently, =E2=80=9CBuilding from Git=E2=80= =9D mentions > =E2=80=98guix environment guix=E2=80=99, but =E2=80=9CRunning Guix Before= It Is Installed=E2=80=9D > doesn=E2=80=99t. How about this: > > diff --git a/doc/contributing.texi b/doc/contributing.texi > index 205c972ae..3f82f4bc2 100644 > --- a/doc/contributing.texi > +++ b/doc/contributing.texi > @@ -108,7 +108,9 @@ actually installing them. So that you can distinguis= h between your > ``end-user'' hat and your ``motley'' costume. >=20=20 > To that end, all the command-line tools can be used even if you have not > -run @code{make install}. To do that, prefix each command with > +run @code{make install}. To do that, you first need to have an environm= ent > +with all the dependencies available (@pxref{Building from Git}), and then > +simply prefix each command with > @command{./pre-inst-env} (the @file{pre-inst-env} script lives in the > top build tree of Guix), as in@footnote{The @option{-E} flag to > @command{sudo} guarantees that @code{GUILE_LOAD_PATH} is correctly set > > > Note that I purposely did not mention =E2=80=9C--ad-hoc guile-sqlite3=E2= =80=9D because > it has become unnecessary with commit > c5a2e1ffcb029f50c4c18352cf378b61c41c625e. > > Likewise, I did not mention =E2=80=9Csource build-env/etc/profile=E2=80= =9D because > =E2=80=9CBuilding from Git=E2=80=9D suggests using =E2=80=98guix environm= ent guix=E2=80=99, which sets > up the right environment variables. > > WDYT? When running Guix exclusively from a git checkout and never running 'guix pull', something like "source build-env/etc/profile" must now be run before running 'guix'. You seem to be suggesting that "source build-env/etc/profile" could simply be replaced by "guix environment guix". One problem with this idea is that it would introduce a circularity. My 'guix' script cannot very well begin by running 'guix environment guix'. There are other problems as well: (1) The build environment used to build the git checkout must be registered as a GC root, or else "guix gc" may render my git checkout of 'guix' non-functional, with no easy way to recover (at least not without running 'guix pull'). (2) When my git checkout is in a bad state, or is unbuilt, then during this time I'm unable to easily run "guix environment guix". So, I always need a way to restore a known good development environment to rebuild my copy of guix, without using guix itself. My method is to source the etc/profile from my saved development environment profile. I should emphasize that when running Guix this way, if you wish to avoid running 'guix pull', it's important to always keep at least one known-good development environment for Guix saved as a GC root. Toward that end, when I run "guix environment guix" to update my development environment profile, I make sure to preserve my previous profile as a GC root until I'm confident that my new profile is working. The suggested recipe involving "guix environment guix --root=3Dbuild-env" command is a nice improvement over my manual management of these GC roots, but it has one shortcoming: it discards the older profile symlink and GC root immediately, before it's known whether the new profile works. This message should make it clear that when using Guix in this way, it's easy to get stuck if you're not careful. I suppose that I could always get unstuck by running 'guix pull', but I prefer to avoid it. Regards, Mark