[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling tracing on a phase to debug?

From: zimoun
Subject: Re: Enabling tracing on a phase to debug?
Date: Wed, 17 Aug 2022 12:17:30 +0200

Hi Maxim,

On Fri, 15 Jul 2022 at 15:53, Maxim Cournoyer <> wrote:

> I was toying with the idea to programatically enable tracing the
> execution of a single build phase to aid with debugging, and came up
> with this with the help of robin on #guix (thanks!)

Well, I am often annoyed when debugging a package and I usually use
“guix build -K” and then jump in /tmp/guix-<package>-XY.  The most
annoying is to re-run all the previous phases when they are somehow
already available under /tmp/.  And often, this re-run is just for
tweaking the recipe to have more context about the failure…

> --8<---------------cut here---------------start------------->8---
> @@ -4349,7 +4349,19 @@ (define-public vala
>               (substitute* "valadoc/tests/libvaladoc\
>  /"
>                 (("export PKG_CONFIG_PATH=" m)
> -                (string-append m "$PKG_CONFIG_PATH:"))))))))
> +                (string-append m "$PKG_CONFIG_PATH:")))))
> +
> +         (replace 'glib-or-gtk-wrap
> +           (lambda args
> +             (use-modules (system vm trace)
> +                          (system vm vm))
> +             (call-with-vm
> +              (lambda ()
> +                (set-vm-engine! 'debug)
> +                (call-with-trace
> +                  (lambda _
> +                    (apply (assoc-ref %standard-phases 'glib-or-gtk-wrap)
> +                           args))))))))))
>      (native-inputs
>       `(("bison" ,bison)
>         ("dbus" ,dbus)                   ; for dbus tests
> --8<---------------cut here---------------end--------------->8---

…so maybe we could have something like that for a better tracing.

Maybe, we could imagine an option as “guix build --list-phases” and then
a kind of package transformation doing on-the-fly the “call-with-vm” –
available with an option as “guix build --trace=glib-or-gtk-wrap”.

> Unfortunately it doesn't cause any trace to be output.  Is there
> something missing to the above incantation, perhaps?

Sadly, I do not know.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]