GNU bug report logs

#65665 package-mapping with #:deep? #t doesn't get all the implicit inputs

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #59 received at 65665@debbugs.gnu.org (full text, mbox, reply):

Received: (at 65665) by debbugs.gnu.org; 14 Oct 2023 14:48:00 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 14 10:48:00 2023
Received: from localhost ([127.0.0.1]:50111 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1qrfvr-0006MJ-GI
	for submit@debbugs.gnu.org; Sat, 14 Oct 2023 10:48:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51936)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@gnu.org>) id 1qrfvm-0006Lg-Pt
 for 65665@debbugs.gnu.org; Sat, 14 Oct 2023 10:47:58 -0400
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@gnu.org>)
 id 1qrfvJ-0006DE-Kw; Sat, 14 Oct 2023 10:47:25 -0400
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=E7q/2zIgNDuzKDYip06tbLYf28jFqsyym9he5DNPDPI=; b=GgVGIMQzZEbyIxbhsgpZ
 iO6tLmOSsvppdg1lod7MwNormrGUcJ+x2rbd3BihOG8NsEaXZNcuszu3dgi16ZsG9tCsJG+LLWVkl
 ZTlR7XeU52F9Np2E9iGagPf9JfEWzFLRjZLYr6iYe79BSORjSkQPIA+3nriG+J9/dXTmyb3TRnxVY
 igIqN0p+F/qsIlBDjwXEfZPDwxGaC45UbxVfXbcnkC5vOUQfab34hmj6aRsLdQTJcBmlsBBH4EMym
 YuJpMTMJastToqomf5Ii0Mujg4vNGM1lIWbbqSGApWPPTarogxQUECMhCb4x/JeBt6DZrjaPnDze5
 0lKpjUCW8q0MVA==;
From: Ludovic Courtès <ludo@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: Re: bug#65665: package-mapping with #:deep? #t doesn't get all the
 implicit inputs
In-Reply-To: <87h6mv96fy.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 12
 Oct 2023 12:00:33 -0400")
References: <87h6ofufy5.fsf@tilde.club> <87msxmqwng.fsf@tilde.club>
 <871qe0lytk.fsf_-_@gnu.org> <87h6mv96fy.fsf@gmail.com>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Tridi 23 Vendémiaire an 232 de la
 Révolution, jour du Navet
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Sat, 14 Oct 2023 16:47:22 +0200
Message-ID: <87jzrpgt1h.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 65665
Cc: Ulf Herrman <striness@tilde.club>, 65665@debbugs.gnu.org
X-BeenThere: debbugs-submit@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@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -3.3 (---)
[Message part 1 (text/plain, inline)]
Hello,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

>> It’s indeed the case that arguments can capture references to packages
>> that won’t be caught by ‘package-mapping’.  For instance, if you write:
>>
>>   (package
>>     …
>>     (arguments (list … #~(whatever #$coreutils))))
>>
>> … then ‘coreutils’ here cannot be replaced.
>>
>> To address this, the recommendation is to always add dependencies to
>> input fields and to use self-references within arguments.  The example
>> above should be written like this:
>>
>>   (package
>>     …
>>     (arguments
>>      (list … #~(whatever #$(this-package-input "coreutils")))))
>>
>> It’s just a recommendation and one can perfectly ignore it, and I
>> suppose that was the impetus for this patch.
>>
>> This is one of the things discussed while designing this change:
>>
>>   https://guix.gnu.org/en/blog/2021/the-big-change/
>>   (search for “self-referential records”)
>>
>>   https://issues.guix.gnu.org/49169
>>
>> My take was and still is that it’s an acceptable limitation.  Packagers
>> need to follow the guideline above if they want proper support for
>> rewriting, ‘guix graph’, and other tools.
>>
>> WDYT?
>
> But not all packages found in a bag come from inputs; they may be
> provided as an argument to the build system (cmake, meson, qt, etc. all
> allow for this).

Yes, but these packages (#:cmake for ‘cmake-build-system’, #:python for
‘python-build-system’, etc.) become inputs of the bag, and are taken
into account, as in this example:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix show tinyxml2
name: tinyxml2
version: 8.0.0
outputs:
+ out: everything
systems: x86_64-linux i686-linux
dependencies: 
location: gnu/packages/xml.scm:1295:2
homepage: http://www.grinninglizard.com/tinyxml2/
license: Zlib
synopsis: Small XML parser for C++  
description: TinyXML2 is a small and simple XML parsing library for the C++ programming
+ language.

$ ./pre-inst-env guix build tinyxml2
The following graft will be made:
   /gnu/store/qf8w8ch1mrxk6k34g2d6bisny5pq8gnv-tinyxml2-8.0.0.drv
applying 2 grafts for tinyxml2-8.0.0 ...
grafting '/gnu/store/ndzyiwhypsbgrbaz7rmz3649b6ghlfal-tinyxml2-8.0.0' -> '/gnu/store/2da5frl36gd51653bjjypqvwdk0bh25v-tinyxml2-8.0.0'...
successfully built /gnu/store/qf8w8ch1mrxk6k34g2d6bisny5pq8gnv-tinyxml2-8.0.0.drv
/gnu/store/2da5frl36gd51653bjjypqvwdk0bh25v-tinyxml2-8.0.0
$ ./pre-inst-env guix build tinyxml2 --with-input=cmake-minimal=cmake
The following derivation will be built:
  /gnu/store/hx0hx1nrmxzdhy9yw1d0md2q78y4spd4-tinyxml2-8.0.0.drv
8.4 MB will be downloaded:
  /gnu/store/qwy25ivr63087x9fdl9km0m44hn5bimg-cmake-3.25.1
  /gnu/store/3vh9b2i93na8wwdrj6n0q2qbgd2fzxik-tinyxml2-8.0.0-checkout

[...]

/gnu/store/cmn551x8iksy44cdqypyq2129lm8ym60-tinyxml2-8.0.0
--8<---------------cut here---------------end--------------->8---

(In this case I had to apply the patch below because ‘cmake-minimal’ was
mistakenly marked as hidden which, as implemented by
eee95b5a879b7096dffd533f24107cf8926b621e, meant that it could not be
replaced.)

I gave a similar example with ‘python-build-system’ here:

  https://issues.guix.gnu.org/65665#10

My understanding is that understanding is that this patch series is
about addressing cases as I explained above, where ‘arguments’ refer to
packages directly instead of using self references.  Do I get this
right, Ulf?

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index bc14286070..1592703f8d 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -263,6 +263,7 @@ (define-public cmake-minimal
   (package
     (inherit cmake-bootstrap)
     (name "cmake-minimal")
+    (properties (alist-delete 'hidden? (package-properties cmake-bootstrap)))
     (source (origin
               (inherit (package-source cmake-bootstrap))
               ;; Purge CMakes bundled dependencies as they are no longer needed.

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Mon Sep 8 11:23:55 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.