with-parameters does not work generally for packages

  • Open
  • quality assurance status badge
Details
2 participants
  • David Elsing
  • Ludovic Courtès
Owner
unassigned
Submitted by
David Elsing
Severity
important
D
D
David Elsing wrote on 26 Jan 22:11 +0100
(address . bug-guix@gnu.org)
7yikq1p9g4.fsf@posteo.net
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
(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
D
D
David Elsing wrote 6 days ago
Re: [bug#70895] [PATCH] grafts: Only compute necessary graft derivations.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 75879@debbugs.gnu.org)
86frky7fjc.fsf@posteo.net
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (4 lines)
> Uh, looks like this is a real bug. I’m surprised because we do have
> tests for that in ‘tests/gexp.scm’ (and it’s actually used in a few
> important places), but maybe they’re not exercising the right thing.

Yes indeed, 'with-parameters' is tested for %current-system and
%current-target-system, which are evaluated earlier as a special case in
the gexp-compiler of <parameterized>, and an additional parameter is
only tested by immediately evaluating it.

Best,
David
L
L
Ludovic Courtès wrote 37 hours ago
control message for bug #75879
(address . control@debbugs.gnu.org)
87v7to8muv.fsf@gnu.org
severity 75879 important
quit
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 75879@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 75879
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch