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 EBt9Kho9C2TxTwEASxT56A (envelope-from ) for ; Fri, 10 Mar 2023 15:22:18 +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 sPK1KRo9C2StsAAAG6o9tA (envelope-from ) for ; Fri, 10 Mar 2023 15:22: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 5FE9C136BB for ; Fri, 10 Mar 2023 15:22:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1paddD-000435-TT; Fri, 10 Mar 2023 09:22: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 1paddC-0003z3-87 for guix-patches@gnu.org; Fri, 10 Mar 2023 09:22: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 1paddB-0006hX-Rq for guix-patches@gnu.org; Fri, 10 Mar 2023 09:22:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1paddB-0003CM-Kv for guix-patches@gnu.org; Fri, 10 Mar 2023 09:22: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: Fri, 10 Mar 2023 14:22: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Christopher Baines , Simon Tournier , Mathieu Othacehe , 60847@debbugs.gnu.org, Tobias Geerinckx-Rice , Lars-Dominik Braun , Ricardo Wurmus , jgart Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167845811212274 (code B ref 60847); Fri, 10 Mar 2023 14:22:01 +0000 Received: (at 60847) by debbugs.gnu.org; 10 Mar 2023 14:21:52 +0000 Received: from localhost ([127.0.0.1]:54139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1padd1-0003Bs-J6 for submit@debbugs.gnu.org; Fri, 10 Mar 2023 09:21:51 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:38812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1padcz-0003Ba-VG for 60847@debbugs.gnu.org; Fri, 10 Mar 2023 09:21:50 -0500 Received: by mail-qt1-f175.google.com with SMTP id c18so5790114qte.5 for <60847@debbugs.gnu.org>; Fri, 10 Mar 2023 06:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678458104; 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=g9jNLM49kkZInKXF2BWTHqoZL8aMeMMGU6GExkrkIcI=; b=GwCSuxtDAh0kWaf8dVB8YSEUD8Rxrazp9CsH59i0o5fBIp+o07E4sM85ShuAAJvDPx inHJsz7iTT09d3teiqZUyejmHAuxZ2PRpPqfA22CQwh03syjXNcwP+VVtvVC0rVXPLCP OzUGaS/R1GSTziG3JkgzXe93dhY4bbYuIZQxbKLeb3kFOFaMz1vxZBgdZ1BB9xBAb0ps BxrJyVz4ktoIN0gZM1D5aM4RXQznwwQnv0/jWgBRst5T0TJVsSKtHUyyAIJkRIWTGKjx yfn6wxwyNMxQZW+He0pq+sA2Ip15GssKdA5ZWzMwcQqHrPSP/YEi3DBjUcps/zuSyug7 /wYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678458104; 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=g9jNLM49kkZInKXF2BWTHqoZL8aMeMMGU6GExkrkIcI=; b=vOmRr1aW3YiEkKCvXN62W7J0czL6DRveRV3E6jrIvHlzGVVorImm/B+RwJZHOM70af tyefyYqI0b3BBlIiuzB3hXvkhbsFZ1dQ2o70Who1LEwLZt8wcB8f/hFzDl1UB41aqHU0 6Xz1STEumyT80AALQUjgZJW765LSCG3q7Rh8GdOBby9UGV/u0rJF9uA4SHeAQrc0TJTK DoAivRBJOaoZ3VSowTImntd9mJMY84zCmvDiwRLBar/S5kL5Rauy80LU4HK9W8uz6F24 PdsDeBhkPlKnnYsV8wP6/swUhNWbIDJUdlz1DAb7d8kc3NurLO6Gq+IGF2La2hZyQLjj IB+g== X-Gm-Message-State: AO0yUKWpnEOnsWRgoLDF12sSOImFNlaJFWX7/vc6N28GYPfwfffC7c+u f2MPOpl/0W9n2noN43x+OAQ= X-Google-Smtp-Source: AK7set/L7Vo9zj3J7a35s2BbjWnSzCyxpjgmqXG9L6OLGWjEr2V426GeyqKM/jF0dOqDCNwOZiZ9SA== X-Received: by 2002:a05:622a:40e:b0:3b8:3a7c:d208 with SMTP id n14-20020a05622a040e00b003b83a7cd208mr43813521qtx.34.1678458104438; Fri, 10 Mar 2023 06:21:44 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id q17-20020ac84111000000b003bfa52112f9sm1496245qtl.4.2023.03.10.06.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:21:44 -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> <87o7p19e6w.fsf@gnu.org> Date: Fri, 10 Mar 2023 09:21:42 -0500 In-Reply-To: <87o7p19e6w.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 10 Mar 2023 09:57:11 +0100") Message-ID: <87v8j8r8jt.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-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GwCSuxtD; 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=1678458138; a=rsa-sha256; cv=none; b=J49QN6hJBqKSqlZ7fjfrvdLOXd0N9nJ/6qJiXvHI4ckTjoiTEbf284/Ytw+dajxyVouGGP 3zmeaqv6/RYbmmZH3FiNC7Z6scjSP5aVqc2frabw9lLkVI19gVumO9imtQloWQBWyM/yJ4 EFbuWODL2wy1/1bTgTP0fmuh11VLm+iD4Ht074TwwQ0biESvoTkJKZ/NTGTSL+sTz0VVnU 4k7f6MA249w+KpoIAvqM/qNjHMAmYHaTgfDGCdkCGTtzPLEvhM0luqB4PvAP9mMEuf8VgL etocmh8YRDgMvQLSEHoVuto8HPueEHxBavGd0IVrGHfdz2d42+YWmH80omoOmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678458138; 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=g9jNLM49kkZInKXF2BWTHqoZL8aMeMMGU6GExkrkIcI=; b=MNVok6VoHQbU/WkazvGzEFAheZk56FNtYT2NeFabYes/sOmGiEHCRoM6O0LjS/XUZPqMQd sN1myotA6rYbkcV4VSip6nIa2CjtDJdOhl9QhmLPs0IaG6DqxHgRptECGdccpAaLwrMvBy 2nsHaBiXjTxhz4BlPlafq0IspS0Wx1AATlyO9awqR06z71ZY/13fF4OCUuj+t8E2D9eTom WC98gxGr8ZKxITb6nlolPZKJzAQgtF/5FnhquFdE6ptCE0VAJZTD1vQvQyrgdqS4I7mg7n +anVPFz9hKSmP/SVU+SNmTIorWbky40VLT+sE7QTF2E5jyTNdd0MAnWPv7rzSg== X-Migadu-Spam-Score: -0.59 X-Spam-Score: -0.59 X-Migadu-Queue-Id: 5FE9C136BB X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GwCSuxtD; 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-TUID: lXTndYca+tiL Hi Ludovic, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> 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 > > To make sure there=E2=80=99s no misunderstanding, I think that=E2=80=99s = not okay even > as a =E2=80=9Ctemporary kludge=E2=80=9D (I=E2=80=99m not against temporar= y kludges in general, > I=E2=80=99ve done my share of that ;-), but this would be way too brittle= .) "way too brittle" is a strong warning :-). I don't understand what is so brittle about it? It's not like we change the build system names often. >> 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. > > Again, I=E2=80=99m not sure about the =E2=80=9Cnew way=E2=80=9D. I=E2=80= =99m sorry I lack the bandwidth > to review this quickly, especially a wide-ranging change like > inputs/native-inputs. > > (Just yesterday I was fixing cross-compilation issues on =E2=80=98core-up= dates=E2=80=99; > that gives a lot of insight as to how native-inputs/inputs play out in > practice.) > > [...] > >> 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 :-). > > Yup, I=E2=80=99m sorry I don=E2=80=99t have any suggestions! Thanks, it's useful to state that up front. Otherwise the other side of the line goes like "... so?" :-). > Perhaps one suggestion would be: start the native-inputs/inputs change > on a new branch, for all the build systems (or at least the main > ones), and then try to build the =E2=80=98core=E2=80=99 subset (which inc= ludes > cross-compilation) to get an idea of the kind of code simplification > opportunities as well as issues that arise. I feel like it=E2=80=99s har= d to > anticipate the impact of such a change without actually trying. I can do this; the exercise would be similar to what I've done for pyproject-build-system, where I was able to build complex packages (both natively and cross-compiled) with the new same-bag representation change, but to a larger scale. It's more work, which is why I would have preferred to contain its scope to get started, but the changes were easy, IIRC. Basically, it forces us to review all the (assoc-ref inputs "package-name") or (search-input-file inputs "file") procedure calls and remove the assumption that native-inputs are also inputs for native builds (that'll fix multiple cross-compilation bugs at the same time, so it's a good thing to do anyway). To be continued! --=20 Thanks, Maxim