all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* package definition: unbound variable ungexp
@ 2019-06-09  6:26 Reza Alizadeh Majd
  2019-06-09  7:26 ` Gábor Boskovits
  2019-06-09  8:51 ` Julien Lepiller
  0 siblings, 2 replies; 6+ messages in thread
From: Reza Alizadeh Majd @ 2019-06-09  6:26 UTC (permalink / raw)
  To: help-guix

Hello Guix, 

I want to create a plain file during package build and copy it to output. 
but using following definition, I receive error on during package installation:

--- CODE: -------------------------------------------------------------------------------------
(add-after 'install 'register-plugin
               (lambda* (#:key outputs #:allow-other-keys)
                  (let* ((out     (assoc-ref outputs "out"))
                             (regpath (string-append out "/etc/px/accounts/plugins"))
                             (plugin-data (string-append "plugin:\n"
                                                                                        "   name: " ,name "\n"
                                                                                        "   version: " ,version "\n"
                                                                                        "   type: python\n")))

                     (install-file #$(plain-file "test-plugin.yaml" plugin-data) regpath))))
--------------------------------------------------------------------------------------------------

and error that I received during package build: 

--- ERROR: ------------------------------------------------------------------------------------
starting phase `register-plugin'
Backtrace:
           8 (primitive-load "/gnu/store/fpj6577yfiiz40ci39bw8zzycsy…")
In ice-9/eval.scm:
   191:35  7 (_ #f)
In srfi/srfi-1.scm:
   863:16  6 (every1 #<procedure 531a20 at /gnu/store/4r04fsfcryy5h…> …)
In /gnu/store/4r04fsfcryy5h4v2h3g6lzlibafmmdjm-module-import/guix/build/gnu-build-system.scm:
   799:28  5 (_ _)
In ice-9/eval.scm:
    619:8  4 (_ #(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …))
    159:9  3 (_ #(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …))
   182:19  2 (proc #(#(#(#(#(#(#(#<directory (gui…>) …) …) …) …) …) …))
   142:16  1 (compile-top-call _ (7 . ungexp) ((10 (13 15 7 . #) # …)))
In unknown file:
           0 (%resolve-variable (7 . ungexp) #<directory (guile-user…>)

ERROR: In procedure %resolve-variable:
Unbound variable: ungexp
--------------------------------------------------------------------------------------------------

does any one knows which package do I have to add in order to solve this issue? 


Best, 
Reza

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

* Re: package definition: unbound variable ungexp
  2019-06-09  6:26 package definition: unbound variable ungexp Reza Alizadeh Majd
@ 2019-06-09  7:26 ` Gábor Boskovits
  2019-06-09  7:30   ` Reza Alizadeh Majd
  2019-06-09  8:51 ` Julien Lepiller
  1 sibling, 1 reply; 6+ messages in thread
From: Gábor Boskovits @ 2019-06-09  7:26 UTC (permalink / raw)
  To: Reza Alizadeh Majd; +Cc: help-guix

Hello,

Reza Alizadeh Majd <r.majd@pantherx.org> ezt írta (időpont: 2019. jún. 9.,
V, 8:26):

> Hello Guix,
>
> I want to create a plain file during package build and copy it to output.
> but using following definition, I receive error on during package
> installation:
>
> --- CODE:
> -------------------------------------------------------------------------------------
> (add-after 'install 'register-plugin
>                (lambda* (#:key outputs #:allow-other-keys)
>                   (let* ((out     (assoc-ref outputs "out"))
>                              (regpath (string-append out
> "/etc/px/accounts/plugins"))
>                              (plugin-data (string-append "plugin:\n"
>
>               "   name: " ,name "\n"
>
>               "   version: " ,version "\n"
>
>               "   type: python\n")))
>
>                      (install-file #$(plain-file "test-plugin.yaml"
> plugin-data) regpath))))
>
> --------------------------------------------------------------------------------------------------
>
> and error that I received during package build:
>
> --- ERROR:
> ------------------------------------------------------------------------------------
> starting phase `register-plugin'
> Backtrace:
>            8 (primitive-load "/gnu/store/fpj6577yfiiz40ci39bw8zzycsy…")
> In ice-9/eval.scm:
>    191:35  7 (_ #f)
> In srfi/srfi-1.scm:
>    863:16  6 (every1 #<procedure 531a20 at /gnu/store/4r04fsfcryy5h…> …)
> In
> /gnu/store/4r04fsfcryy5h4v2h3g6lzlibafmmdjm-module-import/guix/build/gnu-build-system.scm:
>    799:28  5 (_ _)
> In ice-9/eval.scm:
>     619:8  4 (_ #(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …))
>     159:9  3 (_ #(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …))
>    182:19  2 (proc #(#(#(#(#(#(#(#<directory (gui…>) …) …) …) …) …) …))
>    142:16  1 (compile-top-call _ (7 . ungexp) ((10 (13 15 7 . #) # …)))
> In unknown file:
>            0 (%resolve-variable (7 . ungexp) #<directory (guile-user…>)
>
> ERROR: In procedure %resolve-variable:
> Unbound variable: ungexp
>
> --------------------------------------------------------------------------------------------------
>
> does any one knows which package do I have to add in order to solve this
> issue?
>
>
> Best,
> Reza
>
> I believe you are looking for (guix gexp) module.

Best regards,
g_bor
-- 
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21

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

* Re: package definition: unbound variable ungexp
  2019-06-09  7:26 ` Gábor Boskovits
@ 2019-06-09  7:30   ` Reza Alizadeh Majd
  0 siblings, 0 replies; 6+ messages in thread
From: Reza Alizadeh Majd @ 2019-06-09  7:30 UTC (permalink / raw)
  To: Gábor Boskovits; +Cc: help-guix

Hi, 

> I believe you are looking for (guix gexp) module.

I already added `(guix gexp)` to  #:use-module part of my module definition, but this problem was not fixed. 

Regards, 
Reza

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

* Re: package definition: unbound variable ungexp
  2019-06-09  6:26 package definition: unbound variable ungexp Reza Alizadeh Majd
  2019-06-09  7:26 ` Gábor Boskovits
@ 2019-06-09  8:51 ` Julien Lepiller
  2019-06-09  9:46   ` Reza Alizadeh Majd
  1 sibling, 1 reply; 6+ messages in thread
From: Julien Lepiller @ 2019-06-09  8:51 UTC (permalink / raw)
  To: help-guix, Reza Alizadeh Majd

Le 9 juin 2019 08:26:24 GMT+02:00, Reza Alizadeh Majd <r.majd@pantherx.org> a écrit :
>Hello Guix, 
>
>I want to create a plain file during package build and copy it to
>output. 
>but using following definition, I receive error on during package
>installation:
>
>--- CODE:
>-------------------------------------------------------------------------------------
>(add-after 'install 'register-plugin
>               (lambda* (#:key outputs #:allow-other-keys)
>                  (let* ((out     (assoc-ref outputs "out"))
>               (regpath (string-append out "/etc/px/accounts/plugins"))
>                             (plugin-data (string-append "plugin:\n"
>                                                 "   name: " ,name "\n"
>                                           "   version: " ,version "\n"
>                                                 "   type: python\n")))
>
>(install-file #$(plain-file "test-plugin.yaml" plugin-data) regpath))))
>--------------------------------------------------------------------------------------------------
>
>and error that I received during package build: 
>
>--- ERROR:
>------------------------------------------------------------------------------------
>starting phase `register-plugin'
>Backtrace:
>           8 (primitive-load "/gnu/store/fpj6577yfiiz40ci39bw8zzycsy…")
>In ice-9/eval.scm:
>   191:35  7 (_ #f)
>In srfi/srfi-1.scm:
>  863:16  6 (every1 #<procedure 531a20 at /gnu/store/4r04fsfcryy5h…> …)
>In
>/gnu/store/4r04fsfcryy5h4v2h3g6lzlibafmmdjm-module-import/guix/build/gnu-build-system.scm:
>   799:28  5 (_ _)
>In ice-9/eval.scm:
>    619:8  4 (_ #(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …))
>    159:9  3 (_ #(#(#(#(#(#(#(#<directory (guile-…>) …) …) …) …) …) …))
>   182:19  2 (proc #(#(#(#(#(#(#(#<directory (gui…>) …) …) …) …) …) …))
>   142:16  1 (compile-top-call _ (7 . ungexp) ((10 (13 15 7 . #) # …)))
>In unknown file:
>           0 (%resolve-variable (7 . ungexp) #<directory (guile-user…>)
>
>ERROR: In procedure %resolve-variable:
>Unbound variable: ungexp
>--------------------------------------------------------------------------------------------------
>
>does any one knows which package do I have to add in order to solve
>this issue? 
>
>
>Best, 
>Reza

Hi,

I think the issue is that the builder doesn't use (guix gexp). And you're not inside a gexp either, so you can't ungexp. I think what you can do is add an input with that code:

(inputs `(("test-plugin.yaml" ,(plain-file …))))

Then inside your build phase, simply install this input with:

(install-file (assoc-ref inputs "test-plugin.yaml") regpath)

Alternatively, you can write to the file directly in the phase:

(with-output-to-file (string-append regpath "/test-plugin.yaml")
  (lambda _
    (format #t "…")))

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

* Re: package definition: unbound variable ungexp
  2019-06-09  8:51 ` Julien Lepiller
@ 2019-06-09  9:46   ` Reza Alizadeh Majd
  2019-06-11 10:27     ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Reza Alizadeh Majd @ 2019-06-09  9:46 UTC (permalink / raw)
  To: Julien Lepiller, help-guix

Hi, 

> can do is add an input with that code:
> 
> (inputs `(("test-plugin.yaml" ,(plain-file …))))
> 
> Then inside your build phase, simply install this input with:
> 
> (install-file (assoc-ref inputs "test-plugin.yaml") regpath)
> 
> Alternatively, you can write to the file directly in the phase:
> 
> (with-output-to-file (string-append regpath "/test-plugin.yaml")
>   (lambda _
>     (format #t "…")))
>

Thanks, adding the file as an input solved the issue. 

Regards, 
Reza

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

* Re: package definition: unbound variable ungexp
  2019-06-09  9:46   ` Reza Alizadeh Majd
@ 2019-06-11 10:27     ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2019-06-11 10:27 UTC (permalink / raw)
  To: Reza Alizadeh Majd; +Cc: help-guix

Hi,

"Reza Alizadeh Majd" <r.majd@pantherx.org> skribis:

>> can do is add an input with that code:
>> 
>> (inputs `(("test-plugin.yaml" ,(plain-file …))))
>> 
>> Then inside your build phase, simply install this input with:
>> 
>> (install-file (assoc-ref inputs "test-plugin.yaml") regpath)
>> 
>> Alternatively, you can write to the file directly in the phase:
>> 
>> (with-output-to-file (string-append regpath "/test-plugin.yaml")
>>   (lambda _
>>     (format #t "…")))
>>
>
> Thanks, adding the file as an input solved the issue. 

Yes, that’s currently the only way.  What you wrote is not possible
because the package machinery does not use gexps yet.

Thanks,
Ludo’.

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

end of thread, other threads:[~2019-06-11 10:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-09  6:26 package definition: unbound variable ungexp Reza Alizadeh Majd
2019-06-09  7:26 ` Gábor Boskovits
2019-06-09  7:30   ` Reza Alizadeh Majd
2019-06-09  8:51 ` Julien Lepiller
2019-06-09  9:46   ` Reza Alizadeh Majd
2019-06-11 10:27     ` 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.