unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Guix can't build my dummy package definition
@ 2020-03-01 12:58 Jérémy Korwin-Zmijowski
  2020-03-01 13:09 ` pelzflorian (Florian Pelz)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-03-01 12:58 UTC (permalink / raw)
  To: Guix Help

Hey Guixters !

I am experimenting one way to learn how to use Guix for packaging. 

I've a package dummy definition in /tmp/def.scm:

(use-modules 
  (guix packages)
  (guix build-system emacs)
  (guix licenses)
  (guix git-download)) 

(define-public ac-geiser 
  (package 
    (name "")
    (version "") 
    (source
      (origin
        (uri
          (git-reference (url "") 
          (commit ""))) 
        (method git-fetch) 
        (sha256 (base32 ""))))
    (build-system emacs-build-system)
    (synopsis "")
    (description "") 
    (license bsd-3)
    (home-page "")))

Then when I do :

./pre-inst-env guix build -f /tmp/def.scm

I get :

guix build: error: #<unspecified>: not something we can build

What is Guix trying to tell yo me ? I have no clue... 

Does anybody have one ?

Cheers
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

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

* Re: Guix can't build my dummy package definition
  2020-03-01 12:58 Guix can't build my dummy package definition Jérémy Korwin-Zmijowski
@ 2020-03-01 13:09 ` pelzflorian (Florian Pelz)
  2020-03-01 14:50 ` Julien Lepiller
  2020-03-01 16:15 ` Ricardo Wurmus
  2 siblings, 0 replies; 6+ messages in thread
From: pelzflorian (Florian Pelz) @ 2020-03-01 13:09 UTC (permalink / raw)
  To: Jérémy Korwin-Zmijowski; +Cc: Guix Help

On Sun, Mar 01, 2020 at 01:58:27PM +0100, Jérémy Korwin-Zmijowski wrote:
> Hey Guixters !
> 
> I am experimenting one way to learn how to use Guix for packaging. 
> 

Nice to hear. :)

> […]
> Then when I do :
> 
> ./pre-inst-env guix build -f /tmp/def.scm
> 
> I get :
> 
> guix build: error: #<unspecified>: not something we can build
> 

This seems like what is described at the end of:

https://guix.gnu.org/cookbook/en/html_node/GUIX_005fPACKAGE_005fPATH.html#GUIX_005fPACKAGE_005fPATH


You would need to add ac-geiser add the end of the file if you want to
test it with -f.  But maybe also take a look at the other methods
described in the Cookbook.

Regards,
Florian

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

* Re: Guix can't build my dummy package definition
  2020-03-01 12:58 Guix can't build my dummy package definition Jérémy Korwin-Zmijowski
  2020-03-01 13:09 ` pelzflorian (Florian Pelz)
@ 2020-03-01 14:50 ` Julien Lepiller
  2020-03-01 15:49   ` Jérémy Korwin-Zmijowski
  2020-03-01 16:15 ` Ricardo Wurmus
  2 siblings, 1 reply; 6+ messages in thread
From: Julien Lepiller @ 2020-03-01 14:50 UTC (permalink / raw)
  To: help-guix, Jérémy Korwin-Zmijowski

Le 1 mars 2020 07:58:27 GMT-05:00, "Jérémy Korwin-Zmijowski" <jeremy@korwin-zmijowski.fr> a écrit :
>Hey Guixters !
>
>I am experimenting one way to learn how to use Guix for packaging. 
>
>I've a package dummy definition in /tmp/def.scm:
>
>(use-modules 
>  (guix packages)
>  (guix build-system emacs)
>  (guix licenses)
>  (guix git-download)) 
>
>(define-public ac-geiser 
>  (package 
>    (name "")
>    (version "") 
>    (source
>      (origin
>        (uri
>          (git-reference (url "") 
>          (commit ""))) 
>        (method git-fetch) 
>        (sha256 (base32 ""))))
>    (build-system emacs-build-system)
>    (synopsis "")
>    (description "") 
>    (license bsd-3)
>    (home-page "")))
>
>Then when I do :
>
>./pre-inst-env guix build -f /tmp/def.scm
>
>I get :
>
>guix build: error: #<unspecified>: not something we can build
>
>What is Guix trying to tell yo me ? I have no clue... 
>
>Does anybody have one ?
>
>Cheers

I knew it was going to happen :)

That message is indeed not very helpful. Internally, guix evaluates the file and uses its return value (the value the last expression evaluates to). Here, your last expression is a define-public which does not return any value (in other languages, it's called unit or void, in guile it's #<unspecified>). The solution is to make sure your last expression evaluates to a package object. Three solutions:

1. Add a new line on which you put the name of the variable you define, so it evaluates to its content, the package object.

2. Do not wrap the package definition in a define-public, but use package directly, so that it evaluates to a package expression directly.

3. Define your file as a module, and use -L to add it to load path. Then guix will be able to necognise all your packages in that file by their name, instead of only the last one (ex: guix build -L . ac-geiser), although your package has no name yet, so it can't be found by guix that way currently.

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

* Re: Guix can't build my dummy package definition
  2020-03-01 14:50 ` Julien Lepiller
@ 2020-03-01 15:49   ` Jérémy Korwin-Zmijowski
  0 siblings, 0 replies; 6+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-03-01 15:49 UTC (permalink / raw)
  To: Julien Lepiller, help-guix

Of course !!!

I did know about it, I just forget it... Damn brain!

Thank you for your quick answers ! So cool.

I appreciate the three options you gave Julien. Helpful!

I can realize now how much my lack of curioisity cost. Haha awesome feedback for me.

Thank you again.

Jérémy

Le 1 mars 2020 15:50:28 GMT+01:00, Julien Lepiller <julien@lepiller.eu> a écrit :
>Le 1 mars 2020 07:58:27 GMT-05:00, "Jérémy Korwin-Zmijowski"
><jeremy@korwin-zmijowski.fr> a écrit :
>>Hey Guixters !
>>
>>I am experimenting one way to learn how to use Guix for packaging. 
>>
>>I've a package dummy definition in /tmp/def.scm:
>>
>>(use-modules 
>>  (guix packages)
>>  (guix build-system emacs)
>>  (guix licenses)
>>  (guix git-download)) 
>>
>>(define-public ac-geiser 
>>  (package 
>>    (name "")
>>    (version "") 
>>    (source
>>      (origin
>>        (uri
>>          (git-reference (url "") 
>>          (commit ""))) 
>>        (method git-fetch) 
>>        (sha256 (base32 ""))))
>>    (build-system emacs-build-system)
>>    (synopsis "")
>>    (description "") 
>>    (license bsd-3)
>>    (home-page "")))
>>
>>Then when I do :
>>
>>./pre-inst-env guix build -f /tmp/def.scm
>>
>>I get :
>>
>>guix build: error: #<unspecified>: not something we can build
>>
>>What is Guix trying to tell yo me ? I have no clue... 
>>
>>Does anybody have one ?
>>
>>Cheers
>
>I knew it was going to happen :)
>
>That message is indeed not very helpful. Internally, guix evaluates the
>file and uses its return value (the value the last expression evaluates
>to). Here, your last expression is a define-public which does not
>return any value (in other languages, it's called unit or void, in
>guile it's #<unspecified>). The solution is to make sure your last
>expression evaluates to a package object. Three solutions:
>
>1. Add a new line on which you put the name of the variable you define,
>so it evaluates to its content, the package object.
>
>2. Do not wrap the package definition in a define-public, but use
>package directly, so that it evaluates to a package expression
>directly.
>
>3. Define your file as a module, and use -L to add it to load path.
>Then guix will be able to necognise all your packages in that file by
>their name, instead of only the last one (ex: guix build -L .
>ac-geiser), although your package has no name yet, so it can't be found
>by guix that way currently.

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

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

* Re: Guix can't build my dummy package definition
  2020-03-01 12:58 Guix can't build my dummy package definition Jérémy Korwin-Zmijowski
  2020-03-01 13:09 ` pelzflorian (Florian Pelz)
  2020-03-01 14:50 ` Julien Lepiller
@ 2020-03-01 16:15 ` Ricardo Wurmus
  2020-03-01 16:25   ` Jérémy Korwin-Zmijowski
  2 siblings, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2020-03-01 16:15 UTC (permalink / raw)
  To: Jérémy Korwin-Zmijowski; +Cc: help-guix


Hi Jérémy,

> I've a package dummy definition in /tmp/def.scm:
>
> (use-modules 
>   (guix packages)
>   (guix build-system emacs)
>   (guix licenses)
>   (guix git-download)) 
>
> (define-public ac-geiser 
>   (package 
>     (name "")
>     (version "") 
>     (source
>       (origin
>         (uri
>           (git-reference (url "") 
>           (commit ""))) 
>         (method git-fetch) 
>         (sha256 (base32 ""))))
>     (build-system emacs-build-system)
>     (synopsis "")
>     (description "") 
>     (license bsd-3)
>     (home-page "")))
>
> Then when I do :
>
> ./pre-inst-env guix build -f /tmp/def.scm
>
> I get :
>
> guix build: error: #<unspecified>: not something we can build

This is because “define” (or “define-public”) does not return a value.
It returns an unspecified value.

When using “guix build” with a file then the file must evaluate to a
package value.  This means it must end with a (package …) expression or
the name of a variable that is bound to a package expression.

You can fix this by either adding “ac-geiser” to the bottom of the file,
or by removing the (define-public ac-geiser …) wrapping around the
package expression.

-- 
Ricardo

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

* Re: Guix can't build my dummy package definition
  2020-03-01 16:15 ` Ricardo Wurmus
@ 2020-03-01 16:25   ` Jérémy Korwin-Zmijowski
  0 siblings, 0 replies; 6+ messages in thread
From: Jérémy Korwin-Zmijowski @ 2020-03-01 16:25 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

Thank you Ricardo! Very clear.
I appreciate you help!

Jérémy

Le 1 mars 2020 17:15:21 GMT+01:00, Ricardo Wurmus <rekado@elephly.net> a écrit :
>
>Hi Jérémy,
>
>> I've a package dummy definition in /tmp/def.scm:
>>
>> (use-modules 
>>   (guix packages)
>>   (guix build-system emacs)
>>   (guix licenses)
>>   (guix git-download)) 
>>
>> (define-public ac-geiser 
>>   (package 
>>     (name "")
>>     (version "") 
>>     (source
>>       (origin
>>         (uri
>>           (git-reference (url "") 
>>           (commit ""))) 
>>         (method git-fetch) 
>>         (sha256 (base32 ""))))
>>     (build-system emacs-build-system)
>>     (synopsis "")
>>     (description "") 
>>     (license bsd-3)
>>     (home-page "")))
>>
>> Then when I do :
>>
>> ./pre-inst-env guix build -f /tmp/def.scm
>>
>> I get :
>>
>> guix build: error: #<unspecified>: not something we can build
>
>This is because “define” (or “define-public”) does not return a value.
>It returns an unspecified value.
>
>When using “guix build” with a file then the file must evaluate to a
>package value.  This means it must end with a (package …) expression or
>the name of a variable that is bound to a package expression.
>
>You can fix this by either adding “ac-geiser” to the bottom of the
>file,
>or by removing the (define-public ac-geiser …) wrapping around the
>package expression.
>
>-- 
>Ricardo

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.

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

end of thread, other threads:[~2020-03-01 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-01 12:58 Guix can't build my dummy package definition Jérémy Korwin-Zmijowski
2020-03-01 13:09 ` pelzflorian (Florian Pelz)
2020-03-01 14:50 ` Julien Lepiller
2020-03-01 15:49   ` Jérémy Korwin-Zmijowski
2020-03-01 16:15 ` Ricardo Wurmus
2020-03-01 16:25   ` Jérémy Korwin-Zmijowski

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