unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#75879: with-parameters does not work generally for packages
@ 2025-01-26 21:11 David Elsing
  0 siblings, 0 replies; only message in thread
From: David Elsing @ 2025-01-26 21:11 UTC (permalink / raw)
  To: 75879; +Cc: guix, dev, ludo, othacehe, zimon.toutoune, me

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

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


[-- Attachment #2: test-parameter-package.scm --]
[-- Type: text/plain, Size: 655 bytes --]

(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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-01-26 21:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-26 21:11 bug#75879: with-parameters does not work generally for packages David Elsing

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).