guix-devel
[Top][All Lists]
Advanced

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

Help with G-expression


From: zimoun
Subject: Help with G-expression
Date: Thu, 01 Dec 2022 18:34:32 +0100

Hi,

Trying to make a Guix script for extracting BigBlueButton videos – the
ones from Café Guix for instance – I am very puzzled by G-expression.

Well, I am trying to adapt this one [1].  But I am failing…

The manual has this example [1],

--8<---------------cut here---------------start------------->8---
(with-imported-modules '((guix build utils))  ;import it
  (computed-file "empty-tree"
                 #~(begin
                     ;; Put it in scope.
                     (use-modules (guix build utils))

                     ;; Happily use its 'mkdir-p' procedure.
                     (mkdir-p (string-append #$output "/a/b/c")))))
--8<---------------cut here---------------end--------------->8---

Which I turn into a function, and from “guix repl”

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> (define (work)
  (with-imported-modules '((guix build utils))  ;import it
    (computed-file "empty-tree"
                   #~(begin
                       ;; Put it in scope.
                       (use-modules (guix build utils))

                       ;; Happily use its 'mkdir-p' procedure.
                       (mkdir-p (string-append #$output "/a/b/c"))))))

scheme@(guix-user)> ,build (work)
$1 = "/gnu/store/d8psk7dsczqj65sc8bqigpi6ffhd0wvn-empty-tree"
--8<---------------cut here---------------end--------------->8---

where “tree /gnu/store/d8psk7dsczqj65sc8bqigpi6ffhd0wvn-empty-tree” shows the 
tree a/b/c.  So far, so
good.

If instead, I just add the module (guix profiles), then it fails.

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> (define (fail)
  (with-imported-modules '((guix build utils)
                           (guix profiles))  ;import it
    (computed-file "empty-tree"
                   #~(begin
                       ;; Put it in scope.
                       (use-modules (guix build utils))

                       ;; Happily use its 'mkdir-p' procedure.
                       (mkdir-p (string-append #$output "/a/b/c"))))))
scheme@(guix-user)> ,build (fail)
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
building 
/gnu/store/g1jbxhhz4b7zcyixhy4vw13brn2fncia-module-import-compiled.drv...
 50% [####################################                                     
]builder for 
`/gnu/store/g1jbxhhz4b7zcyixhy4vw13brn2fncia-module-import-compiled.drv' failed 
with exit code 1
build of /gnu/store/g1jbxhhz4b7zcyixhy4vw13brn2fncia-module-import-compiled.drv 
failed
View build log at 
'/var/log/guix/drvs/g1/jbxhhz4b7zcyixhy4vw13brn2fncia-module-import-compiled.drv.gz'.
cannot build derivation 
`/gnu/store/ln5yb7lvdknr3azc5zh2m3239adgmsjj-empty-tree.drv': 1 dependencies 
couldn't be built
While executing meta-command:
ERROR:
  1. &store-protocol-error:
      message: "build of 
`/gnu/store/ln5yb7lvdknr3azc5zh2m3239adgmsjj-empty-tree.drv' failed"
      status: 100
--8<---------------cut here---------------end--------------->8---

Well, the message is not really helping. :-)

Then, because I am not sure to fully understand the difference, let add
’source-module-closure’.

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use(guix modules)
scheme@(guix-user)> (define (fail-again)
  (with-imported-modules (source-module-closure
                          '((guix build utils)
                            (guix profiles)))  ;import it
    (computed-file "empty-tree"
                   #~(begin
                       ;; Put it in scope.
                       (use-modules (guix build utils))

                       ;; Happily use its 'mkdir-p' procedure.
                       (mkdir-p (string-append #$output "/a/b/c"))))))
scheme@(guix-user)> ,build (fail-again)
While executing meta-command:
Throw to key `match-error' with args `("match" "no matching pattern" 
(#:declarative? #f #:export (%guix-package-name %guix-version 
%guix-bug-report-address %guix-home-page-url %channel-metadata %system 
%store-directory %state-directory %store-database-directory %config-directory 
%gzip %bzip2 %xz)))'.
--8<---------------cut here---------------end--------------->8---

Ah, another message.  Not helping either. :-)


What do I miss or am doing wrong?


1: 
<https://gitlab.inria.fr/guix-hpc/website/-/blob/6977da4618814c790e767618da5cf9ec2cab0742/doc/atelier-reproductibilit%C3%A9/render-videos.scm>
2: https://guix.gnu.org/manual/devel/en/guix.html#Build-Utilities

Cheers,
simon



reply via email to

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