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 OKOkObKKB2T47AAASxT56A (envelope-from ) for ; Tue, 07 Mar 2023 20:04:19 +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 uHanOLKKB2SGswAAG6o9tA (envelope-from ) for ; Tue, 07 Mar 2023 20:04:18 +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 59EC9226A for ; Tue, 7 Mar 2023 20:04:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZcbT-0002Bw-Rw; Tue, 07 Mar 2023 14:04:03 -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 1pZcbS-0002BT-Hv for guix-patches@gnu.org; Tue, 07 Mar 2023 14:04:02 -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 1pZcbS-0004Kd-97 for guix-patches@gnu.org; Tue, 07 Mar 2023 14:04:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZcbR-0006qu-Rk for guix-patches@gnu.org; Tue, 07 Mar 2023 14:04:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Mar 2023 19:04:01 +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: Christopher Baines Cc: 60847@debbugs.gnu.org Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167821581826304 (code B ref 60847); Tue, 07 Mar 2023 19:04:01 +0000 Received: (at 60847) by debbugs.gnu.org; 7 Mar 2023 19:03:38 +0000 Received: from localhost ([127.0.0.1]:47197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZcb3-0006qC-Dz for submit@debbugs.gnu.org; Tue, 07 Mar 2023 14:03:37 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:46048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZcb1-0006py-Ei for 60847@debbugs.gnu.org; Tue, 07 Mar 2023 14:03:36 -0500 Received: by mail-qt1-f171.google.com with SMTP id d7so15503317qtr.12 for <60847@debbugs.gnu.org>; Tue, 07 Mar 2023 11:03:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678215809; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=cv3d/GqIChUcOIu2qqPUXGFWI+Nc4DtkSVHaxKPMlDw=; b=dF9pQ97WgcqmcejUsDLeFAgQVlrO0HR6qYBA0lfL+qqn2Q3REwZ1UbzE8pOhGEmvwQ StYnqQFdg6JIVQF3oR4DYxjpopR+FX0O3yFJGzVXY7U2nFwvcCJkdHBMZuei41AFH2A6 5rQZ5Cn1XpDHQsl65z64N16WsOiRIlTthfR2am81KyE8XLXHjyxPw/6U9A9PD1mpRCk+ M4R1TyNg48TZz1IXXy0bZ8h6InRHas6VsidZEIOuPzwSDx80zUwppori+kfu1H/zXHZv Cvas5x951hWOVitJbMHKbxBe4Y9SAGXoQ9JERozovMtMnsxlgyHiD9eHSCOHNkxvIB8h QT4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678215809; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cv3d/GqIChUcOIu2qqPUXGFWI+Nc4DtkSVHaxKPMlDw=; b=rDABXeIQtOmrbZXOyxPFQ/WX8TqpwdpZH7pxqJvlrRpOXpF2p9HyGkmsHuMz40phlu AW51me9/DYSYJHcGjqFvF0XBKlF94SLid8pZN0iawXNZm4L8Wq2DoFKIXps0AtZX9rpk r5JzB9KFMV5fka42nEBwIxlb7wjf71xiZojrZmq2yvrbxlBhRtrQTinNNdEuA/sbB9Ew OTrwNXUcwM1svNksY3dZ9ufBvC7u33Z2ZURr0mwaS7rNtTVYOXx4bVIQvcmLRw545pS7 mBdQtCzqYGpupfroXxQWdQIKtkcs4twse5aqTarwTDuVRLmb5d+2A1GUbPY87y7rIBYM Kb4g== X-Gm-Message-State: AO0yUKWYdxE8hkYuGLAsmhIXEHe/uHG/+lFMVgYvu/pERDgUKmxrZMBM Cd42wsSEqvUDwE0dm3JW3WmfwNkp7ZAnkA== X-Google-Smtp-Source: AK7set9FqnCIp6/4L4LTm9UZwHAUnKV9YJwfO35t6Wp4zWJW/hpeLCd49eoif/Stp8OQqk0uR8gDKA== X-Received: by 2002:a05:622a:348:b0:3bf:dc2e:ce3f with SMTP id r8-20020a05622a034800b003bfdc2ece3fmr21415720qtw.16.1678215809161; Tue, 07 Mar 2023 11:03:29 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id k7-20020ac80207000000b003bf9f9f1844sm10094447qtg.71.2023.03.07.11.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 11:03:28 -0800 (PST) From: Maxim Cournoyer 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> Date: Tue, 07 Mar 2023 14:03:27 -0500 In-Reply-To: <87jzzsr3tx.fsf@cbaines.net> (Christopher Baines's message of "Tue, 07 Mar 2023 15:05:47 +0000") Message-ID: <87a60owfi8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: 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=1678215858; 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=cv3d/GqIChUcOIu2qqPUXGFWI+Nc4DtkSVHaxKPMlDw=; b=Ki9VmaQxcjP2wwYjoNTiePXmLg5wfz0I44g4GvhLzin7yMm9q2IUaQFLFASAYBWNKSXr70 DNVRgs5ZXmjlA88s5Z2VqeAdeyiMGywSwMRSF/kvOg0yi1ZWutSaS3yj1vGJ2G58PRW2JK 6Gr99zbzcIB9NPEogl88NZS2I1xfAJIkkOqiwpYvZVxDuKh8c3V5ZritnbDVtmgpRfvLAi ZvdNPi2sqVoT6avHJ7p5SS81Ffje5jTrVy79KkFFDPTEicuhntoMmYMZnUcgwsNjhAoSDP tL5sigP/wAyOzVWr2LI4j2FNQMckXi2+yXeJ38c/o1sxqrr+pf6SdWmcn3ebDA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dF9pQ97W; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678215858; a=rsa-sha256; cv=none; b=rgHU0rPQJhYiJq8HV4X7ZE4/JHjnPSXlf767lOF9Hqh7l2wxzTFCIJ7BN+acuq6dxalIs6 3gRT/Z58GSn3V9Cnnbu6cW6XbkMNrj1KLVgQ2elOAdXDWmUPmKIO8Lge2pOEvXUiYoXnJj fTP1jHqM9aAd69r+ZeMqhc0oFVGbdzYw9mw8IBqfkFROJjwistiyDI4sNqGkONzzZWHsx0 7nlVpJQhYC7QOvlw5JK9gPyDbNqUTBJwcHuncHMxvOA3UVPF6+Vt0INTyNdJ0YhB4R58aZ POvoa5nMuuHxle5OdOo7Hu2NBQNK1IeTROz1Z+MjhR4+Ej5cSABV45QYRAhS9g== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=dF9pQ97W; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-Migadu-Spam-Score: 7.30 X-Spam-Score: 7.30 X-Migadu-Queue-Id: 59EC9226A X-Migadu-Scanner: scn1.migadu.com X-TUID: KSgP8ghvTlyc 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 conte= xt) >>> >>> [=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 fix= 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). When authoring packages, we'd no longer see the odd idiom '(or native-inputs inputs)' which results from this implementation detail; instead we'd always have access to both 'native-inputs' and 'inputs'. I hope that helps understanding the rationale. --=20 Thanks, Maxim