all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* guix system container and friends fail to report intermediate errors
@ 2023-03-27 13:52 Vladilen Kozin
  2023-03-27 18:10 ` Wojtek Kosior via Development of GNU Guix and the GNU System distribution.
  2023-04-17 16:07 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Vladilen Kozin @ 2023-03-27 13:52 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

Hello. Is it possible to get better error reporting in the following
example?

$ sudo guix system -K -L /home/vlad/Code/fullmeta-guix/channel container
os.scm

And our os.scm imports some services defined in our channel above. Should
there be an error in one of them, however, the stack trace only talks about
inability to find that service symbol but otherwise fails to report any
errors that may've happened when loading modules from our -L location above.

Case in point. In one of the modules, I habitually used Clojury syntax and
wrote:

(define foo [1 2])

(define foo-service
  (list
     (shepherd-service ... #$foo ...)))

(define foo-service-type ...)

Running the above OS derivation reports:
```
Backtrace:
In guix/store.scm:
... bt here ...
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: foo-service-type: unbound variable
```

Backtrace has all modules and files either unknown or gensymed - so not
much use.
It isn't wrong, but e.g. attempting to [1 2] in Guile repl would tell you
"Wrong type to apply: 1" and loading this file would give you the location
... probably :)

Feels like defining shepherd services involves some dark arts and buckets
of time when you can't tell what went wrong where.

Thank you

-- 
Best regards
Vlad Kozin

[-- Attachment #2: Type: text/html, Size: 3453 bytes --]

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

* Re: guix system container and friends fail to report intermediate errors
  2023-03-27 13:52 guix system container and friends fail to report intermediate errors Vladilen Kozin
@ 2023-03-27 18:10 ` Wojtek Kosior via Development of GNU Guix and the GNU System distribution.
  2023-04-17 16:07 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Wojtek Kosior via Development of GNU Guix and the GNU System distribution. @ 2023-03-27 18:10 UTC (permalink / raw)
  To: Vladilen Kozin; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]

> Hello. Is it possible to get better error reporting in the following
> example?
> 
> $ sudo guix system -K -L /home/vlad/Code/fullmeta-guix/channel container
> os.scm
> 
> [...]

I also face this very problem when using the "-L" switch with other
commands, e.g. `guix shell`. Is there some missed-by-us way to get
error reports from modules?

Wojtek

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Mon, 27 Mar 2023 14:52:26 +0100
Vladilen Kozin <vladilen.kozin@gmail.com> wrote:

> Hello. Is it possible to get better error reporting in the following
> example?
> 
> $ sudo guix system -K -L /home/vlad/Code/fullmeta-guix/channel container
> os.scm
> 
> And our os.scm imports some services defined in our channel above. Should
> there be an error in one of them, however, the stack trace only talks about
> inability to find that service symbol but otherwise fails to report any
> errors that may've happened when loading modules from our -L location above.
> 
> Case in point. In one of the modules, I habitually used Clojury syntax and
> wrote:
> 
> (define foo [1 2])
> 
> (define foo-service
>   (list
>      (shepherd-service ... #$foo ...)))
> 
> (define foo-service-type ...)
> 
> Running the above OS derivation reports:
> ```
> Backtrace:
> In guix/store.scm:
> ... bt here ...
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> error: foo-service-type: unbound variable
> ```
> 
> Backtrace has all modules and files either unknown or gensymed - so not
> much use.
> It isn't wrong, but e.g. attempting to [1 2] in Guile repl would tell you
> "Wrong type to apply: 1" and loading this file would give you the location
> ... probably :)
> 
> Feels like defining shepherd services involves some dark arts and buckets
> of time when you can't tell what went wrong where.
> 
> Thank you
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: guix system container and friends fail to report intermediate errors
  2023-03-27 13:52 guix system container and friends fail to report intermediate errors Vladilen Kozin
  2023-03-27 18:10 ` Wojtek Kosior via Development of GNU Guix and the GNU System distribution.
@ 2023-04-17 16:07 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2023-04-17 16:07 UTC (permalink / raw)
  To: Vladilen Kozin; +Cc: guix-devel

Hi!

Vladilen Kozin <vladilen.kozin@gmail.com> skribis:

> Hello. Is it possible to get better error reporting in the following
> example?
>
> $ sudo guix system -K -L /home/vlad/Code/fullmeta-guix/channel container
> os.scm
>
> And our os.scm imports some services defined in our channel above. Should
> there be an error in one of them, however, the stack trace only talks about
> inability to find that service symbol but otherwise fails to report any
> errors that may've happened when loading modules from our -L location above.
>
> Case in point. In one of the modules, I habitually used Clojury syntax and
> wrote:
>
> (define foo [1 2])
>
> (define foo-service
>   (list
>      (shepherd-service ... #$foo ...)))
>
> (define foo-service-type ...)
>
> Running the above OS derivation reports:
> ```
> Backtrace:
> In guix/store.scm:
> ... bt here ...
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> error: foo-service-type: unbound variable
> ```

If I understand correctly what’s happening, the module file that defines
‘foo’ and ‘foo-service’ fails to load with a “Wrong type to apply”
error.  Consequently, you end up with that “unbound variable” error in
your OS file.  Do I get it right?

Thanks,
Ludo’.


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

end of thread, other threads:[~2023-04-17 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 13:52 guix system container and friends fail to report intermediate errors Vladilen Kozin
2023-03-27 18:10 ` Wojtek Kosior via Development of GNU Guix and the GNU System distribution.
2023-04-17 16:07 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.