GNU bug report logs -
#75879
with-parameters does not work generally for packages
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
I noticed that 'with-parameters' from (guix gexp) does not work with
Guile parameters used in package definitions. They are still set
in 'lower-object', but not anymore when the monadic procedure returned
by 'lower-object' is evaluated.
Attached is an example for a package wrapped by 'with-parameters', which
results in a file with "D" instead of "C" (it is not "A", because the
'arguments' field of <package> is thunked).
Is this intentional? I'm not really sure how (or whether) this should be
changed though.
Best,
David
[test-parameter-package.scm (text/plain, inline)]
(use-modules
(guix build-system trivial)
(guix gexp)
(guix derivations)
(guix packages)
(guix store)
(gnu packages base))
(define %param
(make-parameter "A"))
(define testp
(package
(name "testp")
(version "0")
(source #f)
(build-system trivial-build-system)
(arguments
(list
#:builder
#~(let ((port (open-file (string-append #$output) "w")))
(display (string-append #$(%param) "\n") port)
(close-port port))))
(home-page #f)
(synopsis #f)
(description #f)
(license #f)))
(%param "B")
(define obj
(with-parameters
((%param "C"))
testp))
(%param "D")
obj
This bug report was last modified 77 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.