[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Hwo to debug and teacking builds?
From: |
Ludovic Courtès |
Subject: |
Re: Hwo to debug and teacking builds? |
Date: |
Tue, 28 Mar 2017 11:52:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Howdy!
Hartmut Goebel <address@hidden> 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’t need to get into a container. In those
cases, it’s enough to do:
guix build -K foo
# build fails…
cd /tmp/guix-build-foo.drv-0
source ./environment-variables
cd foo-1.2
…
In some cases (for example when you have tests that fail in the build
environment but succeed once you’ve 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…
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
…
That would probably make a good “Debugging Build Failures” section.
Thoughts?
Ludo’.
Re: Hwo to debug and teacking builds?, Hartmut Goebel, 2017/03/28