GNU bug report logs

#60847 [PATCH] Enable cross-compilation for the pyproject-build-system.

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #56 received at 60847@debbugs.gnu.org (full text, mbox, reply):

Received: (at 60847) by debbugs.gnu.org; 10 Mar 2023 14:21:52 +0000
From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 10 09:21:52 2023
Received: from localhost ([127.0.0.1]:54139 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	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 <maxim.cournoyer@gmail.com>) 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 <maxim.cournoyer@gmail.com>
To: Ludovic Courtès <ludo@gnu.org>
Subject: Re: bug#60847: [PATCH] Enable cross-compilation for the
 pyproject-build-system.
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 Courtès"'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-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 60847
Cc: Josselin Poiret <dev@jpoiret.xyz>, Christopher Baines <mail@cbaines.net>,
 Simon Tournier <zimon.toutoune@gmail.com>, Mathieu Othacehe <othacehe@gnu.org>,
 60847@debbugs.gnu.org, Tobias Geerinckx-Rice <me@tobias.gr>,
 Lars-Dominik Braun <lars@6xq.net>, Ricardo Wurmus <rekado@elephly.net>,
 jgart <jgart@dismail.de>
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: -1.0 (-)
Hi Ludovic,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>> Hello,
>>>
>>> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>>>
>>>> +++ b/guix/packages.scm
>>>> @@ -1864,28 +1864,30 @@ (define* (bag->derivation bag #:optional context)
>>>
>>> […]
>>>
>>>> +  (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 ‘procedure-name’ (it’s a debugging aid and it’s
>>>      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’s 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’s no misunderstanding, I think that’s not okay even
> as a “temporary kludge” (I’m not against temporary kludges in general,
> I’ve 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’m not sure about the “new way”.  I’m 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 ‘core-updates’;
> 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’m sorry I don’t 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 ‘core’ subset (which includes
> cross-compilation) to get an idea of the kind of code simplification
> opportunities as well as issues that arise.  I feel like it’s hard 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!

-- 
Thanks,
Maxim




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 20:21:45 2024; 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.