From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6NAzGLkYKGUg7gAAG6o9tA:P1 (envelope-from ) for ; Thu, 12 Oct 2023 18:03:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6NAzGLkYKGUg7gAAG6o9tA (envelope-from ) for ; Thu, 12 Oct 2023 18:03:05 +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 5D17C453A5 for ; Thu, 12 Oct 2023 18:03:04 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=OKFoAlRD; 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=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697126585; 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: content-transfer-encoding:content-transfer-encoding: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=OEKMyAs9xEFfdtGzTFwVd/gG83Kanazg5dYnaMCiQsU=; b=XwAByazD2uQOgqs3hpUptVQhCMZ2/2M7hqs27zUzEGrYA6GPUq0gx+yQs3dm7HkcYDWrIM +M4vb+aDDXeIy/Djnmnocqac5+cIrIMWHiU/ZKIhS9edtaCaf8UDS6zOmi13ZaBQC+EduP U2GhFZFFWV7yyZiaJtQ5/4qI8rCOw7sWaKG3gmrM98F6wrZSLsD264AE5FMcanKNI2f96w TcZG3i0/a8lImxJgvJsr/jNe7q5AhyX0tomYRsU1BY6l+p+l1NI9t0q4KKUGw87Jw4yCZK lqRgSgmpsv/mSUnux2/WqO8rzplliRgIwQVrKBE88jOs7KyTQ3AdSdGcEJ9/Dg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697126585; a=rsa-sha256; cv=none; b=nTBywJ8L7/vXfpDqmhx4ThOd3GPuMQUGLDkWEFJKCNmtB4YsgpB+vSBIZqB2wFx1vINjlt QRZLXQmsqsC7iIlQPRQPlIbOox5teTnm05ee2843FuFU+EfNUHfvGp7IT2OijMSB9U41w8 dUFNi0D9vF81H/TZG+YP2eNRXlxQsh8J91XjqN0ps15DchxnHXwMDdB4Kp4iBUU9Ctfl9h OrsKA89Bdo/jV61oH1yBrP6eNGyDBPuyO7bcMs2oM3DFlKl5cBY7rz4sNqWkGxgq8Xk7ZP 7v6e45VMiJD615sBaj3ZB6p0MWlT+SOuzWD8+zbSk+s25y9TJlFnhcMuvaafCA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=OKFoAlRD; 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=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqy87-0007sJ-6B; Thu, 12 Oct 2023 12:01:43 -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 1qqy84-0007rB-Pg for bug-guix@gnu.org; Thu, 12 Oct 2023 12:01:42 -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 1qqy84-0004rS-EH for bug-guix@gnu.org; Thu, 12 Oct 2023 12:01:40 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qqy8Q-00029f-5j for bug-guix@gnu.org; Thu, 12 Oct 2023 12:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65665: package-mapping with #:deep? #t doesn't get all the implicit inputs Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 12 Oct 2023 16:02:02 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Ulf Herrman , 65665@debbugs.gnu.org Received: via spool by 65665-submit@debbugs.gnu.org id=B65665.16971264728225 (code B ref 65665); Thu, 12 Oct 2023 16:02:02 +0000 Received: (at 65665) by debbugs.gnu.org; 12 Oct 2023 16:01:12 +0000 Received: from localhost ([127.0.0.1]:44185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqy7b-00028a-Dd for submit@debbugs.gnu.org; Thu, 12 Oct 2023 12:01:12 -0400 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:59490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqy7T-0001vU-Em for 65665@debbugs.gnu.org; Thu, 12 Oct 2023 12:01:09 -0400 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-41954a3e282so6700131cf.2 for <65665@debbugs.gnu.org>; Thu, 12 Oct 2023 09:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697126435; x=1697731235; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OEKMyAs9xEFfdtGzTFwVd/gG83Kanazg5dYnaMCiQsU=; b=OKFoAlRDLyTs7yZ5NwsxPcYSK/15TS+6lLzUgMn1UpB1xs3hTvkVvBVNL83U8QFUN9 +NVpuCswLXtIfIuMBYJ4QsajZeIJ0GaSf3WjQZGbUbmOi+mR5sf94aHnjGdY96g1Btzu G0ouipevdyN2KJrIP8yQ6N3nupP3RlEqSxBWDL5e5aHBBYzOhz8yF1F/NrI9HqPG1XZR htKNeTfchFcgA+EngqQiJnEnd1Kz7s9qi3NAghOOQkNb9QFs9zOVO2KhAWAHtwTTE2qn gX/7QiG91ReC8W78rTUPZ0AOqAbXlWCpU08xcLeSwTics5j6UyYhLZAhAgmsWT2xnILc oY1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697126435; x=1697731235; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OEKMyAs9xEFfdtGzTFwVd/gG83Kanazg5dYnaMCiQsU=; b=YUM609dkPTEEq2picOD32FdScT/pq39WxmJ9OX3CqqQ9ZE30U+jHT0YuQCddLjXkx4 aO/i3ln6Frjs8iAsp41sDguhZ/w24CNn1OB8pvAE7GOmP3usfsG/s/926XrMFIoQzNVs Asv5UCgc1tAFsY76HlIca9PWFiyC+cUPzQxGj6ZaG4IDV7O6jmZlQt8mfWVwMJPM9LpQ 9CH3coxLBMu9qe5fbB5c5AOaHadszTqmuaR0mwpNBpW4wYDXXSOdqdg5AKduyHZoPGrD cADsujOafYPlmdW/zKSFFoyCgUkV3MWpG47NWiT3/3ynrA3dpbtJMQPaKB+XoZ4b3n57 3XIQ== X-Gm-Message-State: AOJu0YyOcseojWRtX9mU7RlMFUcskbbhAphFiHqVeupLqvGKHq9IHFFJ ltEfubheZGUQF5oOi5/+lcwX9HfUmUmk1A== X-Google-Smtp-Source: AGHT+IGRxchp1iRgZcQL4fw7exuXgzNHUEBrHIAEfCknAIZ9mw55BQ0XDswxo9DRgFPV90dAP0CsBQ== X-Received: by 2002:a05:6214:519d:b0:658:8767:8d50 with SMTP id kl29-20020a056214519d00b0065887678d50mr28816843qvb.24.1697126434855; Thu, 12 Oct 2023 09:00:34 -0700 (PDT) Received: from hurd (dsl-10-128-66.b2b2c.ca. [72.10.128.66]) by smtp.gmail.com with ESMTPSA id r6-20020a0c8d06000000b0065655bb349csm6704635qvb.141.2023.10.12.09.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 09:00:34 -0700 (PDT) From: Maxim Cournoyer In-Reply-To: <871qe0lytk.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 12 Oct 2023 16:06:47 +0200") References: <87h6ofufy5.fsf@tilde.club> <87msxmqwng.fsf@tilde.club> <871qe0lytk.fsf_-_@gnu.org> Date: Thu, 12 Oct 2023 12:00:33 -0400 Message-ID: <87h6mv96fy.fsf@gmail.com> 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-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-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: 2.80 X-Migadu-Queue-Id: 5D17C453A5 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: 2.80 X-TUID: 7hvsdbSQS2Wd Hi, Ludovic Court=C3=A8s writes: > Ulf Herrman skribis: > >> -(define (build-system-with-package-mapping bs rewrite) >> +(define (build-system-with-package-mapping bs rewrite-input rewrite-arg= ument) >> "Return a variant of BS, a build system, that rewrites a bag's inputs= by >> passing them through REWRITE, a procedure that takes an input tuplet and >> returns a \"rewritten\" input tuplet." >> @@ -1442,9 +1442,10 @@ (define (build-system-with-package-mapping bs rew= rite) >> (let ((lowered (apply lower args))) >> (bag >> (inherit lowered) >> - (build-inputs (map rewrite (bag-build-inputs lowered))) >> - (host-inputs (map rewrite (bag-host-inputs lowered))) >> - (target-inputs (map rewrite (bag-target-inputs lowered)))))) >> + (build-inputs (map rewrite-input (bag-build-inputs lowered))) >> + (host-inputs (map rewrite-input (bag-host-inputs lowered))) >> + (target-inputs (map rewrite-input (bag-target-inputs lowered))) >> + (arguments (map rewrite-argument (bag-arguments lowered)))))) > > Aah, now I understand. :-) > > It=E2=80=99s indeed the case that arguments can capture references to pac= kages > that won=E2=80=99t be caught by =E2=80=98package-mapping=E2=80=99. For i= nstance, if you write: > > (package > =E2=80=A6 > (arguments (list =E2=80=A6 #~(whatever #$coreutils)))) > > =E2=80=A6 then =E2=80=98coreutils=E2=80=99 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 > =E2=80=A6 > (arguments > (list =E2=80=A6 #~(whatever #$(this-package-input "coreutils"))))) > > It=E2=80=99s 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 =E2=80=9Cself-referential records=E2=80=9D) > > https://issues.guix.gnu.org/49169 > > My take was and still is that it=E2=80=99s an acceptable limitation. Pac= kagers > need to follow the guideline above if they want proper support for > rewriting, =E2=80=98guix graph=E2=80=99, 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). --=20 Thanks, Maxim