GNU bug report logs - #75879
with-parameters does not work generally for packages

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Severity: important; Reported by: David Elsing <david.elsing@HIDDEN>; Done: Ludovic Courtès <ludo@HIDDEN>; Maintainer for guix is bug-guix@HIDDEN.
bug closed, send any further explanations to 75879 <at> debbugs.gnu.org and David Elsing <david.elsing@HIDDEN> Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 75879 <at> debbugs.gnu.org:


Received: (at 75879) by debbugs.gnu.org; 25 Feb 2025 23:05:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 25 18:05:32 2025
Received: from localhost ([127.0.0.1]:48946 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tn3zY-0008M1-06
	for submit <at> debbugs.gnu.org; Tue, 25 Feb 2025 18:05:32 -0500
Received: from mout02.posteo.de ([185.67.36.66]:48657)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <david.elsing@HIDDEN>)
 id 1tn3zU-0008Lg-Pe
 for 75879 <at> debbugs.gnu.org; Tue, 25 Feb 2025 18:05:29 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 51FDF240101
 for <75879 <at> debbugs.gnu.org>; Wed, 26 Feb 2025 00:05:22 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1740524722; bh=1V6f3n3sGVQyaB++44cbFAmnXsH5sHdvisxggSGwoOQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 Content-Transfer-Encoding:From;
 b=IDeQ7AlSqW743be62tUADJSJ37gyogK11hqqzScrXCrnnbemIcM35srhsk9n8tIsq
 YfCvp3EvPcuIGqwZWngTbWjlyvOGo4CfFHl0fRhhNDPFoiN4L/Xq1mLkmKQWVf+0fZ
 WBuP4xoxCdzpR20u+AndU39vY8RiWzI4ZEywYxgDRVzFDjwgZMVujt8ZB+XDXC7Ka6
 IApVAST46CMiIHCL6Q8cna4JhBpbHkbH9lwbIaBwLc+YS3h0N7U55gDgfC9IhV5mSR
 TsSP6yODTA9FSVDbpaZpGWprFGET5NvT4uGh93PMXcfpC9XPDT63qHKZWeD454owXa
 z+N9qijFvsNjw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Z2Y9F2k5Qz6tm8;
 Wed, 26 Feb 2025 00:05:21 +0100 (CET)
From: David Elsing <david.elsing@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#75879: with-parameters does not work generally for packages
In-Reply-To: <87h64m5815.fsf@HIDDEN>
References: <7yikq1p9g4.fsf@HIDDEN> <87jz9qx6ud.fsf@HIDDEN>
 <8634gcxurc.fsf@HIDDEN> <87h64m5815.fsf@HIDDEN>
Date: Tue, 25 Feb 2025 23:05:20 +0000
Message-ID: <86h64hsk0f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 75879
Cc: dev@HIDDEN, zimon.toutoune@HIDDEN, othacehe@HIDDEN, me@HIDDEN,
 guix@HIDDEN, 75879 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Ludo',

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Problem is that the key must remain =E2=80=9Csmall=E2=80=9D so that compu=
ting its hash
> is fast.  It cannot grow further than its current size, I=E2=80=99m afrai=
d.

What if the hash is calculated in `compile-parameterized' instead (as
that is the only supported way to set the parameters) and passed to
`lower-object'?

> Ideally the key would contain only parameters known to be influential,
> but we cannot tell which are influential and which are not among those
> in the current dynamic state.

Yes that's true, I think the parameters affecting the key should only be
the ones passed to `with-parameters', other parameters would then be
assumed to be constant.

> The solution was to do the same as =E2=80=98mparameterize=E2=80=99 to ens=
ure that the
> extent during which parameters are set is the correct one given this is
> in a monadic context.

I think that's a good idea, but I'm not so convinced it makes sense for
a general monad [1]. An alternative solution [2] using `with-fluids*'
has a different problem however, as it doesn't seem to be compatible
with prompts.

Thanks,
David

[1] https://issues.guix.gnu.org/76485#2
[2] https://issues.guix.gnu.org/76485#3




Information forwarded to bug-guix@HIDDEN:
bug#75879; Package guix. Full text available.

Message received at 75879 <at> debbugs.gnu.org:


Received: (at 75879) by debbugs.gnu.org; 22 Feb 2025 15:11:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 22 10:11:48 2025
Received: from localhost ([127.0.0.1]:52716 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tlrAO-00041P-4O
	for submit <at> debbugs.gnu.org; Sat, 22 Feb 2025 10:11:47 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:42188)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tlrAA-0003yX-GD
 for 75879 <at> debbugs.gnu.org; Sat, 22 Feb 2025 10:11:39 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1tlrA4-0000Ae-5U; Sat, 22 Feb 2025 10:11:24 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=72DWYuDH5P00GG8+vnRzY67/0orcmHy0DHZsVhrDGuc=; b=biX5RHfSQT7n8XgzNxZh
 a/GhW+buM4AHeSZMzEwxT7Ek1gX0hjdIsVEqIYrKdiswJ2av4pQOiNyZNE4Y4lgn3Zdhbl8RIr6qI
 7B42INAl5wYw/aiBg+m8YKBQfF0G/LU1hmlnd9RaAMLBZxDWtxAwh7lSLOtxYZE+X0Bcr/K8jctbY
 lviscfmSbI+Yl8y1rE786poNiDrrllfEUlbA/oRv+o90Qx5tDJbz1EzNUQtzRM43DkHEeufaILoLI
 uAsUvGVzk84/Yl65rBwQL0QiHtMCY3VOzLXpfadUkymDlKEQAivTen/Ns3ZAVh4exAwwAgMX32BjE
 Qp0l5MIEGpQoKg==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: David Elsing <david.elsing@HIDDEN>
Subject: Re: bug#75879: with-parameters does not work generally for packages
In-Reply-To: <8634gcxurc.fsf@HIDDEN> (David Elsing's message of "Mon, 17
 Feb 2025 18:59:19 +0000")
References: <7yikq1p9g4.fsf@HIDDEN> <87jz9qx6ud.fsf@HIDDEN>
 <8634gcxurc.fsf@HIDDEN>
Date: Sat, 22 Feb 2025 16:11:18 +0100
Message-ID: <87h64m5815.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 75879
Cc: dev@HIDDEN, zimon.toutoune@HIDDEN, othacehe@HIDDEN, me@HIDDEN,
 guix@HIDDEN, 75879 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi David,

David Elsing <david.elsing@HIDDEN> skribis:

> Oh that's true, this is an additional problem. Would it make sense to
> add the parameters passed to `with-parameters' to the keys used in
> `mcached'? Then the parameters would have to be passed around quite a
> bit however...
> Alternatively, would it be possible to query the fluids with
> `current-dynamic-state' instead and use that for the keys in `mcached'?
> I don't see any way to inspect a dynamic state though.

Problem is that the key must remain =E2=80=9Csmall=E2=80=9D so that computi=
ng its hash
is fast.  It cannot grow further than its current size, I=E2=80=99m afraid.

Ideally the key would contain only parameters known to be influential,
but we cannot tell which are influential and which are not among those
in the current dynamic state.

> I think `with-parameters' only works for `%current-system' and
> `%current-target-system', not for `%graft?': When setting `%graft?' to
> #f in the second `with-parameters' wrapping in
> `graft-derivation/shallow', it still evaluates to the same derivation as
> with `%graft?' set to #t.

The patch I just sent=C2=B9 fixes this issue.

The solution was to do the same as =E2=80=98mparameterize=E2=80=99 to ensur=
e that the
extent during which parameters are set is the correct one given this is
in a monadic context.

Let me know what you think!

Thanks,
Ludo=E2=80=99.

=C2=B9 =E2=80=9Cgexp: =E2=80=98with-parameters=E2=80=99 properly handles =
=E2=80=98%graft?=E2=80=99.=E2=80=9D
  I cannot see it yet in Debbugs.




Information forwarded to bug-guix@HIDDEN:
bug#75879; Package guix. Full text available.

Message received at 75879 <at> debbugs.gnu.org:


Received: (at 75879) by debbugs.gnu.org; 17 Feb 2025 18:59:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 17 13:59:31 2025
Received: from localhost ([127.0.0.1]:49172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tk6L5-0006PY-Dk
	for submit <at> debbugs.gnu.org; Mon, 17 Feb 2025 13:59:31 -0500
Received: from mout02.posteo.de ([185.67.36.66]:56445)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <david.elsing@HIDDEN>)
 id 1tk6L2-0006On-04
 for 75879 <at> debbugs.gnu.org; Mon, 17 Feb 2025 13:59:29 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 163AE240101
 for <75879 <at> debbugs.gnu.org>; Mon, 17 Feb 2025 19:59:21 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1739818761; bh=J0G85lSKKjd5eFnWDwDt0uN5TCwo8ZibJKnKFcpVT/E=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=QReydijOy7pIMLOv6awl1jD3FHEmYZwx+N/MoNvw3D6JCXf3LIxKeR+BLFyGmLPD2
 4O6arpkixs3NHNgWJ1sZDApmcok3FlvQCURq6Q1wrxGyl91WNLa0mCl44ZyIilk7Z5
 2WXec1QnZL7vpCTOglNgiItzdZUWO1IjDR1T8g9U4O7+2yFxuqZ7b0rTSseq5eR66/
 RTea0ZOS7C7iJnMArSuURXIDId+ByPxSJyYAkNlW7MakEWK1WKqqdZJWdHx2db0T5W
 LH6Ey4NjROcJBRiu39Yt80S6ZMUymI46vgMaqMV/QJo+YLv7FNfjxJBwrQWmb0XlIl
 widiO7mOXeOiA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4YxX5344yFz9rxF;
 Mon, 17 Feb 2025 19:59:19 +0100 (CET)
From: David Elsing <david.elsing@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#75879: with-parameters does not work generally for packages
In-Reply-To: <87jz9qx6ud.fsf@HIDDEN>
References: <7yikq1p9g4.fsf@HIDDEN> <87jz9qx6ud.fsf@HIDDEN>
Date: Mon, 17 Feb 2025 18:59:19 +0000
Message-ID: <8634gcxurc.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 75879
Cc: dev@HIDDEN, zimon.toutoune@HIDDEN, othacehe@HIDDEN, me@HIDDEN,
 guix@HIDDEN, 75879 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Ludo',

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Something just came to mind: the object cache.  The cache is keyed by
> object + system + target + grafts?; if there=E2=80=99s anything that infl=
uences
> what the object lowers to, changes are the object->derivation mapping is
> already cached and that other thing will be ignored.

Oh that's true, this is an additional problem. Would it make sense to
add the parameters passed to `with-parameters' to the keys used in
`mcached'? Then the parameters would have to be passed around quite a
bit however...
Alternatively, would it be possible to query the fluids with
`current-dynamic-state' instead and use that for the keys in `mcached'?
I don't see any way to inspect a dynamic state though.

> That=E2=80=99s a problem generally speaking with using =E2=80=98with-para=
meters=E2=80=99 with
> parameters other than =E2=80=98%current-system=E2=80=99, =E2=80=98%curren=
t-target-system=E2=80=99, and
> =E2=80=98%graft?=E2=80=99.

I think `with-parameters' only works for `%current-system' and
`%current-target-system', not for `%graft?': When setting `%graft?' to
#f in the second `with-parameters' wrapping in
`graft-derivation/shallow', it still evaluates to the same derivation as
with `%graft?' set to #t.

> I wonder if it=E2=80=99s the only thing at play here though.

No, attached is a simplified example without a package using a record
(named <test>) with a (thunked) field. Removing the `mcached' calls in
(guix gexp) results in the same derivation. I think this is because
`lower-object' returns a monadic procedure, which does not keep the
fluids set by `with-parameters', so when the (thunked) field is
evaluated, the parameter has changed.

Maybe it would be good to pass the parameters from the gexp compiler of
<parameterized> to `lower-object' as additional argument and use
`with-fluids*' there (just before `lower' is called)? This worked for
the <test> record defined in the attachment, but not for a package, I
guess because of the expander? I'm not sure how to pass the parameters
in that case though.

Best,
David


--=-=-=
Content-Type: text/plain
Content-Disposition: inline; filename=test-parameter-thunked.scm

(use-modules
 (guix gexp)
 (guix monads)
 (guix records)
 (guix store)
 (guix utils))

(define-record-type* <test>
  test make-test
  test?
  this-test
  (field test-field (thunked)))

(define* (test->derivation test)
  (with-monad %store-monad
   (gexp->derivation
    "test"
    #~(let ((port (open-file #$output "w")))
        (display
         (string-append #$(test-field test) "\n") port)
        (close-port port)))))

(define-gexp-compiler (test-compiler (test <test>) system target)
  (test->derivation test))

(define %param
  (make-parameter "A"))

(define testvalue
  (test
   (field (%param))))

(%param "B")

(define testvalue2
  (with-parameters
      ((%param "C"))
    testvalue))

(%param "D")

testvalue2

--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#75879; Package guix. Full text available.

Message received at 75879 <at> debbugs.gnu.org:


Received: (at 75879) by debbugs.gnu.org; 15 Feb 2025 20:59:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 15:59:20 2025
Received: from localhost ([127.0.0.1]:58216 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tjPFw-0004Gd-Hg
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2025 15:59:20 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:53818)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1tjPFu-0004GI-0J
 for 75879 <at> debbugs.gnu.org; Sat, 15 Feb 2025 15:59:18 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1tjPFo-0002Uo-Dj; Sat, 15 Feb 2025 15:59:12 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=g7VRpzqJh8zmvJ2lmnjBhZrLzW3LMqhBr171JA6SExg=; b=GewKbij6jl6CDODcIDfm
 5B/yIFEmeuDEq4S5eVOphANrzCbgwGQ+qyCBmZF4fvKW1QbVyBvOCbtUPvyyOQfMTMAbzDWsahrzT
 QTGbcmCNwPPaPPrVp3z+TpnHruVbMBaRHMnAqsR+MA4i4O7oEl2U3uYlZBsJ/OQQ9m4KyR7oaGp1M
 Ckdd2OWWWG3ZYtrUwKSvGYdo6mXHlUHv/kFmJKAY3z8g0Jo7HZuMVMBk0+TZp8YUg44cXV9vO4VGR
 sygY1gjcYGsvFC5El/mIBsM/uG937J2sUq0h7xPKQxGSS1nLYFzZ9F4auYjXMbF/QZTeBnu0/a9+u
 lALCkWDSYHdZZQ==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: David Elsing <david.elsing@HIDDEN>
Subject: Re: bug#75879: with-parameters does not work generally for packages
In-Reply-To: <7yikq1p9g4.fsf@HIDDEN> (David Elsing's message of "Sun, 26
 Jan 2025 21:11:07 +0000")
References: <7yikq1p9g4.fsf@HIDDEN>
Date: Sat, 15 Feb 2025 21:59:06 +0100
Message-ID: <87jz9qx6ud.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 75879
Cc: dev@HIDDEN, zimon.toutoune@HIDDEN, othacehe@HIDDEN, me@HIDDEN,
 guix@HIDDEN, 75879 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi David,

David Elsing <david.elsing@HIDDEN> skribis:

> 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.

Something just came to mind: the object cache.  The cache is keyed by
object + system + target + grafts?; if there=E2=80=99s anything that influe=
nces
what the object lowers to, changes are the object->derivation mapping is
already cached and that other thing will be ignored.

That=E2=80=99s a problem generally speaking with using =E2=80=98with-parame=
ters=E2=80=99 with
parameters other than =E2=80=98%current-system=E2=80=99, =E2=80=98%current-=
target-system=E2=80=99, and
=E2=80=98%graft?=E2=80=99.

I wonder if it=E2=80=99s the only thing at play here though.

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#75879; Package guix. Full text available.
Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 75879 <at> debbugs.gnu.org:


Received: (at 75879) by debbugs.gnu.org; 31 Jan 2025 23:02:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 31 18:02:58 2025
Received: from localhost ([127.0.0.1]:55341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1te02M-0002C8-1d
	for submit <at> debbugs.gnu.org; Fri, 31 Jan 2025 18:02:58 -0500
Received: from mout02.posteo.de ([185.67.36.66]:57741)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <david.elsing@HIDDEN>)
 id 1te02J-0002Bs-CY
 for 75879 <at> debbugs.gnu.org; Fri, 31 Jan 2025 18:02:57 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id B39C5240103
 for <75879 <at> debbugs.gnu.org>; Sat,  1 Feb 2025 00:02:48 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1738364568; bh=leFUe7B38hXNTKoifT7Mg3VgRbX0jkdF65yXgsqzClE=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 Content-Transfer-Encoding:From;
 b=O7uDK5yufWSwIzo7aMecS9w9bVOpkJOQqtWFUqRKgmDhpnySaevpPe8VQyU8lx6rZ
 jRBfs6J8JHCflRofDVKQjvpeN8mdLZudq5pRJul4krVGnfu9g75qTERnqAap6QfF7y
 AHovI9GMx6TCbAH8JdajhPXj6m2tjIGTQNyceFEufeQoUTDFSWnohNUKYwP3nnDixl
 pjv7kZRnw6e0JYOAdiZUIsEhjSFY+++7ZQnFLuYAcHqD5cFMXnHy99XsZafKyu9K6P
 xCbmXYlMY7XSa/J0yO42+ffoB5axkbUi4Q5KebK+DhPotUuNqWm3Wm6/w0EGB6Gjtj
 SyHlxG0YJNv0w==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4YlBHq5SXHz9rxD;
 Sat,  1 Feb 2025 00:02:47 +0100 (CET)
From: David Elsing <david.elsing@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#70895] [PATCH] grafts: Only compute necessary graft
 derivations.
In-Reply-To: <874j1fc5lm.fsf@HIDDEN>
References: <20240512134301.2234-1-david.elsing@HIDDEN>
 <87zfs1921p.fsf@HIDDEN> <7ycyov5amj.fsf@HIDDEN>
 <87ikqbsp58.fsf@HIDDEN> <86sepetrtn.fsf@HIDDEN>
 <87h65tkqvx.fsf@HIDDEN> <7yldv3q3d1.fsf@HIDDEN>
 <87plk7aq27.fsf@HIDDEN> <7yfrl1pgcs.fsf@HIDDEN>
 <874j1fc5lm.fsf@HIDDEN>
Date: Fri, 31 Jan 2025 23:02:47 +0000
Message-ID: <86frky7fjc.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 75879
Cc: 75879 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hello,

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Uh, looks like this is a real bug.  I=E2=80=99m surprised because we do h=
ave
> tests for that in =E2=80=98tests/gexp.scm=E2=80=99 (and it=E2=80=99s actu=
ally used in a few
> important places), but maybe they=E2=80=99re not exercising the right thi=
ng.

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




Information forwarded to bug-guix@HIDDEN:
bug#75879; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Jan 2025 21:11:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 26 16:11:22 2025
Received: from localhost ([127.0.0.1]:58115 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tc9uc-0004fW-BU
	for submit <at> debbugs.gnu.org; Sun, 26 Jan 2025 16:11:22 -0500
Received: from lists.gnu.org ([2001:470:142::17]:58844)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <david.elsing@HIDDEN>)
 id 1tc9ua-0004fG-Ah
 for submit <at> debbugs.gnu.org; Sun, 26 Jan 2025 16:11:20 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <david.elsing@HIDDEN>)
 id 1tc9uT-0008P0-Vq
 for bug-guix@HIDDEN; Sun, 26 Jan 2025 16:11:14 -0500
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <david.elsing@HIDDEN>)
 id 1tc9uR-0007M5-St
 for bug-guix@HIDDEN; Sun, 26 Jan 2025 16:11:13 -0500
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 195B4240101
 for <bug-guix@HIDDEN>; Sun, 26 Jan 2025 22:11:08 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1737925868; bh=vIXHk6YYZSWZnT6W+9sLGF0yPYwupdYDZqzsz6HTi6o=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From;
 b=iWmpWw7CGwgUHbUW2yL1OxSTb6hoXcvzVClzKkxHXFXM63q8V240XD2zmeNge4573
 LJ6CuRM4K4YIaydXncFkmMzVMLChz/7r4cuh4kZmHKiGO4dYlJYzWbjW6Z5qky28N4
 E7DrR4OMbrzWMHAOppcIx0If8wQYSRnk9iGSgwcttwqrHPQpY7jxP5WNsg2HJN20e4
 q1HLTJSMYkbv8ZnR/kidWUa62JrzN//vpgd11yOU+7gI6w9z2SO2WfVJe5hNDnnET6
 GrZJgl/TpD3RYqZnzJKN2rhPOJNww3WYoSpNfCgxN4F9i7akFkQdGkIVqgKVWtWV0M
 TP9/krFDRTroQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Yh43H5Lkgz9rxM
 for <bug-guix@HIDDEN>; Sun, 26 Jan 2025 22:11:07 +0100 (CET)
From: David Elsing <david.elsing@HIDDEN>
To: bug-guix@HIDDEN
Subject: with-parameters does not work generally for packages
X-Debbugs-Cc: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN,
 othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN
Date: Sun, 26 Jan 2025 21:11:07 +0000
Message-ID: <7yikq1p9g4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.66;
 envelope-from=david.elsing@HIDDEN; helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--=-=-=
Content-Type: text/plain

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


--=-=-=
Content-Type: text/plain
Content-Disposition: inline; filename=test-parameter-package.scm

(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

--=-=-=--




Acknowledgement sent to David Elsing <david.elsing@HIDDEN>:
New bug report received and forwarded. Copy sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, bug-guix@HIDDEN. Full text available.
Report forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, bug-guix@HIDDEN:
bug#75879; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 11 Mar 2025 14:45:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.