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>; dated Sun, 26 Jan 2025 21:12:01 UTC; Maintainer for guix is bug-guix@HIDDEN.

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: Sat, 15 Feb 2025 21:15:02 UTC

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