all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help with G-expression
@ 2022-12-01 17:34 zimoun
  2022-12-01 18:21 ` (
  0 siblings, 1 reply; 9+ messages in thread
From: zimoun @ 2022-12-01 17:34 UTC (permalink / raw)
  To: Guix Devel; +Cc: Ludovic Courtès

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


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

end of thread, other threads:[~2022-12-04 11:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-01 17:34 Help with G-expression zimoun
2022-12-01 18:21 ` (
2022-12-01 18:52   ` zimoun
2022-12-02  9:09     ` Ludovic Courtès
2022-12-02 13:19       ` zimoun
2022-12-02 21:30         ` Ludovic Courtès
2022-12-02 22:00           ` zimoun
2022-12-03 17:43             ` Ludovic Courtès
2022-12-04 11:11               ` zimoun

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.