From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id gCDNMpC5H2WjGAAAauVa8A:P1 (envelope-from ) for ; Fri, 06 Oct 2023 09:38:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gCDNMpC5H2WjGAAAauVa8A (envelope-from ) for ; Fri, 06 Oct 2023 09:38:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A2E8F469B3 for ; Fri, 6 Oct 2023 09:38:55 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tilde.club header.s=mail header.b=CKB14xi3; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tilde.club (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696577936; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Ve2nUYiJjQZ5zlgZMo6C6MZwqDwPFYm44EGeABiuqi4=; b=cvlv+RKQvAYFIg7khVH3ZBY0GJ6tyfk44cthGTmF1ZEjPNPOFVRfpIinwt8Lf7wTRApF72 vJI+cHHhT+9maYieTPIipOISgj6+0UcY5M5hTlAJ/bVICiCTZ3liN5HWJ1eUSjQVUe2FsA gowUJU6yWYAJ/RsNK8ClIi1pbJzz6nDYLGnITdXpqwZYgC7yhQE7u1RAtOSCn2pROHLRIY cW2OwuUsrQuQ+9/mAn1zW0W4856FGgTkTO9bapu98wRR+wOaq28VZ9GsjOs746gFqtI+oM NmJRQvYFk02iwSxwBikzzSzvGaK0f/ldiC2YEyaX0DiTbXmMAR68mgcuBd037g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696577936; a=rsa-sha256; cv=none; b=M1FA3RRVIgnEFm43PKxs+4bNa/uvl9mFP8ChwjNbhP70LpaLVify7cE0cip2ozA2HaUg3T jE5+g7jYSZmR3WJJpjy8+5DLzSlBXz8VSbTlS9MePyFIuzyzNltGhrOvKhx5EDbAiwtzOp nRamYT+WHXY4zzNS1FAZF91S68dh12UDPbnBto2IlYAN+lGm+CNHzYTRXOvx4e1QfUOtSx m7xJXzyAVaai0MSjkawYx2wqQGLS7zCq/ZN3ovLWpS/uxVWVNTKxAaCw15A3CSQMk3jhTp r62iXsWpRKB560ZPcvrPw8l8c4jxM647nyEoTh1cn988acoM1n84Bm5spzi1CA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tilde.club header.s=mail header.b=CKB14xi3; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=tilde.club (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qofQ5-0006lz-Pv; Fri, 06 Oct 2023 03:38:45 -0400 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 ) id 1qofQ3-0006la-SK for bug-guix@gnu.org; Fri, 06 Oct 2023 03:38:43 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qofQ3-0004QT-KH for bug-guix@gnu.org; Fri, 06 Oct 2023 03:38:43 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qofQL-0005eW-RP for bug-guix@gnu.org; Fri, 06 Oct 2023 03:39:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65665: [PATCH] Really get all the implicit inputs. Resent-From: Ulf Herrman Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 06 Oct 2023 07:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65665 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Cc: Ulf Herrman , 65665@debbugs.gnu.org Received: via spool by 65665-submit@debbugs.gnu.org id=B65665.169657789221664 (code B ref 65665); Fri, 06 Oct 2023 07:39:01 +0000 Received: (at 65665) by debbugs.gnu.org; 6 Oct 2023 07:38:12 +0000 Received: from localhost ([127.0.0.1]:49072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qofPX-0005dL-FE for submit@debbugs.gnu.org; Fri, 06 Oct 2023 03:38:12 -0400 Received: from tilde.club ([2607:5300:204:4340::114]:34588 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qofPS-0005d7-88 for 65665@debbugs.gnu.org; Fri, 06 Oct 2023 03:38:09 -0400 Received: by tilde.club (Postfix, from userid 5378) id 272B2222ACC87; Fri, 6 Oct 2023 07:37:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 tilde.club 272B2222ACC87 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.club; s=mail; t=1696577865; bh=Mb1IdrgucVJqlsv9RJ7EoHK0y1aCg6nGOIsc+DdQ5z0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CKB14xi3WKauTTa9DdLOkHBiZa6dlpGXf798b1baL+Yi0GvlMZan/OJm2sK82CXvf QDrYvOa0ujgZboGMFQVUnSQWOHCORXy6AW25da9uhkecj4TO13/Tia8NvMbTVlXjdW Uzalph/ssxSZaihwVumEkN2gsFb92pHMmY4+6jZ4= From: Ulf Herrman References: <87h6ofufy5.fsf@tilde.club> <87msxmqwng.fsf@tilde.club> <87a5swlbnp.fsf@gmail.com> Date: Fri, 06 Oct 2023 02:37:26 -0500 In-Reply-To: <87a5swlbnp.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 05 Oct 2023 22:36:42 -0400") Message-ID: <874jj45hhl.fsf@tilde.club> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 0.65 X-Migadu-Spam-Score: 0.65 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: A2E8F469B3 X-TUID: tBnWHe5x7jN5 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain I've also been using this patch, which rebinds `this-package' within package variants to refer instead to the variant rather than the original. When I tried applying a deep transformation to icecat, it failed to reach icecat-minimal or something like that. Or maybe it was some input of icecat - might have been my local version of mesa that had breakage. Anyway, I've since forgotten exactly what happened and why (I didn't actually write the commit message until quite some time later), but I do know that this patch fixed it. I might try to rediscover what the problem was later, but thought it would be good to make you aware of this so as to hopefully consolidate world rebuilds. - Ulf --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-guix-packages-rebind-this-package-for-package-varian.patch Content-Transfer-Encoding: quoted-printable From=2006245c37fc0ee21144279682223dff01f3e6dbf4 Mon Sep 17 00:00:00 2001 Message-Id: <06245c37fc0ee21144279682223dff01f3e6dbf4.1696574074.git.strine= ss@tilde.club> From: Ulf Herrman Date: Wed, 4 Oct 2023 03:17:25 -0500 Subject: [PATCH] guix: packages: rebind `this-package' for package variants. Background: there is a `this-package' identifier that can be used within any of the thunked fields of . This is implemented by passing the package in question as an argument to the "thunk" that is called to get the field value. `this-package' is used to implement macros like `this-package-input'. Consequently, there is a subtle difference between a package that inherits another package's thunked field and one that wraps it: in the former, the `this-package' of the thunked field will refer to the inheriting package, while in the latter case it will refer to the original package. Use of `this-package' tends to cause lots of subtle and hard-to-debug break= age when package transformations are used. In `package-mapping', it makes more sense to have `this-package' refer to the transformed package (that is, the package after being transformed by the user-provided procedure and having a= ll of its applicable inputs transformed, recursively), since otherwise untransformed inputs may be reintroduced via `this-package'. There's still one place where `this-package' can cause problems, though, and that's in the user-specified transformation procedure itself. Whether it's appropriate to have the thunks of the original refer to the original package or the transformed package is only really known by the author of the transformation. We therefore expose procedures for invoking the field thun= ks with arbitrary packages. In my experience, this has led to far more consistent and predictable package-transforming. If we really need the ability to refer to the lexically enclosing package instead of "whichever package ends up using this field definition" - which seems to be unnecessary at present, since the overwhelming majority of uses= of 'this-package' are in the context of 'this-package-input', etc - we could introduce a 'this-literal-package' identifier. Or we could rename all curr= ent uses of 'this-package' to use 'this-package-variant' or something like that, though that sounds like more work. * guix/packages.scm (package-inputs-with-package, package-native-inputs-with-package, package-propagated-inputs-with-packag= e, package-arguments-with-package): new procedures. (package-mapping): use them. =2D-- guix/packages.scm | 61 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index 1334def142..288867b911 100644 =2D-- a/guix/packages.scm +++ b/guix/packages.scm @@ -138,6 +138,11 @@ (define-module (guix packages) package-transitive-propagated-inputs package-transitive-native-search-paths package-transitive-supported-systems + package-inputs-with-package + package-native-inputs-with-package + package-propagated-inputs-with-package + package-arguments-with-package + package-mapping package-input-rewriting package-input-rewriting/spec @@ -1451,6 +1456,31 @@ (define (build-system-with-package-mapping bs rewrit= e-input rewrite-argument) (inherit bs) (lower lower*))) =20 +(define (package-inputs-with-package p0 p) + (match p0 + (($ _ _ _ _ args-proc + inputs-proc + propagated-inputs-proc + native-inputs-proc) + (inputs-proc p)))) + +(define (package-native-inputs-with-package p0 p) + (match p0 + (($ _ _ _ _ _ _ _ + native-inputs-proc) + (native-inputs-proc p)))) + +(define (package-propagated-inputs-with-package p0 p) + (match p0 + (($ _ _ _ _ _ _ + propagated-inputs-proc) + (propagated-inputs-proc p)))) + +(define (package-arguments-with-package p0 p) + (match p0 + (($ _ _ _ _ arguments-proc) + (arguments-proc p)))) + (define* (package-mapping proc #:optional (cut? (const #f)) #:key deep?) "Return a procedure that, given a package, applies PROC to all the packa= ges @@ -1525,22 +1555,25 @@ (define* (package-mapping proc #:optional (cut? (co= nst #f)) rewrite-input rewrite-argument) (package-build-system p))) =2D (inputs (map rewrite-input (package-inputs p))) =2D (native-inputs (map rewrite-input (package-native-input= s p))) + (inputs (map rewrite-input + (package-inputs-with-package p this-package)= )) + (native-inputs (map rewrite-input + (package-native-inputs-with-package + p this-package))) (propagated-inputs =2D (map rewrite-input (package-propagated-inputs p))) + (map rewrite-input + (package-propagated-inputs-with-package + p this-package))) (arguments =2D (match p =2D (($ _ _ _ _ args-proc) =2D ;; If we let ARGS-PROC be passed its original pa= ckage, =2D ;; we somehow end up in an infinite (or maybe ju= st =2D ;; exponential? Never seen it end...) loop. Sho= uld =2D ;; probably figure out what's causing that at so= me =2D ;; point. =2D (let ((args (args-proc this-package))) =2D (if deep? =2D (map rewrite-argument args) =2D args))))) + ;; If we let ARGS-PROC be passed its original package, + ;; we somehow end up in an infinite (or maybe just + ;; exponential? Never seen it end...) loop. Should + ;; probably figure out what's causing that at some + ;; point. + (if deep? + (map rewrite-argument (package-arguments-with-package + p this-package)) + (package-arguments-with-package p this-package))) (replacement (and=3D> (package-replacement p) replace)) (properties `((,mapping-property . #t) ,@(package-properties p))))))))) =2D-=20 2.40.1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHIBAEBCAAyFiEEn6BUn0yca1D9JsMa1lV76sJM9mgFAmUfuTkUHHN0cmluZXNz QHRpbGRlLmNsdWIACgkQ1lV76sJM9mhIQwwAgwcoLrdBgZ7EswiivPR1YcVVJtU+ gXErgi4FySkAtERIemOi5OSpwrwgnFPUJiSggW1og75iJjXB7edvq7Evi55wSBqy oqDgUUezKxiRiP885xGdfjF+DEBh6j+TJuzwMU4JXP2AKfar81KQv9LSiLtoG+EW QA6IOxTYOU/onMd18tLr4Fz1vGcVQFcXL9gSvNcFFSb61ovM2OtCj90nbCmYT3E5 HVE4NpNANI5NizHbraAJ35pCEZPQJo+6z4H+juccAxdBoKzVxLtAgKKAxCIJeJZL MUfOQyVT7vFwoDc3NI+Z2LG4tCTLXRk3NUhj8evlM2gl5zCE6TCKoP+rsDlbCCiZ ksMRpdgV7M+/I7RmRQkN1d3PfggKtm9VO3ZxhqiYbSA3RQrYRkkzi0zTFt60nhWC ZUlGYonEDjzLr5ETcg4/uCsW1GqsmrLO8IbM+0+Kys0UM8qlaJbgDrMmmVFoOd3w W04VlnNhjVRM2KA1gn15jFNQNT/8t0veKPD0 =xHJK -----END PGP SIGNATURE----- --==-=-=--