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 #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

Received: (at submit) by debbugs.gnu.org; 31 Aug 2023 20:15:46 +0000
From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 16:15:46 2023
Received: from localhost ([127.0.0.1]:59302 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1qbo4v-0008K3-Sz
	for submit@debbugs.gnu.org; Thu, 31 Aug 2023 16:15:46 -0400
Received: from lists.gnu.org ([2001:470:142::17]:37694)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <striness@tilde.club>) id 1qbo4u-0008Jr-Ha
 for submit@debbugs.gnu.org; Thu, 31 Aug 2023 16:15: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 <striness@tilde.club>)
 id 1qbo4g-0000bv-Gh
 for bug-guix@gnu.org; Thu, 31 Aug 2023 16:15:30 -0400
Received: from tilde.club ([2607:5300:204:4340::114])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <striness@tilde.club>)
 id 1qbo4e-0007qZ-Bo
 for bug-guix@gnu.org; Thu, 31 Aug 2023 16:15:30 -0400
Received: by tilde.club (Postfix, from userid 5378)
 id 782AC2230E27B; Thu, 31 Aug 2023 20:15:25 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 tilde.club 782AC2230E27B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tilde.club; s=mail;
 t=1693512925; bh=dd38u7mL08PfsKke01w/EU/tIGYtgf9eg83p8YlRQAk=;
 h=From:To:Subject:Date:From;
 b=UGh/OkaCnXDAoADjrnWWRLljzApjQdQAKJP3tqkk0kF6wXCqm60KGetJt9UMDViz1
 T7lGox8Jv2iLwksXxaEWiZwgARbCkb+mFicyJX+U2RS7eic3brAXbxKwLbXAOYZk/p
 piYZHroa3sldTj/pb5wuJMyWhbSVD7zIrInuk4AM=
From: Ulf Herrman <striness@tilde.club>
To: bug-guix@gnu.org
Subject: package-mapping with #:deep? #t doesn't get all the implicit inputs
Date: Thu, 31 Aug 2023 15:14:58 -0500
Message-ID: <87h6ofufy5.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"
Received-SPF: pass client-ip=2607:5300:204:4340::114;
 envelope-from=striness@tilde.club; helo=tilde.club
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
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: -0.1 (/)
[Message part 1 (text/plain, inline)]
#:deep? #t currently works by interposing a dummy build system that
lowers the package to a bag using the original build system, then
applies the supplied transformation to all of the bag's inputs, then
returns a new bag with the new inputs.

The problem with this approach is that it doesn't affect the bag
arguments.  This means that packages passed in as arguments may still
end up being used without being transformed.  Worse still, packages
*not* passed in as arguments may end up being used *unless one is
explicitly passed in as an argument*, as is the case with
qt-build-system's #:qtbase argument.

In short, the current approach of having the build-system lower
procedure leave the arguments mostly unchanged and letting the
bag->derivation procedure (the "bag builder") fill in lots of defaults
means that there are implicit inputs that cannot be touched at the
package level without adding special logic for every single build system
that does something like this.

I propose that we have the build system lower procedure (that is, the
one that converts from package to bag) completely fill in the argument
list with all defaults, and we modify build-system-with-package-mapping
to transform all arguments that look like a package or a list of
packages (or maybe even a tree containing packages).

Many large-scale package transformations have their purpose defeated if
even a single package slips through and has to be built or downloaded
separately (e.g. "I wanted to use a more minimal version of P, and now I
have both the original version of P *and* a more minimal version of P
*and* a duplicate copy of a large portion of the package graph...").  In
fact, in some situations, this could cause exponential growth of the
number of packages, e.g. a transformation is applied to qtbase and its
dependencies, but not to the implicit version and its dependencies, so
now all the dependencies of qtbase are duplicated, and if this happens
again at a higher level with something that depends on a package with
qt-build-system, now there are four duplicate subgraphs, and so on.

What do you think?

- Ulf
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Tue Sep 9 23:07:18 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.