unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How do you debug build-side code?
@ 2022-04-03 19:54 David Arroyo
  2022-04-04  2:58 ` David Arroyo
  0 siblings, 1 reply; 2+ messages in thread
From: David Arroyo @ 2022-04-03 19:54 UTC (permalink / raw)
  To: help-guix

Hello,

I currently use Guix on a foreign distro to define development and build environments. I'm trying to extend guix with types that build an s6[1] supervision tree in the store from a declarative definition. I can then use that to build a guix profile (or a pack) with everything needed for s6-svscan to run and supervise these services.

This is my current attempt:

https://git.sr.ht/~droyo/guix-channel/tree/1ca4a1043c1f38bcc118046fa5ba771cf47393a9/item/aqwari/services/s6.scm
https://git.sr.ht/~droyo/guix-channel/tree/1ca4a1043c1f38bcc118046fa5ba771cf47393a9/item/example/router.scm

However, `guix build -f router.scm` currently fails. The specific error is something about incorrect arguments to "apply". I'm sure I can find it eventually, but this is just one of many errors I've made, and I've had a bear of a time fixing them. I feel like I am in uncharted territory, because the docs I can find all talk about packages, and I'm not trying to build a package. Often the stack traced I get do not include my code at all, so it's hard to tell where my mistake is.

I'd love to hear how others debug errors in the build-side code. Is there any way for me to trace the function calls or even have an interactive debugging session?

David

[1]: https://skarnet.org/software/s6/index.html


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How do you debug build-side code?
  2022-04-03 19:54 How do you debug build-side code? David Arroyo
@ 2022-04-04  2:58 ` David Arroyo
  0 siblings, 0 replies; 2+ messages in thread
From: David Arroyo @ 2022-04-04  2:58 UTC (permalink / raw)
  To: help-guix

On Sun, Apr 3, 2022, at 15:54, David Arroyo wrote:
> I'd love to hear how others debug errors in the build-side code. Is 
> there any way for me to trace the function calls or even have an 
> interactive debugging session?

Partially answering my own question, by rifling through the files listed
in the `guix build ...` output I can eventually find a file of the form

/gnu/store/...-NAME-builder

which contains the S-expression created from my G-expression, and which
showed me that the generated program was not valid (it was trying to
use a string as a function.

Cheers,
David


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-04  2:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 19:54 How do you debug build-side code? David Arroyo
2022-04-04  2:58 ` David Arroyo

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).