all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problems when trying to install a package via guile API
@ 2014-08-14  2:44 David Thompson
  2014-08-14  4:46 ` Alex Kost
  2014-08-16  9:32 ` Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: David Thompson @ 2014-08-14  2:44 UTC (permalink / raw)
  To: guix-devel

Hello all,

I'm trying to learn to use the Guix API to install packages so that I
can write a web frontend.  However, I'm running into issues when trying
to create a derivation.

Here's a problematic code snippet:

(use-modules (guix derivations)
             (guix monads)
             (guix packages)
             (guix profiles)
             (guix store)
             (gnu packages guile))

(define %store (open-connection))
(define profile "/usr/var/guix/profiles/per-user/dave/guix-profile")
(define manifest (profile-manifest profile))
(define new (manifest-add manifest
                          (list (package->manifest-entry guile-2.0))))
(define prof-drv (run-with-store %store
                   (profile-derivation new)))

The error:

ERROR: In procedure #<syntax-transformer derivation?>:
ERROR: Wrong type to apply: #<syntax-transformer derivation?>

           0 (#<syntax-transformer derivation?> #<derivation /gnu/store/mq7cx62…>)

I've been slowly figuring things out by reading
guix/scripts/package.scm, but I can't seem to get this part right.  Does
anyone have an idea of what I'm doing wrong?

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

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

* Re: Problems when trying to install a package via guile API
  2014-08-14  2:44 Problems when trying to install a package via guile API David Thompson
@ 2014-08-14  4:46 ` Alex Kost
  2014-08-16  9:32 ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Alex Kost @ 2014-08-14  4:46 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

Hello,

David Thompson (2014-08-14 06:44 +0400) wrote:

> Hello all,
>
> I'm trying to learn to use the Guix API to install packages so that I
> can write a web frontend.  However, I'm running into issues when trying
> to create a derivation.
>
> Here's a problematic code snippet:
>
> (use-modules (guix derivations)
>              (guix monads)
>              (guix packages)
>              (guix profiles)
>              (guix store)
>              (gnu packages guile))
>
> (define %store (open-connection))
> (define profile "/usr/var/guix/profiles/per-user/dave/guix-profile")
> (define manifest (profile-manifest profile))
> (define new (manifest-add manifest
>                           (list (package->manifest-entry guile-2.0))))
> (define prof-drv (run-with-store %store
>                    (profile-derivation new)))
>
> The error:
>
> ERROR: In procedure #<syntax-transformer derivation?>:
> ERROR: Wrong type to apply: #<syntax-transformer derivation?>
>
>            0 (#<syntax-transformer derivation?> #<derivation /gnu/store/mq7cx62…>)
>
> I've been slowly figuring things out by reading
> guix/scripts/package.scm, but I can't seem to get this part right.  Does
> anyone have an idea of what I'm doing wrong?

Your code works for me, do you use the latest "guix pull"?

I vaguely recall that I had some <syntax-transformer> that was cured by
"guix pull".

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

* Re: Problems when trying to install a package via guile API
  2014-08-14  2:44 Problems when trying to install a package via guile API David Thompson
  2014-08-14  4:46 ` Alex Kost
@ 2014-08-16  9:32 ` Ludovic Courtès
  2014-08-18 15:13   ` Mark H Weaver
  1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2014-08-16  9:32 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> skribis:

> ERROR: In procedure #<syntax-transformer derivation?>:
> ERROR: Wrong type to apply: #<syntax-transformer derivation?>
>
>            0 (#<syntax-transformer derivation?> #<derivation /gnu/store/mq7cx62…>)

This looks like a miscompilation issue: it seems that the module where
that happens didn’t have the ‘derivation?’ macro visible at build time,
and so at run-time it aborts like this.  Do you know where that happens?

HTH,
Ludo’.

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

* Re: Problems when trying to install a package via guile API
  2014-08-16  9:32 ` Ludovic Courtès
@ 2014-08-18 15:13   ` Mark H Weaver
  2014-08-18 15:17     ` Thompson, David
  0 siblings, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2014-08-18 15:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> David Thompson <dthompson2@worcester.edu> skribis:
>
>> ERROR: In procedure #<syntax-transformer derivation?>:
>> ERROR: Wrong type to apply: #<syntax-transformer derivation?>
>>
>>            0 (#<syntax-transformer derivation?> #<derivation /gnu/store/mq7cx62…>)
>
> This looks like a miscompilation issue: it seems that the module where
> that happens didn’t have the ‘derivation?’ macro visible at build time,
> and so at run-time it aborts like this.  Do you know where that happens?

FWIW, very soon after his original post, I read on #guix that David did
a clean rebuild of Guix and that solved the problem.

     Mark

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

* Re: Problems when trying to install a package via guile API
  2014-08-18 15:13   ` Mark H Weaver
@ 2014-08-18 15:17     ` Thompson, David
  0 siblings, 0 replies; 5+ messages in thread
From: Thompson, David @ 2014-08-18 15:17 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

On Mon, Aug 18, 2014 at 11:13 AM, Mark H Weaver <mhw@netris.org> wrote:
> ludo@gnu.org (Ludovic Courtès) writes:
>
>> David Thompson <dthompson2@worcester.edu> skribis:
>>
>>> ERROR: In procedure #<syntax-transformer derivation?>:
>>> ERROR: Wrong type to apply: #<syntax-transformer derivation?>
>>>
>>>            0 (#<syntax-transformer derivation?> #<derivation /gnu/store/mq7cx62…>)
>>
>> This looks like a miscompilation issue: it seems that the module where
>> that happens didn’t have the ‘derivation?’ macro visible at build time,
>> and so at run-time it aborts like this.  Do you know where that happens?
>
> FWIW, very soon after his original post, I read on #guix that David did
> a clean rebuild of Guix and that solved the problem.
>
>      Mark

Yes, indeed.  Sorry for not updating the list!

- Dave

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

end of thread, other threads:[~2014-08-18 15:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14  2:44 Problems when trying to install a package via guile API David Thompson
2014-08-14  4:46 ` Alex Kost
2014-08-16  9:32 ` Ludovic Courtès
2014-08-18 15:13   ` Mark H Weaver
2014-08-18 15:17     ` Thompson, David

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.