From mboxrd@z Thu Jan 1 00:00:00 1970 From: Catonano Subject: Re: Hwo to debug and teacking builds? Date: Tue, 28 Mar 2017 15:45:09 +0200 Message-ID: References: <58DA29EC.30008@crazy-compilers.com> <8737dx7mpb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045f4d082045d2054bcaab3d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csrQx-0007o2-9U for help-guix@gnu.org; Tue, 28 Mar 2017 09:45:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csrQw-0008T0-Ah for help-guix@gnu.org; Tue, 28 Mar 2017 09:45:15 -0400 In-Reply-To: <8737dx7mpb.fsf@gnu.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= Cc: help-guix --f403045f4d082045d2054bcaab3d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2017-03-28 11:52 GMT+02:00 Ludovic Court=C3=A8s : > Howdy! > > Hartmut Goebel skribis: > > > when defining a new package, I often find myself spending *a lot* of > > time debugging and tweaking the build. E.g. the if the Makefile needs t= o > > be modified, or some test-cases adjusted. > > > > How do I "get into" the build container, so I can debug, modify files, > > rebuild and run tests there - in a closed environment (nearly) like the > > build-daemon has? > > Most of the time, you don=E2=80=99t need to get into a container. In tho= se > cases, it=E2=80=99s enough to do: > > guix build -K foo > # build fails=E2=80=A6 > cd /tmp/guix-build-foo.drv-0 > source ./environment-variables > cd foo-1.2 > =E2=80=A6 > > In some cases (for example when you have tests that fail in the build > environment but succeed once you=E2=80=99ve followed the steps above), yo= u > really need a container similar to that created by guix-daemon. In that > case, do: > > guix build -K foo > # build fails=E2=80=A6 > cd /tmp/guix-build-foo.drv-0 > guix environment -C foo --ad-hoc strace gdb > rm /bin/sh # to be really like in the guix-daemon environment > source ./environment-variables > cd foo-1.2 > $GUIX_ENVIRONMENT/bin/strace -f -o log make check > =E2=80=A6 > > That would probably make a good =E2=80=9CDebugging Build Failures=E2=80= =9D section. > > > This is important information and it's more detailed than what Pjotr wrote in his wrap up I'd do it myself but I don't know the first thing about the info system Which is the source file ? How do I compile it ? Which Emacs mode should I use ? --f403045f4d082045d2054bcaab3d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2017-03-28 11:52 GMT+02:00 Ludovic Court=C3=A8s <ludo@gnu= .org>:
Howdy!

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> when defining a new package, I often find myself spending *a lot* of > time debugging and tweaking the build. E.g. the if the Makefile needs = to
> be modified, or some test-cases adjusted.
>
> How do I "get into" the build container, so I can debug, mod= ify files,
> rebuild and run tests there - in a closed environment (nearly) like th= e
> build-daemon has?

Most of the time, you don=E2=80=99t need to get into a container.=C2= =A0 In those
cases, it=E2=80=99s enough to do:

=C2=A0 guix build -K foo
=C2=A0 # build fails=E2=80=A6
=C2=A0 cd /tmp/guix-build-foo.drv-0
=C2=A0 source ./environment-variables
=C2=A0 cd foo-1.2
=C2=A0 =E2=80=A6

In some cases (for example when you have tests that fail in the build
environment but succeed once you=E2=80=99ve followed the steps above), you<= br> really need a container similar to that created by guix-daemon.=C2=A0 In th= at
case, do:

=C2=A0 guix build -K foo
=C2=A0 # build fails=E2=80=A6
=C2=A0 cd /tmp/guix-build-foo.drv-0
=C2=A0 guix environment -C foo --ad-hoc strace gdb
=C2=A0 rm /bin/sh=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0# to be really li= ke in the guix-daemon environment
=C2=A0 source ./environment-variables
=C2=A0 cd foo-1.2
=C2=A0 $GUIX_ENVIRONMENT/bin/strace -f -o log make check
=C2=A0 =E2=80=A6

That would probably make a good =E2=80=9CDebugging Build Failures=E2=80=9D = section.



This is important information and it&#= 39;s more detailed than what Pjotr wrote in his wrap up
I'd do it myself but I don't know= the first thing about the info system

Which is the sour= ce file ?
How do I compile it ?
Which Emacs mode should I use ?
=
--f403045f4d082045d2054bcaab3d--