From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Debugging Guix packages? Date: Wed, 20 Jan 2016 23:26:14 +0100 Message-ID: <874me7x4zd.fsf@gnu.org> References: <20160119024256.GA21542@novena-choice-citizen.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM1Co-0006fq-Gs for guix-devel@gnu.org; Wed, 20 Jan 2016 17:26:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aM1Cj-0004Z1-EW for guix-devel@gnu.org; Wed, 20 Jan 2016 17:26:22 -0500 In-Reply-To: (Ricardo Wurmus's message of "Tue, 19 Jan 2016 15:52:00 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: guix-devel@gnu.org Ricardo Wurmus skribis: > Jookia <166291@gmail.com> writes: > >> It'd be a nice feature to have where I could step through the build proc= ess in >> an environment close to the actual build and run build commands myself l= ike >> 'patch' or 'make' or 'configure', but builders can also include Guile co= de. > > We already have =E2=80=9Cguix environment --{pure,container} pkg=E2=80=9D= which spawns a > shell where all declared inputs are available and all environment > variables are set, but it does lack a method to run build phases. It > would be very nice if we had a tool to selectively run build phases as > defined in the arguments field. Yes, I agree that this would be nice. >> Debugging the builder using Guile seems to be somewhat useful but I have= n't >> figured out how to do that as I'm not versed in Guile and this may not b= e the >> right level of abstraction. > > I have been packaging many applications for Guix and have only felt the > need for something more advanced than =E2=80=9Cguix environment=E2=80=9D = when building > really large stuff like the icedtea or GCC packages. These packages > also have complicated build phases that patch the sources and set > additional environment variables, and it would have been helpful to have > a tool to run selected build phases in the current directory. OTOH, for things like GCC, once you start fiddling with the build tree, you quickly lose track of what state you=E2=80=99re in. My workflow has been: guix build foo -K # build fails cd /tmp/guix-build* source environment-variables # Fiddle with the build tree to get additional info about the problem # and a possible fix. # Write a phase that hopefully fixes the issue. # Try again. Since the =E2=80=98environment-variables=E2=80=99 file always contains the = value of environment variables at the time where the build failed (rather than their initial value), it usually works quite well. My 2=C2=A2, Ludo=E2=80=99.