From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YGuNLkCVB2QHmQAASxT56A (envelope-from ) for ; Tue, 07 Mar 2023 20:49:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2IeLLUCVB2SQ1gAAG6o9tA (envelope-from ) for ; Tue, 07 Mar 2023 20:49:20 +0100 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 314643F52 for ; Tue, 7 Mar 2023 20:49:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZdJ2-0005Fv-N8; Tue, 07 Mar 2023 14:49:04 -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 ) id 1pZdJ1-0005Ea-1I for guix-patches@gnu.org; Tue, 07 Mar 2023 14:49:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZdJ0-0003HG-Ow for guix-patches@gnu.org; Tue, 07 Mar 2023 14:49:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZdJ0-0007zU-5b for guix-patches@gnu.org; Tue, 07 Mar 2023 14:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Mar 2023 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60847 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 60847@debbugs.gnu.org Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167821848730521 (code B ref 60847); Tue, 07 Mar 2023 19:49:02 +0000 Received: (at 60847) by debbugs.gnu.org; 7 Mar 2023 19:48:07 +0000 Received: from localhost ([127.0.0.1]:47230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZdI6-0007w9-Rn for submit@debbugs.gnu.org; Tue, 07 Mar 2023 14:48:07 -0500 Received: from mira.cbaines.net ([212.71.252.8]:42350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZdI4-0007vm-Ps for 60847@debbugs.gnu.org; Tue, 07 Mar 2023 14:48:05 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:3a91:a0a4:ecee:f157]) by mira.cbaines.net (Postfix) with ESMTPSA id B6BAB16DAE; Tue, 7 Mar 2023 19:48:03 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id d3a2670b; Tue, 7 Mar 2023 19:48:03 +0000 (UTC) References: <20230123133217.318-1-maxim.cournoyer@gmail.com> <20230123133217.318-2-maxim.cournoyer@gmail.com> <87zg8p7qvw.fsf_-_@gnu.org> <87jzzsy7qt.fsf@gmail.com> <87jzzsr3tx.fsf@cbaines.net> <87a60owfi8.fsf@gmail.com> User-agent: mu4e 1.8.13; emacs 28.2 From: Christopher Baines Date: Tue, 07 Mar 2023 19:26:47 +0000 In-reply-to: <87a60owfi8.fsf@gmail.com> Message-ID: <87fsagqr67.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678218560; 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; bh=GA58P/pYG5q4AHUChnTlp1IFfH9Fs3PBwNawIfV41o8=; b=lBMzwhyHrZHuGxrPp0pZ64qBxK8KSKNNE0GBR90XURvVCvtsce6kBpzba3Rlj21YibK71U Zlxbv/ei+S/yI7aW6xHPPUZf9CPolm3J4Jk9IPImutswJl7pzOBmdsgHDIOHK+j1eR7h+d 00efdfBAnfAQvO+YOFU/xNBKoa6Efngz6V7Fz9vPK5gom/2tSnyg9esWBH4IME94Ydb5/h gKfl3oANspS6MMkG2+k86PTP9daCZv0fMVolNyHdRwyO6utshf8VssU5VDeJqziic5yHDl j7J+hhMlNObTU8sNKDZhy5yGblV3R/Tvc9qrYQRXQcMO4hThGjC2iTUqHLmhOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678218560; a=rsa-sha256; cv=none; b=IH1OzcTZMHedWAFkncM9ZjdPn3GCDJS3nGeSnHa+y8XgjOzaKg++iL+p4RH4hOhFXMvVD3 5Q2g69rfGqQyWfpavawyOGj0BKNCk/1BSQShlbuXSpinHXuehF3Cx9Fa88K3n5YYuvHRqX TCH0a/5WqHKj4HrnXw0/f3DC7APEOfrOG04kPRFCh3FQ7aVHah/n6dPU2v7DChMFIK11HT uxm9wVfbPVu0KaWGzpBJnBRZsSKJpaG/TTwXAw3IbNaURv5rVeSPHPKlBelsUjQF6dM05n siuaGZL8GnN8UtLjsmQZmGVyEFqIuIr26Q4ASslyk5PmZmYSyHa4TzpyCr4mMw== Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Spam-Score: -3.80 X-Spam-Score: -3.80 X-Migadu-Queue-Id: 314643F52 X-Migadu-Scanner: scn1.migadu.com X-TUID: rcGErdriAU0D --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Maxim Cournoyer writes: > Hi Christopher, > > Christopher Baines writes: > >> Maxim Cournoyer writes: >> >>> Hi Ludo! >>> >>> Ludovic Court=C3=A8s writes: >>> >>>> Hello, >>>> >>>> Maxim Cournoyer skribis: >>>> >>>>> +++ b/guix/packages.scm >>>>> @@ -1864,28 +1864,30 @@ (define* (bag->derivation bag #:optional cont= ext) >>>> >>>> [=E2=80=A6] >>>> >>>>> + (let ((builder-name (procedure-name (bag-build bag)))) >>>>> + (if (or (bag-target bag) >>>>> + (eq? 'pyproject-build builder-name)) >>>>> + (bag->cross-derivation bag) >>>> >>>> This one part is a showstopper to me, for two reasons: >>>> >>>> 1. We cannot rely on =E2=80=98procedure-name=E2=80=99 (it=E2=80=99s = a debugging aid and it=E2=80=99s >>>> not guaranteed to return something useful). >>>> >>>> 2. Special-casing build systems here is not okay: the bag and build >>>> system abstractions exist to maintain separation of concerns. >>>> >>>> I understand there=E2=80=99s an actual bug to fix and the desire to fi= x a more >>>> common issue, but I think this one approach is not the way forward. >>>> >>>> I hope that makes sense! >>> >>> I agree this is not "pretty", but it would be a "temporary" kludge until >>> all the build systems can be migrated (and the package adjusted for) the >>> "new" way, which is: native-inputs and inputs always co-exist, whether >>> the build is a native one or a cross one. >>> >>> In light of this, it seems OK to test the water with a not so >>> significant build system (only a handful of package relies on >>> pyproject-build-system thus far). When all the build systems will have >>> been migrated to the new way (a too big undertaking to be done in one >>> shot), this kludge can be removed. >>> >>> Otherwise, could you offer a concrete suggestion as the way forward? I >>> appreciate the "that's not the way", but stopping short of suggesting a >>> better alternative leaves me wanting more :-). >> >> I think it would be clearer to see other potential ways forward if the >> end goal was more clearly articulated. >> >> Guessing at that here from the changes proposed to guix/packages.scm, >> once all build systems are adjusted, cross derivations will be produced >> for all bags, regardless of whether there's a target. >> >> That doesn't make much sense to me. One explaination is that the current >> naming is confusing when thinking about this goal, so maybe >> bag->cross-derivation happens to do what you want it to do in all >> circumstances, even when target is #f? > > Thanks for tipping in. The end goal is to avoid loosing the information > of which inputs are native (build inputs) vs regular in the bag, and yes > bag->cross-derivation allows that. It appears to me the distinction in > the bag representations (native vs cross) was originally perceived > useful as some kind of optimization (there's less variables to worry > about, and we can squash the inputs/search-paths together, since they're > all native anyway), but this information (currently discarded) ends up > being very useful even on the build side (to wrap only the target > inputs, say, and not all the native/build inputs). > > So yes, the change long term would be to integrate the > bag->cross-derivation logic into bag->derivation, at which point it > would be unified for any type of build (the bag representation would be > shared between native and cross builds). Thanks for the explanation, so maybe an alternative to trying to get bag->derivation to function differently for different build systems would be to push combining the inputs down in to each build system. Take the gnu-build-system as an example, gnu-build in (guix build-system gnu) would be changed to take multiple lists of inputs, rather than a single list. It can then combine the lists of inputs as is done in bag->derivation, to avoid affecting any packages. While this does require changing all the build systems, I think it's a bit more forward thinking compared to trying to add a kludge in to bag->derivation, since hopefully the change there can be the longer term one. Does that make sense? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQHlPFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XcLrBAAoFT5BfSDlpaQqOx1NctpOIqTrX48SG0l RS1P8YKtucY1yqYWDS9U9IB640fhfjLKP0rYtXcucFHGkMvqOgVnakKf2Dl9KDwu j51oNMSzMkw44l4yOvh0hc7L10Crb77NymS/n+JXQnnRDbqDnX+X6IEkZjvzsSaW +aDUw3b+Zf75IKcrrCnoTJRW8cF01M80lMC1oDR0zJg21ctmSU9NlVO1WRIik2wg vCw7Z8Y6SfivqDXhK8OfogKVFqHUbveRHZJ1BQO115/YrUqN4gO0oCX9XUPVWyJ1 0r0IqIsPaaziw4TwmWS9kmXfJnqKwwYmSwVbXPRpGVbKm08uEoGftXI2IcFKKXK8 9Lwk79lxYG3mzsOMN49r4Zh7HrY0p3aFbf9IojxZWS1SMf9Ffw3xC4jyTN49lAdD r8rNFjXpkaIUN9hYfiWWW6/s4wlrMIi1FPnGCgZVh4erHNfLNpJi5cr2NuNnIV3A jDt/lQR4wowbeKrh2Fm0WfJj/nEw3wEUOvacwj0sRALtXNrg2xUs2LjluWPtvjNX OYMQ1TMpsWy2N2nUJhXvB9Mgwj0c1fSvXtxflY2RLo8XF0VqHv/tQcmE4tdlwFof 06NbGJVVOuv9PYtbaQtxCK2cZGDI5rDW+cnJr2Tu257ItcUndcbJZhZgkcJeOAbb F2kWX7NBdgE= =N7ZY -----END PGP SIGNATURE----- --=-=-=--