From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Hwo to debug and teacking builds? Date: Tue, 28 Mar 2017 11:52:16 +0200 Message-ID: <8737dx7mpb.fsf@gnu.org> References: <58DA29EC.30008@crazy-compilers.com> 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]:56151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1csnna-0007nY-TL for help-guix@gnu.org; Tue, 28 Mar 2017 05:52:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1csnnX-0005Nn-RD for help-guix@gnu.org; Tue, 28 Mar 2017 05:52:22 -0400 In-Reply-To: <58DA29EC.30008@crazy-compilers.com> (Hartmut Goebel's message of "Tue, 28 Mar 2017 11:16:28 +0200") 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: Hartmut Goebel Cc: help-guix 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 to > 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 those 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), you 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. Thoughts? Ludo=E2=80=99.