[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with G-expression
From: |
zimoun |
Subject: |
Re: Help with G-expression |
Date: |
Fri, 02 Dec 2022 14:19:26 +0100 |
Hi Ludo,
On Fri, 02 Dec 2022 at 10:09, Ludovic Courtès <ludo@gnu.org> wrote:
> zimoun <zimon.toutoune@gmail.com> skribis:
>
>> no code for module (guix config)
>
> (guix config) is added by using ‘make-config.scm’; there’s an example in
> (gnu services base).
>
> For the rest, make sure to use ‘source-module-closure’ or you’ll miss
> modules (info "(guix) G-Expressions").
I have read this section. :-) Something is not clear for me.
Note that ’make-config.scm’ does not appear in the manual.
The only difference between the previous ’work’ example and all the
’fail’ as ’fail-again-not-fixed’ is only the part ’with-imported-modules’.
Well, I am somehow surprised how difficult is to find the correct.
--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> (define (fail-again-not-fixed)
(with-imported-modules (source-module-closure
'((guix build utils)
(guix config)
(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-not-fixed)
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---
Here it is the same error as ’fail-again’. And I do not understand the
magic invocation. Well, what I tried next:
--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> (define (fail-again-bis)
(with-imported-modules `(((guix config) => ,(make-config.scm))
,@(source-module-closure '((guix build utils)
(guix profiles))
#:select? not-config?))
(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"))))))
;;; <unknown-location>: warning: possibly unbound variable `make-config.scm'
;;; <unknown-location>: warning: possibly unbound variable `not-config?'
scheme@(guix-user)> ,build (fail-again-bis)
While executing meta-command:
error: make-config.scm: unbound variable
scheme@(guix-user)> ,use(guix self)
scheme@(guix-user)> ,build (fail-again-bis)
While executing meta-command:
error: not-config?: unbound variable
scheme@(guix-user)> (define not-config?
;; Select (guix …) and (gnu …) modules, except (guix config).
(match-lambda
(('guix 'config) #f)
(('guix rest ...) #t)
(('gnu rest ...) #t)
(rest #f)))
scheme@(guix-user)> ,build (fail-again-bis)
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/xjvjrkl3559jrlm0bnvdj29c838y81x3-config.scm.drv...
building /gnu/store/slwgyy4vnxprz0cj73vyq6psr7bqmbwz-module-import.drv...
building
/gnu/store/cfjpfzph97dsishvr7g1bqxqw5kynns8-module-import-compiled.drv...
20% [#############################
]builder for
`/gnu/store/cfjpfzph97dsishvr7g1bqxqw5kynns8-module-import-compiled.drv' failed
with exit code 1
build of /gnu/store/cfjpfzph97dsishvr7g1bqxqw5kynns8-module-import-compiled.drv
failed
View build log at
'/var/log/guix/drvs/cf/jpfzph97dsishvr7g1bqxqw5kynns8-module-import-compiled.drv.gz'.
cannot build derivation
`/gnu/store/pr3qqw26jilyhyn650i3w7z13i7k6p40-empty-tree.drv': 1 dependencies
couldn't be built
While executing meta-command:
ERROR:
1. &store-protocol-error:
message: "build of
`/gnu/store/pr3qqw26jilyhyn650i3w7z13i7k6p40-empty-tree.drv' failed"
status: 100
--8<---------------cut here---------------end--------------->8---
Below the log file – missing (gcrypt hash).
Well, I give up because the try-error does not explain me how it
works. :-)
Any pointers?
Cheers,
simon
--8<---------------cut here---------------start------------->8---
[ 1/56] Loading './guix/base16.scm'...
[ 2/56] Loading './guix/base32.scm'...
[ 3/56] Loading './guix/base64.scm'...
[ 4/56] Loading './guix/build/syscalls.scm'...
[ 5/56] Loading './guix/build/utils.scm'...
[ 6/56] Loading './guix/build-system.scm'...
[ 7/56] Loading './guix/colors.scm'...
[ 8/56] Loading './guix/combinators.scm'...
[ 9/56] Loading './guix/config.scm'...
[10/56] Loading './guix/deprecation.scm'...
[11/56] Loading './guix/derivations.scm'...
;;; Failed to autoload make-zlib-input-port in (zlib):
;;; no code for module (zlib)
;;; Failed to autoload make-zlib-input-port in (zlib):
;;; no code for module (zlib)
;;; Failed to autoload make-zlib-output-port in (zlib):
;;; no code for module (zlib)
;;; Failed to autoload make-zlib-output-port in (zlib):
;;; no code for module (zlib)
Backtrace:
In ice-9/boot-9.scm:
3556:26 19 (_)
In unknown file:
18 (primitive-load-path "guix/store" #<procedure 7fffed89b?>)
In ice-9/eval.scm:
721:20 17 (primitive-eval _)
In ice-9/psyntax.scm:
1230:36 16 (expand-top-sequence _ _ _ #f _ _ _)
1222:19 15 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
259:10 14 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) ?)
In ice-9/eval.scm:
293:34 13 (_ #<module (#{ g170}#) 7fffee23baa0>)
In ice-9/boot-9.scm:
3409:4 12 (define-module* _ #:filename _ #:pure _ #:version _ # _ ?)
3422:24 11 (_)
222:29 10 (map1 _)
222:29 9 (map1 _)
222:29 8 (map1 _)
222:29 7 (map1 _)
222:29 6 (map1 _)
222:29 5 (map1 (((guix monads)) ((guix records)) ((guix #)) (#) ?))
222:29 4 (map1 (((guix records)) ((guix base16)) ((guix #)) (#) ?))
222:29 3 (map1 (((guix base16)) ((guix base32)) ((gcrypt #)) # ?))
222:29 2 (map1 (((guix base32)) ((gcrypt hash)) ((guix #)) (#) ?))
222:17 1 (map1 (((gcrypt hash)) ((guix profiling)) ((rnrs #)) # ?))
3329:6 0 (resolve-interface (gcrypt hash) #:select _ #:hide _ # _ ?)
ice-9/boot-9.scm:3329:6: In procedure resolve-interface:
no code for module (gcrypt hash)
--8<---------------cut here---------------end--------------->8---
- Help with G-expression, zimoun, 2022/12/01
- Re: Help with G-expression, (, 2022/12/01
- Re: Help with G-expression, zimoun, 2022/12/01
- Re: Help with G-expression, Ludovic Courtès, 2022/12/02
- Re: Help with G-expression,
zimoun <=
- Re: Help with G-expression, Ludovic Courtès, 2022/12/02
- Re: Help with G-expression, zimoun, 2022/12/02
- Re: Help with G-expression, Ludovic Courtès, 2022/12/03
- Re: Help with G-expression, zimoun, 2022/12/04