GNU bug report logs - #43458
[PATCH] guix: build: Add a hint for unspecified value

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Wed, 16 Sep 2020 21:41:01 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43458 in the body.
You can then email your comments to 43458 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#43458; Package guix-patches. (Wed, 16 Sep 2020 21:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 16 Sep 2020 21:41:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] guix: build: Add a hint for unspecified value
Date: Wed, 16 Sep 2020 23:40:03 +0200
[Message part 1 (text/plain, inline)]
Hi Guix!

this patch adds a hint to guix build, when you try to build from a file
and it returns #<unspecified>.  The most common error is when you copy
the structure from other guix modules and use `define-public` for your
package. The file returns #<unspecified> and you get this message:

> #<unspecified>: not something we can build.

Which is not very helpful. Here is what happens with this change:

> guix build: error: #<unspecified>: not something we can build
> 
> hint: If you build from a file, make sure the last scheme expression
> returns a package value.  `define-public' defines a variable, but
> returns #<unspecified>.  To fix this, add a scheme expression at the
> end of the file that consists only of the package's variable name you
> defined.  ex:
> 
>      (define-public my-package
>        (package
>          ...))
>      
>      my-package

If instead, you return a value that is not understood, the message is
simpler (as this is not something that happens out of confusion / being
new to guix or guile):

> guix build: error: 1: not something we can build
> 
> hint: If you build from a file, make sure the last scheme expression
> returns a package, gexp, derivation value or a list of such values.

(here the file returned "1" which we can't build :))
[0001-guix-build-Add-a-hint-for-unspecified-value.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#43458; Package guix-patches. (Fri, 18 Sep 2020 20:36:01 GMT) Full text and rfc822 format available.

Message #8 received at 43458 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 43458 <at> debbugs.gnu.org
Subject: Re: [bug#43458] [PATCH] guix: build: Add a hint for unspecified value
Date: Fri, 18 Sep 2020 22:35:26 +0200
Julien Lepiller <julien <at> lepiller.eu> skribis:

>>From b29a325ef52d402c9618bfe9f02e478134297c0f Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Wed, 16 Sep 2020 23:32:00 +0200
> Subject: [PATCH] guix: build: Add a hint for unspecified value.
                   ^
I tend to use “guix build:” as the prefix for this file.

> * guix/scripts/build.scm (options->things-to-build): Add a hint when we
> cannot build something.

Great idea!

> +      (raise (make-compound-condition
> +               (formatted-message (G_ "~s: not something we can build~%") x)
> +               (condition
> +                (&fix-hint
> +                 (hint
> +                   (if (unspecified? x)
> +                       (G_ "If you build from a file, make sure the last scheme
> +expression returns a package value.  @code{define-public} defines a variable,
> +but returns #<unspecified>.  To fix this, add a scheme expression at the end of
               ^
@code

> +the file that consists only of the package's variable name you defined. ex:

s/. ex:/as in this example:/

> +@example
> +(define-public my-package
> +  (package
> +    ...))
> +
> +my-package
> +@end example")
> +                       (G_ "If you build from a file, make sure the last scheme
> +expression returns a package, gexp, derivation value or a list of such
> +values.")))))))))

s/derivation value/derivation/

Also s/scheme/Scheme/ throughout.

OK with these changes, thank you!

Ludo’.




Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Tue, 29 Sep 2020 13:17:02 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Tue, 29 Sep 2020 13:17:03 GMT) Full text and rfc822 format available.

Message #13 received at 43458-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 43458-done <at> debbugs.gnu.org
Subject: Re: [bug#43458] [PATCH] guix: build: Add a hint for unspecified value
Date: Tue, 29 Sep 2020 15:16:05 +0200
Pushed as e75443d4f28ff1aa97e545f2b47b311c3a5ac32a, thanks for the
review!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Oct 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 175 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.