help-guix
[Top][All Lists]
Advanced

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

Re: Errors in modules are suppressed?


From: Daniel Schäfer
Subject: Re: Errors in modules are suppressed?
Date: Wed, 23 Oct 2019 13:56:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

The manual says in 14.4 Packaging Guidelines:

> If the package is unknown to the guix command, it may be that the source file > contains a syntax error, or lacks a define-public clause to export the package > variable. To figure it out, you may load the module from Guile to get more
> information about the actual error:
>
> ./pre-inst-env guile -c '(use-modules (gnu packages gnew))'

Is something like that possible for reconfiguring the system?

Thanks,
Daniel

On 10/14/19 12:50 AM, Daniel Schäfer wrote:
Hi all,

I'm using modules to split up my system configuration in multiple files (not sure whether that's the right approach). However, when a used module contains an error, `guix system` does not provide a helpful error message, it just says:

  $ sudo guix system build config.scm
  ice-9/eval.scm:223:20: In procedure proc:
  error: bar: unbound variable
  hint: Did you forget `(use-modules (foo))'?

when I try to use `bar` in my original file.

For a minimal working example, change your system's configuration file like this:

+(add-to-load-path ".")
-(use-modules (gnu))
+(use-modules (gnu)
+             (foo))
 (use-service-modules desktop networking ssh xorg)

 (operating-system
-  (locale "en_US.utf8")
+  (locale bar)


And add the new module foo.scm, which contains an error by design:

(define-module (foo)
 #:export (bar))

(this is not defined)
(define bar "en_US.utf8")


I'd be glad to hear about any tips to get the proper error message.

Thanks,
Daniel




reply via email to

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