From: zimoun <zimon.toutoune@gmail.com>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>,
guix-devel <guix-devel@gnu.org>
Subject: Re: Enabling tracing on a phase to debug?
Date: Wed, 17 Aug 2022 12:17:30 +0200 [thread overview]
Message-ID: <86edxftbr9.fsf@gmail.com> (raw)
In-Reply-To: <87a69aup81.fsf@gmail.com>
Hi Maxim,
On Fri, 15 Jul 2022 at 15:53, Maxim Cournoyer <maxim.cournoyer@gmail.com> 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\
> /tests-extra-environment.sh"
> (("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.
Cheers,
simon
prev parent reply other threads:[~2022-08-17 10:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 19:53 Enabling tracing on a phase to debug? Maxim Cournoyer
2022-08-17 10:17 ` zimoun [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86edxftbr9.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=guix-devel@gnu.org \
--cc=maxim.cournoyer@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).