From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH 0/5] Enable cross-compilation for the pyproject-build-system Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Jan 2023 04:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60847 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60847@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167384185610722 (code B ref -1); Mon, 16 Jan 2023 04:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Jan 2023 04:04:16 +0000 Received: from localhost ([127.0.0.1]:60110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHGjI-0002mr-7H for submit@debbugs.gnu.org; Sun, 15 Jan 2023 23:04:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:32872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHGjG-0002mk-IT for submit@debbugs.gnu.org; Sun, 15 Jan 2023 23:04:15 -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 1pHGjG-0001x6-9c for guix-patches@gnu.org; Sun, 15 Jan 2023 23:04:14 -0500 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHGjE-0002IG-Kd for guix-patches@gnu.org; Sun, 15 Jan 2023 23:04:13 -0500 Received: by mail-qv1-xf2b.google.com with SMTP id h10so18891993qvq.7 for ; Sun, 15 Jan 2023 20:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0/gwamCB0n8pU62hU32wtr7xNnAi86qaUQ1NZsc6BQI=; b=Pc9Tq95hGfCpKBERBddGK75VbYoaRHBGE+WPV2dT7hfLK8FjyxnPu+w8RK/zpWGUlw 8xZYhO9g51XomU8ButZC1YZAP60KoJfxUwPoibgrXOKtUZoLQy9qZc7a2ewCIl95wvbe iX+EE+VWYDDs54pXnxMBJ8wedF1t//D31u7H1AKCpJeQsw0KIXTZ/vqCQq0RY4zfe47D qJKUMMpxapVWOOKImxz6Ou+ewCAFqnZ4capMg1lXWi7ffHKIStJyV1Ogngqoram9g8Tf XLVcE/beLcYKWYqDh2gV8kUVm3qPZEk7PyRGhtIM/FX/rfMiZdfmTfYPaCW2Sc53ghsw /Tqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0/gwamCB0n8pU62hU32wtr7xNnAi86qaUQ1NZsc6BQI=; b=qYOTc1vopN58prCzvpy0FuQ4+Duqva7vDKmEBrAGzbM8GgXbrf+f40wjxrlIhzewKE lSRvOnOb/UxrRh/gOHs8hU99j1K98NNfVbj0w398zJA+HIdCeavSxMABZA5/6bINw7mN aJyOSOHK1/Efw8P5VU0uNYlASPgEm704QQp9wVb3eBBWPbXZjzLs0snJSwr7biOZweeJ hWHYBwrUzZedsNqPUCS5Te1ns0nRfaSREl3hqBN/sgckCSlbWMk6AMHWSqT/cVBcShND 6zVu1rc/MyKFVy6WWR606atZKiicQZyu6x1urJmC+4MyrWBMKUgTS0ZM6K8lfKgCiOsp qSJg== X-Gm-Message-State: AFqh2kqZfJ6tvWog/P3Ti1ukrKxr7KkWuOpePAstGD/Xm4Q4HQLQfasz ngkeYQKFONUaZ8U36iSvFzICSpHTVsdzTV9+ X-Google-Smtp-Source: AMrXdXuMSb6TzbMb3YKSsNPR7I71hi0WSdWhmJKMmiFvvcNFLtxAqDtPdpDJCBM8BPvBgQA2/eU9zg== X-Received: by 2002:a05:6214:2d13:b0:534:80c0:6b64 with SMTP id mz19-20020a0562142d1300b0053480c06b64mr15136175qvb.1.1673841851277; Sun, 15 Jan 2023 20:04:11 -0800 (PST) Received: from localhost.localdomain (dsl-10-130-209.b2b2c.ca. [72.10.130.209]) by smtp.gmail.com with ESMTPSA id f23-20020ac84657000000b003b62d1ccd85sm1919175qto.40.2023.01.15.20.04.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 20:04:10 -0800 (PST) From: Maxim Cournoyer Date: Sun, 15 Jan 2023 23:04:02 -0500 Message-Id: <20230116040402.7350-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by keeping the distinction between native and host (regular) inputs even when not cross-compiling. A unified builder is used, which departs from the other build systems (which use one builder for the native build and another one for the cross build, where implemented). If this change is accepted, there would be adjustments needed to some of the ~150 Python packages using pyproject (looking for a native inputs now needs to be done using the 'native-inputs' instead of 'inputs' argument even in the native compilation mode). Over time I think it'd make sense to migrate more build systems to use this scheme, since it gives more control as to what inputs go into the wrapper. A demo package, python-pycryptodome, that contains C extensions is adjusted so that it can be cross-compiled using this new build system. Maxim Cournoyer (5): gnu: libtommath: Update to 1.2.0-0.03de03d. gnu: libtomcrypt: Update to 1.18.2-0.29986d0. build: Enable cross-compilation for pyproject-build-system. gnu: python-pycryptodome: Fix build and enable cross-compilation. gnu: python-coverage: Switch to pyproject-build-system. gnu/packages/check.scm | 2 +- gnu/packages/multiprecision.scm | 179 +++++++++----------------- gnu/packages/python-crypto.scm | 20 ++- guix/build-system/pyproject.scm | 115 ++++++++++------- guix/build/pyproject-build-system.scm | 126 ++++++++++++++++-- guix/packages.scm | 46 +++---- 6 files changed, 288 insertions(+), 200 deletions(-) base-commit: 5c921977179489caef4a9e54ada6696fc86d2f0b -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 15 23:59:10 2023 Received: (at control) by debbugs.gnu.org; 16 Jan 2023 04:59:10 +0000 Received: from localhost ([127.0.0.1]:60140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHaP-0004DI-Qk for submit@debbugs.gnu.org; Sun, 15 Jan 2023 23:59:10 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:37715) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHaO-0004D2-4x for control@debbugs.gnu.org; Sun, 15 Jan 2023 23:59:09 -0500 Received: by mail-qv1-f43.google.com with SMTP id u20so2664223qvq.4 for ; Sun, 15 Jan 2023 20:59:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=H/mkcjWJbpu3t7bAvmJkePqmA3Zt2L4LZhYa15z2Z24=; b=jESNjvlRzMn5W6Sjow1hwl3LMGIBVpCAXy4z4pmM/g7W2XmApZPA2IKO8mng1daEoo Mabxk+Eents2o+6um6bFmt6CnLzUNKwT4bL01FqmVKe6XLROq9XlDVn7ixnnbRL1Z/nS pdav2r7Deeko+nIkW2M2j1xkfMid1Bdh4I+nKEFs8NrT/7bSNGTW0RqCYSwuNRLs3oEY exBHUjJc+Xqb+th5EkFONZrSczteidydw89SgD656rg30ah+1sj3SUy8PFEJpWlvb+rU BZcjxYiTfENZO8yjN9gEFp2rLyhTq39w6pCcdDsd7E/c8v/8PZYWXv+Ayxb7zTBYnBFS 86QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H/mkcjWJbpu3t7bAvmJkePqmA3Zt2L4LZhYa15z2Z24=; b=v2Dr1wNU3kJqyVa8064kiFAqZTdn0UQ/3pWHXMqVPJk7/IywCUAZ/QvlDjn4QZMogS JTKo85/FudDJvrOGRYkpsSUsElHAXLblOVq1Bviyunw+3xk7R2VMggrn7pCVdHhXLdbl nzzF5Js1xFcbeWADVA20L8Nmv2YtTKdyon1HrqL4Zg/IsUYRgNaZ7NN2mjwfjXh0Vek9 jXXJsAWCFuiKLAas0iFlELudLOpGNGQO97uxTnX1niobnyqbIGTQrEOgnVLeT7GoGT8n +v3FOhMisZMqkrlArteAMdo1UjIqnMWNve9dMetDKgxplbPuFytZY9ZXLr8cTavOeiyy WVkg== X-Gm-Message-State: AFqh2koxT77D8k+pBftf4sW26JitxnWJIYNB3BLVNAx0fSyh/Hng+uFI 1Tby+G03N/lx3ikptSMH4HzQ8IcQAEXuWE4r X-Google-Smtp-Source: AMrXdXs/uU7YdeSu+FN2j7bBRS/Ph9yUSGkrmeGK34rIRyT1Qd6la26f8Z0g+0sudexNny7/vdBkug== X-Received: by 2002:a0c:ee28:0:b0:4c7:4f64:cb3e with SMTP id l8-20020a0cee28000000b004c74f64cb3emr122702876qvs.11.1673845142166; Sun, 15 Jan 2023 20:59:02 -0800 (PST) Received: from hurd (dsl-10-130-209.b2b2c.ca. [72.10.130.209]) by smtp.gmail.com with ESMTPSA id v7-20020a05620a440700b006fb112f512csm17601116qkp.74.2023.01.15.20.58.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 20:59:01 -0800 (PST) Date: Sun, 15 Jan 2023 23:58:55 -0500 Message-Id: <877cxncbxs.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #60847 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) retitle 60847 [PATCH] Enable cross-compilation for the pyproject-build-system. quit From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH 0/1] Enable cross-compilation for the pyproject-build-system References: <20230116040402.7350-1-maxim.cournoyer@gmail.com> In-Reply-To: <20230116040402.7350-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Jan 2023 05:03: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: 60847@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Lars-Dominik Braun , Ricardo Wurmus , jgart Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167384532816664 (code B ref 60847); Mon, 16 Jan 2023 05:03:02 +0000 Received: (at 60847) by debbugs.gnu.org; 16 Jan 2023 05:02:08 +0000 Received: from localhost ([127.0.0.1]:60145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHdI-0004Ki-A0 for submit@debbugs.gnu.org; Mon, 16 Jan 2023 00:02:08 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:37393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHdH-0004KG-0d for 60847@debbugs.gnu.org; Mon, 16 Jan 2023 00:02:07 -0500 Received: by mail-qt1-f173.google.com with SMTP id j9so1099029qtv.4 for <60847@debbugs.gnu.org>; Sun, 15 Jan 2023 21:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=U6sCICU/tnz7NkBthC8kkkSm6LX0KB4Rb1TZvcBA8I4=; b=olFmQEVPjGkNdHZvOyVAZpLmDx1Iiwpd34HGCo7O+2nr/SaYsKOdcToz33LyGh7Dyk rrqfcuIg4icxGH4CvYYl4azOlKEc8kfVF8n2Z3Hs8pAQFur1rqwpL+SMD1EGiQI0+dx2 0QoINXk6kfdfi0DGHIouzlNDf8hLwOFmzeXdRl+P9iAdhpCJci0L5D64m/eWwDhurI+x ZxE3NtI+wZVHI2HG0qNrGZkOVErq2YHh1bZoyvD8AiP4xzz2tnN/oPEPODjx2uK30uFR 0T/p8aVSmkHXyWLGrFOBUVZk8pVPTItlpIS1Nhz9P6XAhRgglU+vt3tvhMWbpty5m2/X L4CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=U6sCICU/tnz7NkBthC8kkkSm6LX0KB4Rb1TZvcBA8I4=; b=tm7/E588Y+4EBMnOFPTo0ZbE5eQJ0gs0ULfAK5u3kcp2K39ExU37Heawk4f+4EPRCx JeZOfG2vmXo+bxgB1wQyVTZvoO25K41c6mURWRc9gU4cUorRBrla+ZH4+213KktFNLdQ KlojOCWF3w78zv5S4BkULr3JLLsh7Eo50+wSDOdwoHNsjkuQpQWbu0/TXE7gRt0Vvjp/ k9EuLhPBEMn46czv2Tz0k8ssbTK6aR/SfilmqYp/pEcPai6Mzd28i2P7kLH3QfyGnUZb EWm0dYgwrCUqPqCOPLNRPuZQTeCx9nf5KkrAxgkse6LwgWTnWONJ/47L0VFBBBfnI0ft yf8g== X-Gm-Message-State: AFqh2kqjLZNI2x+6QYOC59dmdj0VrxWhu9tby0OxELofwpLHD6NDuudu gFrqSkSvOd/8dD6uhJEylvvlUXZ5ixjhHmyI X-Google-Smtp-Source: AMrXdXtKomLwiYF2hWCRYZ2UE2C9FanZ7v6ESezxeL7tmbMWn058FQm0mDdrHu4OYad+S4pAQfN66w== X-Received: by 2002:ac8:7457:0:b0:3a8:2122:7c28 with SMTP id h23-20020ac87457000000b003a821227c28mr130954331qtr.47.1673845321448; Sun, 15 Jan 2023 21:02:01 -0800 (PST) Received: from localhost.localdomain (dsl-10-130-209.b2b2c.ca. [72.10.130.209]) by smtp.gmail.com with ESMTPSA id ay40-20020a05620a17a800b006f956766f76sm17401318qkb.1.2023.01.15.21.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 21:02:01 -0800 (PST) From: Maxim Cournoyer Date: Mon, 16 Jan 2023 00:01:30 -0500 Message-Id: <20230116050132.24313-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by k [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.173 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.173 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by k [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.173 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.173 listed in list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by keeping the distinction between native and host (regular) inputs even when not cross-compiling. A unified builder is used, which departs from the other build systems (which use one builder for the native build and another one for the cross build, where implemented). If this change is accepted, there would be adjustments needed to some of the ~120 Python packages using pyproject (looking for a native inputs now needs to be done using the 'native-inputs' instead of 'inputs' argument even in the native compilation mode). Over time I think it'd make sense to migrate more build systems to use this scheme, since it gives more control as to what inputs go into the wrapper. A demo package, python-pycryptodome, that contains C extensions is adjusted so that it can be cross-compiled using this new build system. It is provided separately as it would need to go to core-updates. Maxim Cournoyer (1): build: Enable cross-compilation for pyproject-build-system. guix/build-system/pyproject.scm | 115 ++++++++++++++--------- guix/build/pyproject-build-system.scm | 126 +++++++++++++++++++++++--- guix/packages.scm | 46 +++++----- 3 files changed, 210 insertions(+), 77 deletions(-) base-commit: 5c921977179489caef4a9e54ada6696fc86d2f0b -- 2.38.1 From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH 1/1] build: Enable cross-compilation for pyproject-build-system. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Jan 2023 05:09: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: 60847@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Lars-Dominik Braun , Ricardo Wurmus , jgart Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167384570217254 (code B ref 60847); Mon, 16 Jan 2023 05:09:02 +0000 Received: (at 60847) by debbugs.gnu.org; 16 Jan 2023 05:08:22 +0000 Received: from localhost ([127.0.0.1]:60151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHjJ-0004UD-21 for submit@debbugs.gnu.org; Mon, 16 Jan 2023 00:08:22 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:39432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHjG-0004Ty-2i for 60847@debbugs.gnu.org; Mon, 16 Jan 2023 00:08:19 -0500 Received: by mail-qt1-f175.google.com with SMTP id r15so651983qtx.6 for <60847@debbugs.gnu.org>; Sun, 15 Jan 2023 21:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JegOH7l/A/D6onkrN2Qg61DNzKdDzrEzOLktAC+r3ho=; b=WvsXa5pUrFji2J1WFqVNXC7JrPUAhtU/WWyQT5GvCbVnOwwwfYajaCsFZaE9DrFk31 mUROGhdIcf+DxsFsFzhCsbXvloVVTs0rIKxqFz323jbEgFPHwKt3TnlLndYtbecLD+hF 5SEmTd/auMFfHxIjJoY2MzSo8MTnV/mzioEKNyF2UJCH2SLXahawyAsAGsa5RuqhANfG 9F3twSZKV7QnUwm8mLKlaQNacc4PKRCOZs98mh7yx7Qdrb6DlVL5PxfXbCL6aJ1mLnP6 hJuBcFnY367mauKH75YstXSqPxuKnes5aIxPKOYOJdNe6VEoUXvt2iylzv7PvbcQPQvM GyVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JegOH7l/A/D6onkrN2Qg61DNzKdDzrEzOLktAC+r3ho=; b=fDIfNKVcbHfNuScpfMTXYIbQ7XgsJd1aJuOBQg7gYiiCKmvQi+UHVENYL3nWmw+xOi MHj+W/krH8tuMvdZ6ly+9TvYjrwfx4s1cbUiuQ0J0qu/m9vbTqzvCt5lJprs+JxfqrAy YKxroGJaKxd0oTFznabSADYXQjccc+xSHLtMPTQV66wm2w5/WBZbc1YYdew3q5n2hY3t 3O6dtdx/qw4AhgbWBM3NCHaUmz7D2KvbBp4LgbxikmEqARFIFNfJl7m5EvmSl46ncKE5 zYsPDoLt1FmvnKNNQHT+Be7HPFdARGphn8PDs2RYPRexzSDfyj/nrPV/RX9Br+Gu+Gxt FUEw== X-Gm-Message-State: AFqh2kp+/HBuHFPGzzYgujFCnzv+s6Qk28xrL7DFgutvzoW2I4b7BSlC np5pxLaOngYFkeT9D0ch6dPJP1J8/+8nZtCy X-Google-Smtp-Source: AMrXdXupIRF6KtfwVW+p/mIRHdpY/71/qvjm5w06d1zwvbt3y5jEcKeIakBiEi6ATflBpPdoO7kHmg== X-Received: by 2002:a05:622a:1a92:b0:3b6:36f2:5f63 with SMTP id s18-20020a05622a1a9200b003b636f25f63mr507248qtc.49.1673845691944; Sun, 15 Jan 2023 21:08:11 -0800 (PST) Received: from localhost.localdomain (dsl-10-130-209.b2b2c.ca. [72.10.130.209]) by smtp.gmail.com with ESMTPSA id ay40-20020a05620a17a800b006f956766f76sm17401318qkb.1.2023.01.15.21.08.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 21:08:11 -0800 (PST) From: Maxim Cournoyer Date: Mon, 16 Jan 2023 00:01:31 -0500 Message-Id: <20230116050132.24313-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230116050132.24313-1-maxim.cournoyer@gmail.com> References: <20230116050132.24313-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/build-system/pyproject.scm (lower): Do not return #f when TARGET is set. Add the target field. Separate build-inputs from target-inputs, and extend these with the standard-packages or standard- [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 MANY_TO_CC Sent to 10+ recipients -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.175 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.175 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/build-system/pyproject.scm (lower): Do not return #f when TARGET is set. Add the target field. Separate build-inputs from target-inputs, and extend these with the standard-packages or standard- [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.160.175 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.175 listed in list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/build-system/pyproject.scm (lower): Do not return #f when TARGET is set. Add the target field. Separate build-inputs from target-inputs, and extend these with the standard-packages or standard-cross-packages procedures. (pyproject-build): Add the target, build-inputs, target-inputs, host-inputs and native-search-paths arguments. Remove the inputs argument. Adjust doc. Adjust the call to the build-side pyproject-build procedure. Always pass the target to the gexp->derivation call. * guix/packages.scm (bag->derivation): Special case the pyproject-build builder to always use cross-derivation bags * guix/build/pyproject-build-system.scm (set-paths): New procedure, overriding that provided by gnu-build-system. (check) [TARGET]: New argument. Disable the phase when it is set. (install): Adjust to look for Python in the native-inputs instead of inputs. (compile-bytecode): Likewise. (create-entrypoints): Likewise. (set-setuptools-env): New procedure. (sanity-check): Adjust to look for Python in the native-inputs instead of inputs. (add-install-to-pythonpath, wrap, rename-pth-file): Likewise. (%standard-phases): Override set-paths, add-install-to-pythonpath, wrap, sanity-check and rename-pth-file. Register set-setuptools-env. --- guix/build-system/pyproject.scm | 115 ++++++++++++++--------- guix/build/pyproject-build-system.scm | 126 +++++++++++++++++++++++--- guix/packages.scm | 46 +++++----- 3 files changed, 210 insertions(+), 77 deletions(-) diff --git a/guix/build-system/pyproject.scm b/guix/build-system/pyproject.scm index 8f3b562ca3..74d739023f 100644 --- a/guix/build-system/pyproject.scm +++ b/guix/build-system/pyproject.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Lars-Dominik Braun ;;; Copyright © 2022 Marius Bakke +;;; Copyright © 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -69,28 +70,37 @@ (define* (lower name #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:target #:python #:inputs #:native-inputs)) - - (and (not target) ;XXX: no cross-compilation - (bag - (name name) - (system system) - (host-inputs `(,@(if source - `(("source" ,source)) - '()) - ,@inputs - - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(standard-packages))) - (build-inputs `(("python" ,python) - ("sanity-check.py" ,(local-file sanity-check.py)) - ,@native-inputs)) - (outputs (append outputs '(wheel))) - (build pyproject-build) - (arguments (strip-keyword-arguments private-keywords arguments))))) - -(define* (pyproject-build name inputs - #:key source + `(#:python #:inputs #:native-inputs + ,@(if target '() '(#:target)))) + + (bag + (name name) + (system system) + (target target) + (build-inputs `(,@(if source + `(("source" ,source)) + '()) + ("python" ,python) + ("sanity-check.py" ,(local-file sanity-check.py)) + ,@native-inputs + ,@(if target + (standard-cross-packages target 'host) + '()) + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (host-inputs inputs) + (target-inputs (if target + (standard-cross-packages target 'target) + '())) + (outputs (append outputs '(wheel))) + (build pyproject-build) + (arguments (strip-keyword-arguments private-keywords arguments)))) + +(define* (pyproject-build name + #:key + target + build-inputs target-inputs host-inputs + source (tests? #t) (configure-flags ''()) (build-backend #f) @@ -98,44 +108,63 @@ (define* (pyproject-build name inputs (test-flags ''()) (phases '%standard-phases) (outputs '("out" "wheel")) + (native-search-paths '()) (search-paths '()) (system (%current-system)) (guile #f) (imported-modules %pyproject-build-system-modules) (modules '((guix build pyproject-build-system) (guix build utils)))) - "Build SOURCE using PYTHON, and with INPUTS." + "Build SOURCE using PYTHON, and with BUILD-INPUTS, HOST-INPUTS and +TARGET-INPUTS (if available)." (define build (with-imported-modules imported-modules #~(begin (use-modules #$@(sexp->gexp modules)) - #$(with-build-variables inputs outputs - #~(pyproject-build - #:name #$name - #:source #+source - #:configure-flags #$configure-flags - #:system #$system - #:build-backend #$build-backend - #:test-backend #$test-backend - #:test-flags #$test-flags - #:tests? #$tests? - #:phases #$(if (pair? phases) - (sexp->gexp phases) - phases) - #:outputs %outputs - #:search-paths '#$(sexp->gexp - (map search-path-specification->sexp - search-paths)) - #:inputs %build-inputs))))) + (define %build-host-inputs + #+(input-tuples->gexp build-inputs)) + + (define %build-target-inputs + (append #$(input-tuples->gexp host-inputs) + #+(input-tuples->gexp target-inputs))) + + (define %build-inputs + (append %build-host-inputs %build-target-inputs)) + + (define %outputs + #$(outputs->gexp outputs)) + (pyproject-build #:name #$name + #:source #+source + #:configure-flags #$configure-flags + #:system #$system + #:target #$target + #:build-backend #$build-backend + #:test-backend #$test-backend + #:test-flags #$test-flags + #:tests? #$tests? + #:phases #$(if (pair? phases) + (sexp->gexp phases) + phases) + #:outputs %outputs + #:search-paths + '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:native-search-paths + '#$(sexp->gexp + (map search-path-specification->sexp + native-search-paths)) + #:native-inputs %build-host-inputs + #:inputs %build-target-inputs)))) (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f))) (gexp->derivation name build #:system system - #:graft? #f ;consistent with 'gnu-build' - #:target #f + #:target target + #:graft? #f ;consistent with 'gnu-build' #:guile-for-build guile))) (define pyproject-build-system diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index c69ccc9d64..e51b5cfc43 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -86,6 +86,58 @@ (define-condition-type &cannot-extract-multiple-wheels &python-build-error ;; Raised, when no wheel has been built by the build system. (define-condition-type &no-wheels-built &python-build-error no-wheels-built?) +;;; XXX: This is the same as in (guix build gnu-build-system), except adjusted +;;; for the fact that native-inputs always exist now, whether cross-compiling +;;; or not. When not cross-compiling, input-directories are appended to +;;; native-input-directories to so that native-search-paths are computed for +;;; all inputs. +(define* (set-paths #:key target inputs native-inputs + search-paths native-search-paths + #:allow-other-keys) + (define input-directories + ;; The "source" input can be a directory, but we don't want it for search + ;; paths. See . + (match (alist-delete "source" inputs) + (((_ . dir) ...) + dir))) + + (define native-input-directories + (match (alist-delete "source" native-inputs) + (((_ . dir) ...) + dir))) + + ;; Tell 'ld-wrapper' to disallow non-store libraries. + (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "no") + + ;; When cross building, $PATH must refer only to native (host) inputs since + ;; target inputs are not executable. + (set-path-environment-variable "PATH" '("bin" "sbin") + (append native-input-directories + (if target + '() + input-directories))) + + (for-each (match-lambda + ((env-var (files ...) separator type pattern) + (set-path-environment-variable env-var files + input-directories + #:separator separator + #:type type + #:pattern pattern))) + search-paths) + + (for-each (match-lambda + ((env-var (files ...) separator type pattern) + (set-path-environment-variable env-var files + (append native-input-directories + (if target + '() + input-directories)) + #:separator separator + #:type type + #:pattern pattern))) + native-search-paths)) + (define* (build #:key outputs build-backend configure-flags #:allow-other-keys) "Build a given Python package." @@ -135,9 +187,9 @@ (define (pyproject.toml->build-backend file) wheel-dir config-settings))) -(define* (check #:key tests? test-backend test-flags #:allow-other-keys) +(define* (check #:key target tests? test-backend test-flags #:allow-other-keys) "Run the test suite of a given Python package." - (if tests? + (if (and tests? (not target)) ;; Unfortunately with PEP 517 there is no common method to specify test ;; systems. Guess test system based on inputs instead. (let* ((pytest (which "pytest")) @@ -172,11 +224,11 @@ (define* (check #:key tests? test-backend test-flags #:allow-other-keys) (else (raise (condition (&test-system-not-found)))))) (format #t "test suite not run~%"))) -(define* (install #:key inputs outputs #:allow-other-keys) +(define* (install #:key native-inputs outputs #:allow-other-keys) "Install a wheel file according to PEP 427" ;; See https://www.python.org/dev/peps/pep-0427/#installing-a-wheel-distribution-1-0-py32-none-any-whl - (let ((site-dir (site-packages inputs outputs)) - (python (assoc-ref inputs "python")) + (let ((site-dir (site-packages native-inputs outputs)) + (python (assoc-ref native-inputs "python")) (out (assoc-ref outputs "out"))) (define (extract file) "Extract wheel (ZIP file) into site-packages directory" @@ -262,10 +314,10 @@ (define (list-directories base predicate) (expand-data-directory directory) (rmdir directory)) datadirs)))) -(define* (compile-bytecode #:key inputs outputs #:allow-other-keys) +(define* (compile-bytecode #:key native-inputs outputs #:allow-other-keys) "Compile installed byte-code in site-packages." - (let* ((site-dir (site-packages inputs outputs)) - (python (assoc-ref inputs "python")) + (let* ((site-dir (site-packages native-inputs outputs)) + (python (assoc-ref native-inputs "python")) (major-minor (map string->number (take (string-split (python-version python) #\.) 2))) (<3.7? (match major-minor @@ -281,7 +333,7 @@ (define* (compile-bytecode #:key inputs outputs #:allow-other-keys) (invoke "python" "-m" "compileall" "--invalidation-mode=unchecked-hash" site-dir)))) -(define* (create-entrypoints #:key inputs outputs #:allow-other-keys) +(define* (create-entrypoints #:key native-inputs outputs #:allow-other-keys) "Implement Entry Points Specification (https://packaging.python.org/specifications/entry-points/) by PyPa, which creates runnable scripts in bin/ from entry point specification @@ -337,8 +389,7 @@ (define (create-script path name module function) import ~a as mod sys.exit (mod.~a ())~%" interpreter module function))) (chmod file-path #o755))) - - (let* ((site-dir (site-packages inputs outputs)) + (let* ((site-dir (site-packages native-inputs outputs)) (out (assoc-ref outputs "out")) (bin-dir (string-append out "/bin")) (entry-point-files (find-files site-dir "^entry_points.txt$"))) @@ -358,6 +409,51 @@ (define* (set-SOURCE-DATE-EPOCH* #:rest _) ;; not support timestamps before 1980. (setenv "SOURCE_DATE_EPOCH" "315619200")) +(define* (set-setuptools-env #:key target #:allow-other-keys) + "Set environment variables such as LDSHARED, LDXXSHARED, etc. used by +setuptools when building native extensions. This is particularly useful for +cross-compilation." + (define cc-for-target (if target + (string-append target "-gcc") + "gcc")) + (define cxx-for-target (if target + (string-append target "-g++") + "g++")) + ;; The variables defined here are taken from CPython's configure.ac file. + ;; The explanations are those of the Poky (from Yocto) project. + (setenv "CC" cc-for-target) + (setenv "CXX" cxx-for-target) + ;; LDSHARED is the ld *command* used to create shared library. + (setenv "LDSHARED" (string-append cc-for-target " -shared")) + ;; LDXXSHARED is the ld *command* used to create shared library of C++ + ;; objects. + (setenv "LDCXXSHARED" (string-append cxx-for-target " -shared")) + ;; CCSHARED are the C *flags* used to create objects to go into a shared + ;; library (module). + (setenv "CCSHARED" "-fPIC") + ;; LINKFORSHARED are the flags passed to the $(CC) command that links the + ;; python executable. + (setenv "LINKFORSHARED" "-Xlinker -export-dynamic")) + +(define* (sanity-check #:key tests? native-inputs outputs #:allow-other-keys + #:rest args) + (apply (assoc-ref python:%standard-phases 'sanity-check) + (append args (list #:inputs native-inputs)))) + +(define* (add-install-to-pythonpath #:key native-inputs outputs + #:allow-other-keys) + "A phase that just wraps the 'add-installed-pythonpath' procedure." + (add-installed-pythonpath native-inputs outputs)) + +(define* (wrap #:key native-inputs outputs #:allow-other-keys #:rest args) + (apply (assoc-ref python:%standard-phases 'wrap) + (append args (list #:inputs native-inputs)))) + +(define* (rename-pth-file #:key name native-inputs outputs #:allow-other-keys + #:rest args) + (apply (assoc-ref python:%standard-phases 'rename-pth-file) + (append args (list #:inputs native-inputs)))) + (define %standard-phases ;; The build phase only builds C extensions and copies the Python sources, ;; while the install phase copies then byte-compiles the sources to the @@ -365,13 +461,19 @@ (define %standard-phases ;; to ease testing the built package. (modify-phases python:%standard-phases (replace 'set-SOURCE-DATE-EPOCH set-SOURCE-DATE-EPOCH*) + (replace 'set-paths set-paths) + (add-after 'set-paths 'set-setuptools-env set-setuptools-env) (replace 'build build) (replace 'install install) + (replace 'add-install-to-pythonpath add-install-to-pythonpath) + (replace 'wrap wrap) (delete 'check) ;; Must be before tests, so they can use installed packages’ entry points. (add-before 'wrap 'create-entrypoints create-entrypoints) (add-after 'wrap 'check check) - (add-before 'check 'compile-bytecode compile-bytecode))) + (add-before 'check 'compile-bytecode compile-bytecode) + (replace 'sanity-check sanity-check) + (replace 'rename-pth-file rename-pth-file))) (define* (pyproject-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/packages.scm b/guix/packages.scm index 041a872f9d..6d7df17fc3 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1864,28 +1864,30 @@ (define* (bag->derivation bag #:optional context) "Return the derivation to build BAG for SYSTEM. Optionally, CONTEXT can be a package object describing the context in which the call occurs, for improved error reporting." - (if (bag-target bag) - (bag->cross-derivation bag) - (mlet* %store-monad ((system -> (bag-system bag)) - (inputs -> (bag-transitive-inputs bag)) - (input-drvs (mapm %store-monad - (cut expand-input context <> system) - inputs)) - (paths -> (delete-duplicates - (append-map (match-lambda - ((_ (? package? p) _ ...) - (package-native-search-paths - p)) - (_ '())) - inputs)))) - ;; It's possible that INPUTS contains packages that are not 'eq?' but - ;; that lead to the same derivation. Delete those duplicates to avoid - ;; issues down the road, such as duplicate entries in '%build-inputs'. - (apply (bag-build bag) (bag-name bag) - (delete-duplicates input-drvs input=?) - #:search-paths paths - #:outputs (bag-outputs bag) #:system system - (bag-arguments bag))))) + (let ((builder-name (procedure-name (bag-build bag)))) + (if (or (bag-target bag) + (eq? 'pyproject-build builder-name)) + (bag->cross-derivation bag) + (mlet* %store-monad ((system -> (bag-system bag)) + (inputs -> (bag-transitive-inputs bag)) + (input-drvs (mapm %store-monad + (cut expand-input context <> system) + inputs)) + (paths -> (delete-duplicates + (append-map (match-lambda + ((_ (? package? p) _ ...) + (package-native-search-paths + p)) + (_ '())) + inputs)))) + ;; It's possible that INPUTS contains packages that are not 'eq?' but + ;; that lead to the same derivation. Delete those duplicates to avoid + ;; issues down the road, such as duplicate entries in '%build-inputs'. + (apply (bag-build bag) (bag-name bag) + (delete-duplicates input-drvs input=?) + #:search-paths paths + #:outputs (bag-outputs bag) #:system system + (bag-arguments bag)))))) (define* (bag->cross-derivation bag #:optional context) "Return the derivation to build BAG, which is actually a cross build. -- 2.38.1 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 16 00:17:01 2023 Received: (at control) by debbugs.gnu.org; 16 Jan 2023 05:17:02 +0000 Received: from localhost ([127.0.0.1]:60179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHrd-00072u-G4 for submit@debbugs.gnu.org; Mon, 16 Jan 2023 00:17:01 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:33675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHHrW-00072b-96 for control@debbugs.gnu.org; Mon, 16 Jan 2023 00:16:56 -0500 Received: by mail-qt1-f169.google.com with SMTP id q15so2372qtn.0 for ; Sun, 15 Jan 2023 21:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=Tj0f1V4CukXBQU29SI6dlp81PXCU/GynlcfxPvFSAGM=; b=nlR80QifqYciXpVicDmL0XhQAmtqNo69PaKzTDAIbZbXVQlHX1BoLWrI8F+LMSSM1A 9nwaw/tjWnkSYKRwQio5jXV2tvmDh6CS3RHBmUeYr+Cj+N4vzhfoni2nUTlZQOBneuL3 YMYSDLKH9l7DTvPvlJZtkcEXmKOnMHDxpMQgukHP2i1w7xail8F36iKYewhwZtvlGoq8 tEMg5DWVcKY2gw/65vciqa08+28VOszqCSYJ9hVpuFAs5bs0aqExm//IgrGoxNHZlkG8 C/78INvxdftyTRCL14XwYBnqjfad5ClMNsl0erCr/2ejSPxmn3UFJxCXZVJI/gazJadc Cdww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tj0f1V4CukXBQU29SI6dlp81PXCU/GynlcfxPvFSAGM=; b=swEHhz2EIN3Zuk9gzowG6nyrJxxlFukaeCU9qrhmdiAfI12kctZmSE3J8qoFCBekwT qJXwrfzt/5tA8oPaIScTTzrg87ZOglmFjCoP7dar3iZnSmHmmuTgpmtLNiTnOH75vvAs 2RkQ9tQ9VIIyPnIzuwo4wjdo5KRZmiZeG1j9tLuyQdAWJho06Ky8MnhF8syppvvgvWum +fMgCMY4gvioLVhQi8tOjXXLrs8ItWhnIuAhwcz4Lm2Rc591Y2D2PFuA/7lHXnxNb30j gMXi63YLuwurrt0nEouatS10qM3wmsgIHmrPBK00pT4wM6eBZiZsmdssx0/rVTOf0tM0 A6PA== X-Gm-Message-State: AFqh2kpI+D0+B1O0mKup/YqtBeGlhT0U6I+TRn60OeKOxlCvkkSYoBqx hqQehNtJMpqGQqS3iNCnc9tkeiERUE+0/7X2 X-Google-Smtp-Source: AMrXdXtOMFOsagffWiLPme2a48Yxyw8djpuQEVk68lcxW8y3WfA7Z5eZyJi9pIzG+tzGpA1msDbX6w== X-Received: by 2002:ac8:4609:0:b0:3ab:2a7f:83e4 with SMTP id p9-20020ac84609000000b003ab2a7f83e4mr118985206qtn.35.1673846200960; Sun, 15 Jan 2023 21:16:40 -0800 (PST) Received: from hurd (dsl-10-130-209.b2b2c.ca. [72.10.130.209]) by smtp.gmail.com with ESMTPSA id u24-20020a37ab18000000b006f9c2be0b4bsm1513343qke.135.2023.01.15.21.16.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 21:16:40 -0800 (PST) Date: Mon, 16 Jan 2023 00:16:39 -0500 Message-Id: <875yd7cb48.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #60849 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) block 60849 by 60847 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 10:49:40 2023 Received: (at control) by debbugs.gnu.org; 17 Jan 2023 15:49:40 +0000 Received: from localhost ([127.0.0.1]:38002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHoDU-0005y4-Ig for submit@debbugs.gnu.org; Tue, 17 Jan 2023 10:49:40 -0500 Received: from mail-qv1-f53.google.com ([209.85.219.53]:35532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHoDT-0005xs-Ko for control@debbugs.gnu.org; Tue, 17 Jan 2023 10:49:39 -0500 Received: by mail-qv1-f53.google.com with SMTP id i12so21868563qvs.2 for ; Tue, 17 Jan 2023 07:49:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=iRrzQWH2n6rKtoiRc1ELUmTHR5iX9+d7XvHqHF4nqpY=; b=UE1d9faPf+omOXX/FcLu7OtX5iixlRqtZ2liRCmb9f12jJTnc/3uLSMgX6TqSDMB6n XGHwWLFMvn8LMKWrnW8z5mXoNdBlpJZt8WcfsVMXj2SUdggV8VzSsnaEWewnZ2ralTpB S0gaItNcVAXQ7He8QR0zTrhE8DueW/0UZywLL+FK3iR72c8Q0iCReWbxGMPgf+QCRf9t 7B2vs53N18+Tb+C09WReMk7AHK/sevo0JRtqgEzq+/wyvC7AzsHsPkUFhn/rBc6h1fUD BHkQlmc0rSmgzovI/T+liZcOUSQivVvRdUG/3EPxHC4iHqpvcBTTxP5eDwkCK11QvXSi h8mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iRrzQWH2n6rKtoiRc1ELUmTHR5iX9+d7XvHqHF4nqpY=; b=c1yntyRnh8ENXPPnseERImt760jOmKt1rbXiFemfTTCtC8rmilksqv6JJzXfsfkkry eFU3bc0b9Tn1lIaIaPsTsydPurr8Vr92sp06mH+zvpcM7f1kkbPaC+Y4KiBLKeYP9ubq m+E5dO6mRtAZCrJRHF7zjgOOgK35bweSi8FZp7hRyxwUrAuf5r0BKCZh+w9EL+U4kAmd yy/UFpl64lz/YkfyLfpoBYXI5M8nvb9uc7bKi7c8UHRF1o2p2ETyAvMfxNvDL+GV/ybK uJIB8qKppUS4KDnCL7ei9yQ9VvQVw6ZSCCSBpp5dg7teQ12Bw/79zLa/XdoS69Swhi6g +o+g== X-Gm-Message-State: AFqh2kqr+cNRxntCceaZq1YsWa6JXcObV0DvKZTKwz8HnzyUcgZGfwPr LtAiSe0Pqf8iBF2NInU+U3edTvsc8SgXXWlz X-Google-Smtp-Source: AMrXdXvmuHcFOmnsqdXRmIjpe9FYdBffN6r23C4TxUYiFL5tz+DtOcPpTS+X5vfvGRD/2mGHIalb6w== X-Received: by 2002:a05:6214:4499:b0:4df:59a8:b700 with SMTP id on25-20020a056214449900b004df59a8b700mr4072979qvb.42.1673970573987; Tue, 17 Jan 2023 07:49:33 -0800 (PST) Received: from hurd (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id g16-20020a05620a40d000b007055fa93060sm20654337qko.79.2023.01.17.07.49.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 07:49:33 -0800 (PST) Date: Tue, 17 Jan 2023 10:49:32 -0500 Message-Id: <875yd52mb7.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #25235 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) block 25235 by 60847 quit From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH v2 0/1] Enable cross-compilation for the pyproject-build-system References: <20230116040402.7350-1-maxim.cournoyer@gmail.com> In-Reply-To: <20230116040402.7350-1-maxim.cournoyer@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Jan 2023 13:33: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: 60847@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Lars-Dominik Braun , Ricardo Wurmus , jgart Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.16744807573129 (code B ref 60847); Mon, 23 Jan 2023 13:33:01 +0000 Received: (at 60847) by debbugs.gnu.org; 23 Jan 2023 13:32:37 +0000 Received: from localhost ([127.0.0.1]:53655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJww9-0000oO-8r for submit@debbugs.gnu.org; Mon, 23 Jan 2023 08:32:37 -0500 Received: from mail-yb1-f170.google.com ([209.85.219.170]:39710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJww7-0000oA-9a for 60847@debbugs.gnu.org; Mon, 23 Jan 2023 08:32:35 -0500 Received: by mail-yb1-f170.google.com with SMTP id 123so14735285ybv.6 for <60847@debbugs.gnu.org>; Mon, 23 Jan 2023 05:32:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aR3Cd32jsIpB/qaZMl46CjT9HybJqzHaQfNriE3Hl+k=; b=W0mpxJoLwEM2dov2UvhXAO2XNjtHRvyFPtKltKfdD7jRkcs97N1cjfLQIiXNwVEPvd g4S2ctfCOZpIKygFZHUGFlJIEfvU7drl5b1ROIN5EQkyBYY2BP8zDCbDDmVmOwACSO5B hHyCYhKfBbmpH8dtBz818T+fNB83f9ok4OQ5wzdgyHzCl7pAdgOicuZ6/OxtCb7DpwCg xLmNt+utlN0qkVLnaQNeGcVuMdnESAZF6vfvGxcydBQYAs3GiILCUAqYkRpibVHUg243 uPBbpo7wlSZ/fNstrVdLNDP1/HehR4ImBIQf6A4YQAGP/O2EN0R2mxJ4Pnrl7zun33PE 8Wkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aR3Cd32jsIpB/qaZMl46CjT9HybJqzHaQfNriE3Hl+k=; b=amuFKiiy1Jqc5dQDf9Poghlx71jubpljX1hbPtf9qoqgVNfrfM1qeyUvi0798Hd4wA mBuXYVsVVNJP20imf/Am2ekOFOPyHBXrPX7CM2fWwBbxH9sTfiSr1oIbSO4dasamxuJX 2SGQ3cjdc040GCDdVUD6kpUDbShydPaTfpEi9PgZs5QV7K8PboMMlak1V2HyyqN2mSkq QdbJXHbHgD6KsSeZ94PbO5FvdWO9jD3lSHQ+hnbXAmOSliBQmW/XKnVxJDkKsevlmMDD v6MnN8ymddoL06HeZ8S30aETvjEEaGKZhmk3TGr67NG4dLfGwCfyU1A1y7o04+L0KzCj vA1g== X-Gm-Message-State: AFqh2kqecXwbYsYN7YCfPp7duwoUzZls+3aAz+usMLBT80jXwVA4FcAP COO6yFrokuxUgGWk25z5XF5LEOsT8CGNmLPJ X-Google-Smtp-Source: AMrXdXt/fPl3Zf51jOJWCkhPFcJ5JplzkE+ZhjOKNeON/JZxo2YQdj8H20Zh0Vc8UmrIYWTS4mGaWg== X-Received: by 2002:a25:5ec2:0:b0:7ff:b107:d3db with SMTP id s185-20020a255ec2000000b007ffb107d3dbmr8985781ybb.19.1674480749412; Mon, 23 Jan 2023 05:32:29 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id h4-20020a05620a244400b00706adbdf8b8sm11718274qkn.83.2023.01.23.05.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:32:28 -0800 (PST) From: Maxim Cournoyer Date: Mon, 23 Jan 2023 08:32:15 -0500 Message-Id: <20230123133217.318-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by k [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.170 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.170 listed in list.dnswl.org] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by k [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.170 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.170 listed in list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager This change enables cross-compilation for the pyproject-build-system, at the same time paving the way to fix the longstanding bug #25235 (Wrapped python programs get native-inputs in PYTHONPATH), by keeping the distinction between native and host (regular) inputs even when not cross-compiling. A unified builder is used, which departs from the other build systems (which use one builder for the native build and another one for the cross build, where implemented). If this change is accepted, there would be adjustments needed to some of the ~120 Python packages using pyproject (looking for a native inputs now needs to be done using the 'native-inputs' instead of 'inputs' argument even in the native compilation mode). Over time I think it'd make sense to migrate more build systems to use this scheme, since it gives more control as to what inputs go into the wrapper. A demo package, python-pycryptodome, that contains C extensions is adjusted so that it can be cross-compiled using this new build system. It is provided separately as it would need to go to core-updates. Changes in v2: - Rebase Maxim Cournoyer (1): build: Enable cross-compilation for pyproject-build-system. guix/build-system/pyproject.scm | 115 ++++++++++++++--------- guix/build/pyproject-build-system.scm | 126 +++++++++++++++++++++++--- guix/packages.scm | 46 +++++----- 3 files changed, 210 insertions(+), 77 deletions(-) base-commit: 3a1b18aa4540e6f96ded0a98dd907a8033262582 -- 2.39.1 From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH v2 1/1] build: Enable cross-compilation for pyproject-build-system. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 23 Jan 2023 13:33: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: 60847@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Maxim Cournoyer , Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Lars-Dominik Braun , Ricardo Wurmus , jgart Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.16744807643147 (code B ref 60847); Mon, 23 Jan 2023 13:33:02 +0000 Received: (at 60847) by debbugs.gnu.org; 23 Jan 2023 13:32:44 +0000 Received: from localhost ([127.0.0.1]:53658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJwwF-0000og-Ia for submit@debbugs.gnu.org; Mon, 23 Jan 2023 08:32:44 -0500 Received: from mail-yb1-f172.google.com ([209.85.219.172]:43783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJwwC-0000oH-Cj for 60847@debbugs.gnu.org; Mon, 23 Jan 2023 08:32:41 -0500 Received: by mail-yb1-f172.google.com with SMTP id 203so14722344yby.10 for <60847@debbugs.gnu.org>; Mon, 23 Jan 2023 05:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nFj2fNRl7xo3quMdxjde7HXLuvLMdVx8PwgtKf3EIkE=; b=KUH9SkXabC3sEpLy/VFLD6fogHhie/ievvChIl7lc5pGg/iFlxWfwtv3B23z3E3U20 tU8+sTspReybOY+uAwIsAJfLiQCxPunV01MvuzBDP9B4B320/56hjMBQIlKbF80DbBdB XO7v1nJk0WBpBRp7FAa93/oLQ+s1R2MKNhYk1JYEQ8+sKp65hg+rrnoW5gwQrR6Eu3Ym v6k/+CO+bd06FdizvVSL0rmpUodcmUR1lcp17QpdqmToxfFZLdNRL5mk7IgTvRrIhcy9 kG2R2WTLopBgH1ROUZI+WkTF0UG71Ykg6rK7HnvsJtEkOPxGhxZodQp3WgupDn8CgEW/ 7ylA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nFj2fNRl7xo3quMdxjde7HXLuvLMdVx8PwgtKf3EIkE=; b=TYdI08SST/Idtn3CkRZW5H0TnUfMLdwPiKsoOIxUBbhNwskrKDu+tcHuBueQ5RQNEh NhifsmV9Am5/xQwVxUXARINv7wzreqYM/wKSFm/n3N5jYY0joJQ/Ty9xbQcoeEhGwR5E +8geyCFKVCn4M050Bg0jq3JgyBMbcVr3dumUJ8o4968l9VC3UzDaNvOvYzzx1j3WiVio VTvJrocGodFkeBtHTw58jVXOTvCaVYtxcN8dvDo3sZEuVDYdo3QaqesLIWIiwBaeF/vD 6zd3y6fgneT0bQBjzIkAxljVFWp95FINmcvK64Z0WyV9VivyxcgIsG/sQyLJL7ZXtXpX eEhw== X-Gm-Message-State: AFqh2kpQqBD7+YP+ONH/ImqDMLHfzZo32zOapeg+hSAmPxIX4Gf/ZWLN 3m3ugR2hhLtrV2CgNNlX71z/g1CxuKwKkgDO X-Google-Smtp-Source: AMrXdXsD4fXJGc7iA6L7W6LhKZr2tLndAHl0YGYJmpcE8M8Dck/CYorUoOM2w83UngGy7K2KRTmY1Q== X-Received: by 2002:a25:d683:0:b0:802:5b06:4d1f with SMTP id n125-20020a25d683000000b008025b064d1fmr5773007ybg.17.1674480754384; Mon, 23 Jan 2023 05:32:34 -0800 (PST) Received: from localhost.localdomain ([2607:fad8:4:3::1001]) by smtp.gmail.com with ESMTPSA id h4-20020a05620a244400b00706adbdf8b8sm11718274qkn.83.2023.01.23.05.32.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:32:34 -0800 (PST) From: Maxim Cournoyer Date: Mon, 23 Jan 2023 08:32:16 -0500 Message-Id: <20230123133217.318-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230123133217.318-1-maxim.cournoyer@gmail.com> References: <20230123133217.318-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/build-system/pyproject.scm (lower): Do not return #f when TARGET is set. Add the target field. Separate build-inputs from target-inputs, and extend these with the standard-packages or standard- [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.172 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.172 listed in list.dnswl.org] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * guix/build-system/pyproject.scm (lower): Do not return #f when TARGET is set. Add the target field. Separate build-inputs from target-inputs, and extend these with the standard-packages or standard- [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.172 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.172 listed in list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * guix/build-system/pyproject.scm (lower): Do not return #f when TARGET is set. Add the target field. Separate build-inputs from target-inputs, and extend these with the standard-packages or standard-cross-packages procedures. (pyproject-build): Add the target, build-inputs, target-inputs, host-inputs and native-search-paths arguments. Remove the inputs argument. Adjust doc. Adjust the call to the build-side pyproject-build procedure. Always pass the target to the gexp->derivation call. * guix/packages.scm (bag->derivation): Special case the pyproject-build builder to always use cross-derivation bags * guix/build/pyproject-build-system.scm (set-paths): New procedure, overriding that provided by gnu-build-system. (check) [TARGET]: New argument. Disable the phase when it is set. (install): Adjust to look for Python in the native-inputs instead of inputs. (compile-bytecode): Likewise. (create-entrypoints): Likewise. (set-setuptools-env): New procedure. (sanity-check): Adjust to look for Python in the native-inputs instead of inputs. (add-install-to-pythonpath, wrap, rename-pth-file): Likewise. (%standard-phases): Override set-paths, add-install-to-pythonpath, wrap, sanity-check and rename-pth-file. Register set-setuptools-env. --- Changes in v2: - Rebase guix/build-system/pyproject.scm | 115 ++++++++++++++--------- guix/build/pyproject-build-system.scm | 126 +++++++++++++++++++++++--- guix/packages.scm | 46 +++++----- 3 files changed, 210 insertions(+), 77 deletions(-) diff --git a/guix/build-system/pyproject.scm b/guix/build-system/pyproject.scm index 8f3b562ca3..74d739023f 100644 --- a/guix/build-system/pyproject.scm +++ b/guix/build-system/pyproject.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Lars-Dominik Braun ;;; Copyright © 2022 Marius Bakke +;;; Copyright © 2023 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -69,28 +70,37 @@ (define* (lower name #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:target #:python #:inputs #:native-inputs)) - - (and (not target) ;XXX: no cross-compilation - (bag - (name name) - (system system) - (host-inputs `(,@(if source - `(("source" ,source)) - '()) - ,@inputs - - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(standard-packages))) - (build-inputs `(("python" ,python) - ("sanity-check.py" ,(local-file sanity-check.py)) - ,@native-inputs)) - (outputs (append outputs '(wheel))) - (build pyproject-build) - (arguments (strip-keyword-arguments private-keywords arguments))))) - -(define* (pyproject-build name inputs - #:key source + `(#:python #:inputs #:native-inputs + ,@(if target '() '(#:target)))) + + (bag + (name name) + (system system) + (target target) + (build-inputs `(,@(if source + `(("source" ,source)) + '()) + ("python" ,python) + ("sanity-check.py" ,(local-file sanity-check.py)) + ,@native-inputs + ,@(if target + (standard-cross-packages target 'host) + '()) + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (host-inputs inputs) + (target-inputs (if target + (standard-cross-packages target 'target) + '())) + (outputs (append outputs '(wheel))) + (build pyproject-build) + (arguments (strip-keyword-arguments private-keywords arguments)))) + +(define* (pyproject-build name + #:key + target + build-inputs target-inputs host-inputs + source (tests? #t) (configure-flags ''()) (build-backend #f) @@ -98,44 +108,63 @@ (define* (pyproject-build name inputs (test-flags ''()) (phases '%standard-phases) (outputs '("out" "wheel")) + (native-search-paths '()) (search-paths '()) (system (%current-system)) (guile #f) (imported-modules %pyproject-build-system-modules) (modules '((guix build pyproject-build-system) (guix build utils)))) - "Build SOURCE using PYTHON, and with INPUTS." + "Build SOURCE using PYTHON, and with BUILD-INPUTS, HOST-INPUTS and +TARGET-INPUTS (if available)." (define build (with-imported-modules imported-modules #~(begin (use-modules #$@(sexp->gexp modules)) - #$(with-build-variables inputs outputs - #~(pyproject-build - #:name #$name - #:source #+source - #:configure-flags #$configure-flags - #:system #$system - #:build-backend #$build-backend - #:test-backend #$test-backend - #:test-flags #$test-flags - #:tests? #$tests? - #:phases #$(if (pair? phases) - (sexp->gexp phases) - phases) - #:outputs %outputs - #:search-paths '#$(sexp->gexp - (map search-path-specification->sexp - search-paths)) - #:inputs %build-inputs))))) + (define %build-host-inputs + #+(input-tuples->gexp build-inputs)) + + (define %build-target-inputs + (append #$(input-tuples->gexp host-inputs) + #+(input-tuples->gexp target-inputs))) + + (define %build-inputs + (append %build-host-inputs %build-target-inputs)) + + (define %outputs + #$(outputs->gexp outputs)) + (pyproject-build #:name #$name + #:source #+source + #:configure-flags #$configure-flags + #:system #$system + #:target #$target + #:build-backend #$build-backend + #:test-backend #$test-backend + #:test-flags #$test-flags + #:tests? #$tests? + #:phases #$(if (pair? phases) + (sexp->gexp phases) + phases) + #:outputs %outputs + #:search-paths + '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:native-search-paths + '#$(sexp->gexp + (map search-path-specification->sexp + native-search-paths)) + #:native-inputs %build-host-inputs + #:inputs %build-target-inputs)))) (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) system #:graft? #f))) (gexp->derivation name build #:system system - #:graft? #f ;consistent with 'gnu-build' - #:target #f + #:target target + #:graft? #f ;consistent with 'gnu-build' #:guile-for-build guile))) (define pyproject-build-system diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index c69ccc9d64..e51b5cfc43 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -86,6 +86,58 @@ (define-condition-type &cannot-extract-multiple-wheels &python-build-error ;; Raised, when no wheel has been built by the build system. (define-condition-type &no-wheels-built &python-build-error no-wheels-built?) +;;; XXX: This is the same as in (guix build gnu-build-system), except adjusted +;;; for the fact that native-inputs always exist now, whether cross-compiling +;;; or not. When not cross-compiling, input-directories are appended to +;;; native-input-directories to so that native-search-paths are computed for +;;; all inputs. +(define* (set-paths #:key target inputs native-inputs + search-paths native-search-paths + #:allow-other-keys) + (define input-directories + ;; The "source" input can be a directory, but we don't want it for search + ;; paths. See . + (match (alist-delete "source" inputs) + (((_ . dir) ...) + dir))) + + (define native-input-directories + (match (alist-delete "source" native-inputs) + (((_ . dir) ...) + dir))) + + ;; Tell 'ld-wrapper' to disallow non-store libraries. + (setenv "GUIX_LD_WRAPPER_ALLOW_IMPURITIES" "no") + + ;; When cross building, $PATH must refer only to native (host) inputs since + ;; target inputs are not executable. + (set-path-environment-variable "PATH" '("bin" "sbin") + (append native-input-directories + (if target + '() + input-directories))) + + (for-each (match-lambda + ((env-var (files ...) separator type pattern) + (set-path-environment-variable env-var files + input-directories + #:separator separator + #:type type + #:pattern pattern))) + search-paths) + + (for-each (match-lambda + ((env-var (files ...) separator type pattern) + (set-path-environment-variable env-var files + (append native-input-directories + (if target + '() + input-directories)) + #:separator separator + #:type type + #:pattern pattern))) + native-search-paths)) + (define* (build #:key outputs build-backend configure-flags #:allow-other-keys) "Build a given Python package." @@ -135,9 +187,9 @@ (define (pyproject.toml->build-backend file) wheel-dir config-settings))) -(define* (check #:key tests? test-backend test-flags #:allow-other-keys) +(define* (check #:key target tests? test-backend test-flags #:allow-other-keys) "Run the test suite of a given Python package." - (if tests? + (if (and tests? (not target)) ;; Unfortunately with PEP 517 there is no common method to specify test ;; systems. Guess test system based on inputs instead. (let* ((pytest (which "pytest")) @@ -172,11 +224,11 @@ (define* (check #:key tests? test-backend test-flags #:allow-other-keys) (else (raise (condition (&test-system-not-found)))))) (format #t "test suite not run~%"))) -(define* (install #:key inputs outputs #:allow-other-keys) +(define* (install #:key native-inputs outputs #:allow-other-keys) "Install a wheel file according to PEP 427" ;; See https://www.python.org/dev/peps/pep-0427/#installing-a-wheel-distribution-1-0-py32-none-any-whl - (let ((site-dir (site-packages inputs outputs)) - (python (assoc-ref inputs "python")) + (let ((site-dir (site-packages native-inputs outputs)) + (python (assoc-ref native-inputs "python")) (out (assoc-ref outputs "out"))) (define (extract file) "Extract wheel (ZIP file) into site-packages directory" @@ -262,10 +314,10 @@ (define (list-directories base predicate) (expand-data-directory directory) (rmdir directory)) datadirs)))) -(define* (compile-bytecode #:key inputs outputs #:allow-other-keys) +(define* (compile-bytecode #:key native-inputs outputs #:allow-other-keys) "Compile installed byte-code in site-packages." - (let* ((site-dir (site-packages inputs outputs)) - (python (assoc-ref inputs "python")) + (let* ((site-dir (site-packages native-inputs outputs)) + (python (assoc-ref native-inputs "python")) (major-minor (map string->number (take (string-split (python-version python) #\.) 2))) (<3.7? (match major-minor @@ -281,7 +333,7 @@ (define* (compile-bytecode #:key inputs outputs #:allow-other-keys) (invoke "python" "-m" "compileall" "--invalidation-mode=unchecked-hash" site-dir)))) -(define* (create-entrypoints #:key inputs outputs #:allow-other-keys) +(define* (create-entrypoints #:key native-inputs outputs #:allow-other-keys) "Implement Entry Points Specification (https://packaging.python.org/specifications/entry-points/) by PyPa, which creates runnable scripts in bin/ from entry point specification @@ -337,8 +389,7 @@ (define (create-script path name module function) import ~a as mod sys.exit (mod.~a ())~%" interpreter module function))) (chmod file-path #o755))) - - (let* ((site-dir (site-packages inputs outputs)) + (let* ((site-dir (site-packages native-inputs outputs)) (out (assoc-ref outputs "out")) (bin-dir (string-append out "/bin")) (entry-point-files (find-files site-dir "^entry_points.txt$"))) @@ -358,6 +409,51 @@ (define* (set-SOURCE-DATE-EPOCH* #:rest _) ;; not support timestamps before 1980. (setenv "SOURCE_DATE_EPOCH" "315619200")) +(define* (set-setuptools-env #:key target #:allow-other-keys) + "Set environment variables such as LDSHARED, LDXXSHARED, etc. used by +setuptools when building native extensions. This is particularly useful for +cross-compilation." + (define cc-for-target (if target + (string-append target "-gcc") + "gcc")) + (define cxx-for-target (if target + (string-append target "-g++") + "g++")) + ;; The variables defined here are taken from CPython's configure.ac file. + ;; The explanations are those of the Poky (from Yocto) project. + (setenv "CC" cc-for-target) + (setenv "CXX" cxx-for-target) + ;; LDSHARED is the ld *command* used to create shared library. + (setenv "LDSHARED" (string-append cc-for-target " -shared")) + ;; LDXXSHARED is the ld *command* used to create shared library of C++ + ;; objects. + (setenv "LDCXXSHARED" (string-append cxx-for-target " -shared")) + ;; CCSHARED are the C *flags* used to create objects to go into a shared + ;; library (module). + (setenv "CCSHARED" "-fPIC") + ;; LINKFORSHARED are the flags passed to the $(CC) command that links the + ;; python executable. + (setenv "LINKFORSHARED" "-Xlinker -export-dynamic")) + +(define* (sanity-check #:key tests? native-inputs outputs #:allow-other-keys + #:rest args) + (apply (assoc-ref python:%standard-phases 'sanity-check) + (append args (list #:inputs native-inputs)))) + +(define* (add-install-to-pythonpath #:key native-inputs outputs + #:allow-other-keys) + "A phase that just wraps the 'add-installed-pythonpath' procedure." + (add-installed-pythonpath native-inputs outputs)) + +(define* (wrap #:key native-inputs outputs #:allow-other-keys #:rest args) + (apply (assoc-ref python:%standard-phases 'wrap) + (append args (list #:inputs native-inputs)))) + +(define* (rename-pth-file #:key name native-inputs outputs #:allow-other-keys + #:rest args) + (apply (assoc-ref python:%standard-phases 'rename-pth-file) + (append args (list #:inputs native-inputs)))) + (define %standard-phases ;; The build phase only builds C extensions and copies the Python sources, ;; while the install phase copies then byte-compiles the sources to the @@ -365,13 +461,19 @@ (define %standard-phases ;; to ease testing the built package. (modify-phases python:%standard-phases (replace 'set-SOURCE-DATE-EPOCH set-SOURCE-DATE-EPOCH*) + (replace 'set-paths set-paths) + (add-after 'set-paths 'set-setuptools-env set-setuptools-env) (replace 'build build) (replace 'install install) + (replace 'add-install-to-pythonpath add-install-to-pythonpath) + (replace 'wrap wrap) (delete 'check) ;; Must be before tests, so they can use installed packages’ entry points. (add-before 'wrap 'create-entrypoints create-entrypoints) (add-after 'wrap 'check check) - (add-before 'check 'compile-bytecode compile-bytecode))) + (add-before 'check 'compile-bytecode compile-bytecode) + (replace 'sanity-check sanity-check) + (replace 'rename-pth-file rename-pth-file))) (define* (pyproject-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) diff --git a/guix/packages.scm b/guix/packages.scm index 041a872f9d..6d7df17fc3 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -1864,28 +1864,30 @@ (define* (bag->derivation bag #:optional context) "Return the derivation to build BAG for SYSTEM. Optionally, CONTEXT can be a package object describing the context in which the call occurs, for improved error reporting." - (if (bag-target bag) - (bag->cross-derivation bag) - (mlet* %store-monad ((system -> (bag-system bag)) - (inputs -> (bag-transitive-inputs bag)) - (input-drvs (mapm %store-monad - (cut expand-input context <> system) - inputs)) - (paths -> (delete-duplicates - (append-map (match-lambda - ((_ (? package? p) _ ...) - (package-native-search-paths - p)) - (_ '())) - inputs)))) - ;; It's possible that INPUTS contains packages that are not 'eq?' but - ;; that lead to the same derivation. Delete those duplicates to avoid - ;; issues down the road, such as duplicate entries in '%build-inputs'. - (apply (bag-build bag) (bag-name bag) - (delete-duplicates input-drvs input=?) - #:search-paths paths - #:outputs (bag-outputs bag) #:system system - (bag-arguments bag))))) + (let ((builder-name (procedure-name (bag-build bag)))) + (if (or (bag-target bag) + (eq? 'pyproject-build builder-name)) + (bag->cross-derivation bag) + (mlet* %store-monad ((system -> (bag-system bag)) + (inputs -> (bag-transitive-inputs bag)) + (input-drvs (mapm %store-monad + (cut expand-input context <> system) + inputs)) + (paths -> (delete-duplicates + (append-map (match-lambda + ((_ (? package? p) _ ...) + (package-native-search-paths + p)) + (_ '())) + inputs)))) + ;; It's possible that INPUTS contains packages that are not 'eq?' but + ;; that lead to the same derivation. Delete those duplicates to avoid + ;; issues down the road, such as duplicate entries in '%build-inputs'. + (apply (bag-build bag) (bag-name bag) + (delete-duplicates input-drvs input=?) + #:search-paths paths + #:outputs (bag-outputs bag) #:system system + (bag-arguments bag)))))) (define* (bag->cross-derivation bag #:optional context) "Return the derivation to build BAG, which is actually a cross build. -- 2.39.1 From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH v2 1/1] build: Enable cross-compilation for pyproject-build-system. Resent-From: "jgart" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Jan 2023 02:06: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: "Maxim Cournoyer" , 60847@debbugs.gnu.org Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , ludo@gnu.org, Christopher Baines , Lars-Dominik Braun , Ricardo Wurmus Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.16745259223372 (code B ref 60847); Tue, 24 Jan 2023 02:06:01 +0000 Received: (at 60847) by debbugs.gnu.org; 24 Jan 2023 02:05:22 +0000 Received: from localhost ([127.0.0.1]:55657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK8gc-0000sH-7C for submit@debbugs.gnu.org; Mon, 23 Jan 2023 21:05:22 -0500 Received: from mx1.dismail.de ([78.46.223.134]:28807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pK8ga-0000s0-FL for 60847@debbugs.gnu.org; Mon, 23 Jan 2023 21:05:21 -0500 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id e1d02547; Tue, 24 Jan 2023 03:05:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:content-transfer-encoding:from :message-id:subject:to:cc:in-reply-to:references; s=20190914; bh=TYXFnsit223VV681AR2gzqNHJekRiYbNJGAD5nIuAlM=; b=QqiW870huh62 bNlCN14V0J/LuXTn9BH1lSwqCoxSjIQWR6xhzJDl3XNjJEk301dQpvVIDx/gqIxl xVs6CdrMd0G0qkTzaFI1LeetcrpV4LmIW698J7EUehLBt6czXGSbWMXWva1qT9vF VvXrc7byw7mZ6gVs6LkR1EBrpKEHncy19FU+x15SkEURw8FGJdareMDMLJGdwEsf NNZgJ9P6YDV/WQUj4Dmip54celbonwlJSpSy+XTFNAHvje4d2SmJmU8bNXrW7yUv BEjzq67f8equ1l+GMzPG/wv3775b/fikY5U9T0viAaiZ66No03nve2kY36ieFaIC OpoEeNud1g== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id d74e0c13; Tue, 24 Jan 2023 03:05:12 +0100 (CET) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 0c82e315; Tue, 24 Jan 2023 03:05:12 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id bb90babb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 24 Jan 2023 03:05:11 +0100 (CET) MIME-Version: 1.0 Date: Tue, 24 Jan 2023 02:05:11 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.16.0a From: "jgart" Message-ID: <065abd9e926ff892b97b45662685943e@dismail.de> In-Reply-To: <20230123133217.318-2-maxim.cournoyer@gmail.com> References: <20230123133217.318-2-maxim.cournoyer@gmail.com> <20230123133217.318-1-maxim.cournoyer@gmail.com> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Maxim, Sorry, This week is still too busy for me with work to review this. Looki= ng forward to reviewing future patches or these if still needed. all best, jgart From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Mar 2023 17:05: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: Maxim Cournoyer 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.167812229023789 (code B ref 60847); Mon, 06 Mar 2023 17:05:01 +0000 Received: (at 60847) by debbugs.gnu.org; 6 Mar 2023 17:04:50 +0000 Received: from localhost ([127.0.0.1]:43515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZEGX-0006Bd-Ox for submit@debbugs.gnu.org; Mon, 06 Mar 2023 12:04:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZEGW-0006BR-JS for 60847@debbugs.gnu.org; Mon, 06 Mar 2023 12:04:49 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZEGQ-0002cG-PW; Mon, 06 Mar 2023 12:04:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=4HyrjNlKU/X046YF+Kbdn7btcX1CPUo0/R9EZoZuGGA=; b=H14vT1+dWkU7t3j8zzdO Scy5yjT1cSdjdmU1hL9nPJTd6w9mdfpN4jCZU1zoQ0x9hEc/xPNUFmTdh+Jtd667LRCNG/d3c/Mcr F2wt+741xsoO1y1naYRlsd2ioHrzgRZhIlFVjeqN3Z3zmBMeXWOyJL+P7IlJEOR5hubW08WJtKmyq oCq0cLkgtKCu7bdqhQsu0P3/cx3WOLo0jwCB4kZ7a9uLLe2BLtDMu9p9l2fVChUj4YHCXy32PqfNc MpBaNhBxXHbJZ4J2E8giYhFPRGc7uSXXQ7zW1Ym2dw8hDruBJY+RBsSI22tCzuwaYbBCcXnYs0wNh jWsDJXsAuBDWyQ==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZEGN-0005Ou-FI; Mon, 06 Mar 2023 12:04:40 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230123133217.318-1-maxim.cournoyer@gmail.com> <20230123133217.318-2-maxim.cournoyer@gmail.com> Date: Mon, 06 Mar 2023 18:04:35 +0100 In-Reply-To: <20230123133217.318-2-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 23 Jan 2023 08:32:16 -0500") Message-ID: <87zg8p7qvw.fsf_-_@gnu.org> 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: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, Maxim Cournoyer skribis: > +++ b/guix/packages.scm > @@ -1864,28 +1864,30 @@ (define* (bag->derivation bag #:optional context) [=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 deb= ugging 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 m= ore common issue, but I think this one approach is not the way forward. I hope that makes sense! Ludo=E2=80=99. From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: "jgart" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Mar 2023 22:57: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?=" , "Maxim Cournoyer" Cc: Josselin Poiret , Christopher Baines , Simon Tournier , Mathieu Othacehe , 60847@debbugs.gnu.org, Tobias Geerinckx-Rice , Lars-Dominik Braun , Ricardo Wurmus Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167814337826339 (code B ref 60847); Mon, 06 Mar 2023 22:57:01 +0000 Received: (at 60847) by debbugs.gnu.org; 6 Mar 2023 22:56:18 +0000 Received: from localhost ([127.0.0.1]:43914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZJkg-0006ql-DH for submit@debbugs.gnu.org; Mon, 06 Mar 2023 17:56:18 -0500 Received: from mx1.dismail.de ([78.46.223.134]:30687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZJke-0006qW-BC for 60847@debbugs.gnu.org; Mon, 06 Mar 2023 17:56:16 -0500 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 2b8d7e65; Mon, 6 Mar 2023 23:56:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:content-transfer-encoding:from :message-id:subject:to:cc:in-reply-to:references; s=20190914; bh=RkCCTeiNEEmd7lyaUf3JNamarLi6UPMLlXBGJmDjtB0=; b=JGxV9lAtKwkJ P9GrmZqgo3/L/6tpROxV2DHYvjdSXTZkqtvqTNtivGI5zlDSA/fBFRU6v20+V0Zs gAbZFIG1L+E5mGXsiUakeZOiP3m+zyz+THfvYhcdAMX2eaid9gSkcQarGRWZT5C4 bPvGXQh5GqSCuS5zuveXx41BF4VcuoIgdtYaNCYLuZcOhuWj2SrVxVbpUolEHcgO cP9+CWlE6RLrgDblp4p/e1n83VgZMO6jur3BYZXi6D8JYrXeJb0qcPNOwVlWS/m2 VcNTUIwhGIwHPdMCiXCUnc7JZe2hoFNCyvSNk7/C4sckzUPm5Erk5UJDmBwGCHty OTDEF/o5cQ== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id f29ee94c; Mon, 6 Mar 2023 23:56:08 +0100 (CET) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 8b459ca8; Mon, 6 Mar 2023 23:56:08 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 0e867246 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 6 Mar 2023 23:56:08 +0100 (CET) MIME-Version: 1.0 Date: Mon, 06 Mar 2023 22:56:07 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.16.0a From: "jgart" Message-ID: <6c904311d43b36f146475d8722295270@dismail.de> In-Reply-To: <87zg8p7qvw.fsf_-_@gnu.org> References: <87zg8p7qvw.fsf_-_@gnu.org> <20230123133217.318-1-maxim.cournoyer@gmail.com> <20230123133217.318-2-maxim.cournoyer@gmail.com> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Ludo, > I understand there=E2=80=99s an actual bug to fix ... Is the bug you are referencing exist as an open ticket somewhere on our t= racker?=20 Just=20trying to get more context on that if it does. all best, jgart From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: "jgart" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Mar 2023 00:26: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: "Ludovic =?UTF-8?Q?Court=C3=A8s?=" , "Maxim Cournoyer" Cc: Josselin Poiret , Christopher Baines , Simon Tournier , Mathieu Othacehe , 60847@debbugs.gnu.org, Tobias Geerinckx-Rice , Lars-Dominik Braun , Ricardo Wurmus Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167814871820969 (code B ref 60847); Tue, 07 Mar 2023 00:26:02 +0000 Received: (at 60847) by debbugs.gnu.org; 7 Mar 2023 00:25:18 +0000 Received: from localhost ([127.0.0.1]:43996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZL8o-0005S9-1d for submit@debbugs.gnu.org; Mon, 06 Mar 2023 19:25:18 -0500 Received: from mx1.dismail.de ([78.46.223.134]:16766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZL8l-0005Rs-QD for 60847@debbugs.gnu.org; Mon, 06 Mar 2023 19:25:16 -0500 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 82995766; Tue, 7 Mar 2023 01:25:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h= mime-version:date:content-type:content-transfer-encoding:from :message-id:subject:to:cc:in-reply-to:references; s=20190914; bh=kD7pWTSyRYrqEQWeGk4GkV3z6G6urhRyfquzb8lhJzY=; b=u3TrgRQFwXls P1jce7kLpD7OfGEf8KKlj4M0Pw/yXsiBHSBGJj90hPza7UFnxbegckm1sBHzroD3 4gHYlcpKtyILiG5Lkjbb3ZjjpM5dx034dy122x+NW8VqIXFgL/+lbKGPgfBhlyX1 39miAD0zMnJ93coexwhUJOb4coEgaZj4jgGvAeTFE74LY44xI/T61Qt5UjWAFyhg 0KeUU6E6GbXBvX5q8DroplG0WKA1wqqZRYDSv5YUexDnBnCbUVbsnhI5KbmyvVSX vq4zb71CiOKJMOT+fn2jwovRzBscu0fs/6l0jmNNcwAs8uVDFSS8BVjR8jZw/2LV ogOuxQA8cA== Received: from smtp2.dismail.de ( [10.240.26.12]) by mx1.dismail.de (OpenSMTPD) with ESMTP id d478a0ee; Tue, 7 Mar 2023 01:25:08 +0100 (CET) Received: from smtp2.dismail.de (localhost [127.0.0.1]) by smtp2.dismail.de (OpenSMTPD) with ESMTP id 5006fb86; Tue, 7 Mar 2023 01:25:08 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id 3686229e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 7 Mar 2023 01:25:07 +0100 (CET) MIME-Version: 1.0 Date: Tue, 07 Mar 2023 00:25:06 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: RainLoop/1.16.0a From: "jgart" Message-ID: <69a3a526d296323461478f150bab5325@dismail.de> In-Reply-To: <6c904311d43b36f146475d8722295270@dismail.de> References: <6c904311d43b36f146475d8722295270@dismail.de> <87zg8p7qvw.fsf_-_@gnu.org> <20230123133217.318-1-maxim.cournoyer@gmail.com> <20230123133217.318-2-maxim.cournoyer@gmail.com> X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Is the bug you are referencing exist as an open ticket somewhere on our= tracker? Oooops, Ignore, found it: https://issues.guix.gnu.org/issue/25235 Reread Maxim's original message now ;() From unknown Thu Jun 12 08:43:49 2025 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 14:09: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.167819810317323 (code B ref 60847); Tue, 07 Mar 2023 14:09:01 +0000 Received: (at 60847) by debbugs.gnu.org; 7 Mar 2023 14:08:23 +0000 Received: from localhost ([127.0.0.1]:44901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZXzK-0004VK-P7 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 09:08:23 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:44973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZXzJ-0004V6-9r for 60847@debbugs.gnu.org; Tue, 07 Mar 2023 09:08:21 -0500 Received: by mail-qt1-f172.google.com with SMTP id s12so14313710qtq.11 for <60847@debbugs.gnu.org>; Tue, 07 Mar 2023 06:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678198095; 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=F7B1Vu/MnzcDjQpiyXJQB4JJniF+y8JePazYuuINU1g=; b=Afdmwo2tVqEpqfJ+RQL8bwD6DNc6KKUshFNCo9ny8fRBRyFu8f+Bei609iZ4XJRAEs DG4BCBUBlyy6HHgUnDZg/rs2LrLIPFyCqWC60dln8iYNGNi/vH6JA0ByuB6OL2E4mILd 6XjsV/s8tMnvLPZDwHlnvaBf4P3PQ7VkM4bMHa+8YlnoXrbz98C2IV6eBSPdEfAZq+C4 6roD+J4iF6yEcFC1IYzXzb8NtQU7YiFFqwluSUJKPIQ379cSZFKLUEVTNpZEDJp/teFj it33pLOjlwtI+uLijdLwws15VIie/kEqckj5rYaxFpFlQKHRVQpIno92KNG4yvg9aSz8 Hkyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678198095; 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=F7B1Vu/MnzcDjQpiyXJQB4JJniF+y8JePazYuuINU1g=; b=zTyQp4yRAqWv09UeHxcGm/9tzQtDrtaoSM1XUz1eAW4IAzkHFQGSLAeR0UazcRW01I b608UcIMWVgFdis+LGP2tIz4TrmXnCEJCvpM0exL34d85IhcRQ0lR9PHEcHlT2pSvTt1 p/UsY8zfhvubbWyX51XnA1vwN2eE1fxD9icMwa79d+ibK1QpJlSpATAGNL80oN3ASZeL 55W+N9upUStF7FSWIfUUSGvWviM+EnUGT4hf28hS1wuYY8HIz5LCyh0idur1K5z4afPF wb+NagqQ2f2jEPgGSbjWHigje0qS74Br04sLg8SAXS1YSQZ0ew9CTy0T8WWQdR6knScP sHMw== X-Gm-Message-State: AO0yUKXf7/u9djpYwId2svs7VyM1RmnnAacIiRD1aFv4LKrBaocB9kaT F3mlGR3tkT9y0PJVz6mJj7E= X-Google-Smtp-Source: AK7set/p+GvNL5TWiKfm5tIgo1DBUkP/1ztL6yKOjfByHapa6qcUbhUXij4004ohWrGyexC3P/xnOg== X-Received: by 2002:a05:622a:1650:b0:3bf:c5a3:6143 with SMTP id y16-20020a05622a165000b003bfc5a36143mr25255342qtj.27.1678198095631; Tue, 07 Mar 2023 06:08:15 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id p23-20020a05620a057700b0071f0d0aaef7sm9397235qkp.80.2023.03.07.06.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 06:08:14 -0800 (PST) From: Maxim Cournoyer References: <20230123133217.318-1-maxim.cournoyer@gmail.com> <20230123133217.318-2-maxim.cournoyer@gmail.com> <87zg8p7qvw.fsf_-_@gnu.org> Date: Tue, 07 Mar 2023 09:08:10 -0500 In-Reply-To: <87zg8p7qvw.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 06 Mar 2023 18:04:35 +0100") Message-ID: <87jzzsy7qt.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludo! Ludovic Court=C3=A8s writes: > Hello, > > Maxim Cournoyer skribis: > >> +++ b/guix/packages.scm >> @@ -1864,28 +1864,30 @@ (define* (bag->derivation bag #:optional context) > > [=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 d= ebugging 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 :-). --=20 Thanks, Maxim From unknown Thu Jun 12 08:43:49 2025 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 15:15: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: Maxim Cournoyer Cc: 60847@debbugs.gnu.org Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167820208126456 (code B ref 60847); Tue, 07 Mar 2023 15:15:01 +0000 Received: (at 60847) by debbugs.gnu.org; 7 Mar 2023 15:14:41 +0000 Received: from localhost ([127.0.0.1]:46933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZZ1V-0006se-H1 for submit@debbugs.gnu.org; Tue, 07 Mar 2023 10:14:41 -0500 Received: from mira.cbaines.net ([212.71.252.8]:42348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZZ1T-0006sU-8m for 60847@debbugs.gnu.org; Tue, 07 Mar 2023 10:14:40 -0500 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id EB50716DD4; Tue, 7 Mar 2023 15:14:37 +0000 (GMT) Received: from felis (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id eb1011ff; Tue, 7 Mar 2023 15:14:37 +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> User-agent: mu4e 1.8.13; emacs 28.2 From: Christopher Baines Date: Tue, 07 Mar 2023 15:05:47 +0000 In-reply-to: <87jzzsy7qt.fsf@gmail.com> Message-ID: <87jzzsr3tx.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 contex= t) >> >> [=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? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmQHVNpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xd0JhAAuSbus21DgEoJu/nQUiNKRyTenkCjOrlz Ea6YVd2RXZbtwZJI5dTGHqTa4S50959uDYx+TSAejB3hUMoj5cMm9gdp1/JQ6MdG FWndCf5SI6C53L2GwN9g6Cfx9gfeMLcvlu5+CHR8V/GRxtMRBLuqwVRgB5xCm1Uk n91eKUjv7GNmzLBH5KW7WLxIvG3a0tzegMdHFnrHKTWA5VuRkCv/ebDULjDmUcz1 SnF/j7SWMAJZgbv5EMqG+7+PRhkpas9j42ETLSw0uCbv+0xRguJ514V0sh4UbsD3 i1ZuOeEzFJqoncx1fiWyvGXy3FyL1h2zyeB9mKU1M2Los9OJvQ+8M1Wrh4L/IDK4 RGDRWLTkAzxkztXtQBM053wzCVBAqCpZ62afbvoPsiyCVkvO1qNn8cV54l01bVPQ pK6RPLsQXTPete9f2P1qxAm7i7ynqcq8/+Naz8vxwDf24A1U88PKgyyGq9MqtMZe X9qGF0CdsbBnu8+L24gaNLF0mpEZLyxqgv8SM1wR5jnG0x+jGyht5OiL7JKFrAmX SFC9alYBxAOvJTh/hLcS2DMiQuI6dih3CUVpGPn4Aj1WSQtmnM4opaqevlfREu05 v/l0ptwdR/Gdvv2/3nC/ADGGZeOqXvuRSyrz0isYoyaGI9aoUJmfRs5nz2kPNf0h 1/c33pzron4= =TM8f -----END PGP SIGNATURE----- --=-=-=-- From unknown Thu Jun 12 08:43:49 2025 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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Thu Jun 12 08:43:49 2025 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-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= 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----- --=-=-=-- From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Mar 2023 08:58: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: Maxim Cournoyer 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.167843864831472 (code B ref 60847); Fri, 10 Mar 2023 08:58:01 +0000 Received: (at 60847) by debbugs.gnu.org; 10 Mar 2023 08:57:28 +0000 Received: from localhost ([127.0.0.1]:53672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paYZ6-0008BY-2S for submit@debbugs.gnu.org; Fri, 10 Mar 2023 03:57:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39124) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1paYZ2-0008BK-VV for 60847@debbugs.gnu.org; Fri, 10 Mar 2023 03:57:26 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paYYu-0008AZ-Hp; Fri, 10 Mar 2023 03:57:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=vR30GafK2pSxXf5t6cu8yJnzXmtJNCGgjheUBMxVMEo=; b=D0TAbsCO0lRBGoODyOUY nPYKqss9Dj+th6kgN4jClH3/T5XxyrUvK+dmO20kIb2Gm+OAD+FlUnnM9Dludggxdhd+sTX6WabaU 4ywCQu7F74N87xLyTuLe9bxTBr3G/ncxTRuDTZ26m1dezi61iBXRVug/sRuvKep9dluUEXPbE82pf JGIYy/JPlj/HVJJjFKc04TE2Sp/eXMHs0nm7kw1Te95VBVFwq9GHvna1i1VybYv+i0XxMGS4m4JOE uT54yGs+dxMM/Ur56u7Uo1sUyOOwBD/+pD+1Og8MRCTg+zBnbl3t3JaW2kaGTs3aim687HnRNAY3H fdhYBo1du1i2fw==; Received: from [193.50.110.253] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1paYYt-0004is-3c; Fri, 10 Mar 2023 03:57:16 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230123133217.318-1-maxim.cournoyer@gmail.com> <20230123133217.318-2-maxim.cournoyer@gmail.com> <87zg8p7qvw.fsf_-_@gnu.org> <87jzzsy7qt.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?UTF-8?Q?D=C3=A9cadi?= 20 =?UTF-8?Q?Vent=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Cordeau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 10 Mar 2023 09:57:11 +0100 In-Reply-To: <87jzzsy7qt.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 07 Mar 2023 09:08:10 -0500") Message-ID: <87o7p19e6w.fsf@gnu.org> 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: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 contex= t) >> >> [=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 no= t okay even as a =E2=80=9Ctemporary kludge=E2=80=9D (I=E2=80=99m not against temporary = kludges in general, I=E2=80=99ve done my share of that ;-), but this would be way too brittle.) > 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-upda= tes=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! Perhaps one s= uggestion 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 includes 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 hard to anticipate the impact of such a change wit= hout actually trying. Thanks, Ludo=E2=80=99. From unknown Thu Jun 12 08:43:49 2025 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:14: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: Christopher Baines Cc: 60847@debbugs.gnu.org Received: via spool by 60847-submit@debbugs.gnu.org id=B60847.167845760111283 (code B ref 60847); Fri, 10 Mar 2023 14:14:02 +0000 Received: (at 60847) by debbugs.gnu.org; 10 Mar 2023 14:13:21 +0000 Received: from localhost ([127.0.0.1]:54130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1padUn-0002vu-8h for submit@debbugs.gnu.org; Fri, 10 Mar 2023 09:13:21 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:42512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1padUl-0002ve-QI for 60847@debbugs.gnu.org; Fri, 10 Mar 2023 09:13:20 -0500 Received: by mail-qv1-f50.google.com with SMTP id ne1so3649281qvb.9 for <60847@debbugs.gnu.org>; Fri, 10 Mar 2023 06:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678457594; h=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=jv1DEXKfrqC0RJs672G836Arnhk8t464a7KRZP90oj8=; b=jTu0ntejiVo/kq4dbAjEgU7ol3VsH+Jv8GwaDDNH/SizN+K082jNXo2ebOKXdQgRJ0 QwuRAV4mTihfV4w4YMr/w500eOBq2685Gh31STIsF2nqMzgMbSeRIa4WHMqpPYz25aCR GFy3bYWYUj0le0jTvOwI9vktLcAiEsr/1Ep6q3/DNIDI3i21yqcqUvQvbHFChTDvlIpZ eloQ9AvnlbuxDsywATXMZGatHOyR4dHk8ZjKqBBcaDt1BxQB/ydYqQxMMBGfIkVlXpZK tMHARpVrFuawoR9KoYNkCFWaZfmV4/2kyFY044iT4GikCD60wCmEiLLcnHaCtmV3p6uw McvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678457594; h=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=jv1DEXKfrqC0RJs672G836Arnhk8t464a7KRZP90oj8=; b=78O3TJT/dQG3EbQBEdVHQq7dzJBOzkgKQb9XAgeQnTV2Arne9e0AFsevs3hMpBvcFK 2MjF/+rNscGCClyS1jP/oChXDMVRxY9c9GNfdL9M3k3/4o9axeCFc8FjjyA4ecpuw4xx ixs4/FXJp/bBCNiREn7D+MjH29Mb6BWc2+WYBXxWDFviQ+YLsFeUxNGFPEx8We8SHNTR 87lWgi0gyKOPXmGGwkHr+SKP7urwRRMZJkwgSrqecQfpOrEPiGwIbv+Zc3vyG6j9H4ua Cm7e53D1GVoDAZSF7IXv9yvhyxUF6R9+hUne10lLPt/0Os3RCeNdUKJqVmn5nAuU3ztv H5vg== X-Gm-Message-State: AO0yUKXfnEPMEWghOLEn37HXIExa52BCEPCgBlI/0IA+TiYCBQVLDfMP UnPW+NnJw1CPJDAVWcnBacAJjhRnsEeFmA== X-Google-Smtp-Source: AK7set8S9AVk33sHhI2LCilj+y+SvYNirjzwWUsh08FTXeA/dXN2+Qac7qQsJ2BmMOJBa54C5hsriA== X-Received: by 2002:a05:6214:ca8:b0:56e:c238:b719 with SMTP id s8-20020a0562140ca800b0056ec238b719mr47681018qvs.2.1678457593928; Fri, 10 Mar 2023 06:13:13 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id a10-20020ae9e80a000000b00742743dba2asm1409828qkg.39.2023.03.10.06.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:13:13 -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> <87a60owfi8.fsf@gmail.com> <87fsagqr67.fsf@cbaines.net> Date: Fri, 10 Mar 2023 09:13:12 -0500 In-Reply-To: <87fsagqr67.fsf@cbaines.net> (Christopher Baines's message of "Tue, 07 Mar 2023 19:26:47 +0000") Message-ID: <87zg8kr8xz.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello Christopher, Christopher Baines writes: [...] >> 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. I'll see if I have a good enough understanding of the code to make sense of your suggestion. I'll definitely try it! Thanks for suggesting. -- Thanks, Maxim From unknown Thu Jun 12 08:43:49 2025 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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Thu Jun 12 08:43:49 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#60847] [PATCH] Enable cross-compilation for the pyproject-build-system. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 Mar 2023 17:01: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: 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.16784676499394 (code B ref 60847); Fri, 10 Mar 2023 17:01:02 +0000 Received: (at 60847) by debbugs.gnu.org; 10 Mar 2023 17:00:49 +0000 Received: from localhost ([127.0.0.1]:55687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pag6q-0002RP-Jp for submit@debbugs.gnu.org; Fri, 10 Mar 2023 12:00:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pag6o-0002R6-61 for 60847@debbugs.gnu.org; Fri, 10 Mar 2023 12:00:46 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pag6g-0005zi-FI; Fri, 10 Mar 2023 12:00:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=kh6oOur036BbVM/4BN2ldIH/yNRDFvK/9MUNZDOG09k=; b=a8WJwUNIzprnti/lhiUr Hwj6fK6QWhaC0M7wqWFjW0gX3nnbuMK0zG7Vla3Jum4C+jz/On9s4F9yI6VKVw4f7JCtOojBxlY9J 7v0mOFthMTl+Ca6vanUFN4AmA5+bllMELylrvQ5TM9rmk7cm/BdVoVrIsajlkMyUaWtWLEanpKh+C +LAp01Zs8puuSOqOpPUeoDub8mSJAvpK5OIT3QcZP0bo1SSHebc6fgJ+1aR+Z7FweyFY6ZuHeoSl+ M694Xslduhh5hgzznoDW5iE2s3HVwbVWO+cX2YWLln3WLIkeT+C8+BwGnICZdSjzL1TpGdleLYDng nhTWRvnkJII+vg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pag6f-0000pl-CB; Fri, 10 Mar 2023 12:00:37 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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> <87v8j8r8jt.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?UTF-8?Q?D=C3=A9cadi?= 20 =?UTF-8?Q?Vent=C3=B4se?= an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Cordeau X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 10 Mar 2023 18:00:33 +0100 In-Reply-To: <87v8j8r8jt.fsf@gmail.com> (Maxim Cournoyer's message of "Fri, 10 Mar 2023 09:21:42 -0500") Message-ID: <87a60kh77y.fsf@gnu.org> 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: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Maxim, Maxim Cournoyer skribis: [...] >>>>> + (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 >> >> 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 tempora= ry kludges in general, >> I=E2=80=99ve done my share of that ;-), but this would be way too brittl= e.) > > "way too brittle" is a strong warning :-). It is; I=E2=80=99m objecting to this change. > I don't understand what is > so brittle about it? It's not like we change the build system names > often. I have little to add to what I wrote above: procedure names don=E2=80=99t m= ean anything, especially with higher-order functions, and separation of concerns is an important design principle. I=E2=80=99m speaking with 15+ years of experience with Guile; I don=E2=80= =99t mind being challenged, it=E2=80=99s healthy, but I think we also need to recognize the expertise of each other and encounter each other halfway. [...] >> 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 in= cludes >> 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 ha= rd 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. Yes, I agree it=E2=80=99s more work, but it=E2=80=99s dissimilar in that yo= u=E2=80=99ll be confronted with tons of weird cases, some of which we can already anticipate, but probably others we=E2=80=99ll probably be surprised to disc= over. > 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). I do hope it=E2=80=99ll be this simple, but I just can=E2=80=99t tell. Thank you, Ludo=E2=80=99. From unknown Thu Jun 12 08:43:49 2025 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: Sun, 12 Mar 2023 04:06: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.16785939257525 (code B ref 60847); Sun, 12 Mar 2023 04:06:01 +0000 Received: (at 60847) by debbugs.gnu.org; 12 Mar 2023 04:05:25 +0000 Received: from localhost ([127.0.0.1]:58898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbCxZ-0001xJ-BE for submit@debbugs.gnu.org; Sat, 11 Mar 2023 23:05:25 -0500 Received: from mail-qt1-f177.google.com ([209.85.160.177]:33731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbCxX-0001x3-66 for 60847@debbugs.gnu.org; Sat, 11 Mar 2023 23:05:23 -0500 Received: by mail-qt1-f177.google.com with SMTP id z6so10159861qtv.0 for <60847@debbugs.gnu.org>; Sat, 11 Mar 2023 20:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678593917; 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=wapCJ+4WPMr3+oPYy9bGOlrHJkyHEl2M5LQvhGbBI5o=; b=fEeQWMP9HIrZ4IqJGN2KMlzvTos3J1m+mWaEidZMwVPTXgUyJ3N9dMLhr3hC7W1n7R 51C4X7kt90e6+UD6E4ZQOi3Uf1RmVB5ddT3yNvSi7QGx53R9UkcaJ3nMgGeHCrJ2yW0S wyAUZCG+aNx2rrrSWz55SOdI7EXDTKZDSgemFSPfD7SH9YfMeXD37dEjwPFF2IVKXYlX 8Ziyqqb2xE4Cvh0rsl1VfBdjI2mDL4liKmHeetPanvATdxF+VGKGuYK/tqPIlvcmtb+B XFuhr5m2mvM2PozX4kqZ1Sq2PrxEsnK0y4ysZZmJ1IML1E84P8BT3PfuDPM9U7Tf++tD L9Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678593917; 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=wapCJ+4WPMr3+oPYy9bGOlrHJkyHEl2M5LQvhGbBI5o=; b=OIlWPZeMr/e+rvsaUDPgHrgDpm3l/ztPsv9KVuqBGFAMVbwy9qC5miUdFfUieeK1a2 FKVFrJBT8fA1DTkzjj6EJakwoNXM+cZjC6bMoJF/TY4gzjZGbOeQ5OQWasyq3pZ1cejW chmfcVFgXq7rXhE8Iie+AwlbqOI7ACnggc6kj36+/9gegcmlYWEGS06+Ioodot+dSU8g EUt3oPq/1aRIXqfwSZjf6e5IPVkwR4W5jnGe1JiB+YSW01X1jun3ACrsRO5n0dsVJFj5 t1f5KyPM8WDJArA13V6bdMdV1JaFx8ueoyKG07KtCfI/xP7KCbsaLuhteS6oZZUwZQjW tkbg== X-Gm-Message-State: AO0yUKXxFl0YPEH/IlvrWxbYhN1P1WS3ODhV33sg9/sYWB0R9KvhzcAe GkSYFssj1/XO6IBOV+n04oo= X-Google-Smtp-Source: AK7set/559ZJOYj3gqopvG0JnLR5yC8vwFFuqR89Tp4D6KC6//jeqVJQpes7bLzLf4VFqncP/xT4PQ== X-Received: by 2002:a05:622a:50e:b0:3bf:c9d1:4276 with SMTP id l14-20020a05622a050e00b003bfc9d14276mr17188503qtx.5.1678593917671; Sat, 11 Mar 2023 20:05:17 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id y5-20020ac87045000000b003b2957fb45bsm3038341qtm.8.2023.03.11.20.05.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Mar 2023 20:05:17 -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> <87v8j8r8jt.fsf@gmail.com> <87a60kh77y.fsf@gnu.org> Date: Sat, 11 Mar 2023 23:05:15 -0500 In-Reply-To: <87a60kh77y.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 10 Mar 2023 18:00:33 +0100") Message-ID: <87pm9epqbo.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > > [...] > >>>>>> + (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 f= ix 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 unt= il >>> >>> To make sure there=E2=80=99s no misunderstanding, I think that=E2=80=99= s not okay even >>> as a =E2=80=9Ctemporary kludge=E2=80=9D (I=E2=80=99m not against tempor= ary kludges in general, >>> I=E2=80=99ve done my share of that ;-), but this would be way too britt= le.) >> >> "way too brittle" is a strong warning :-). > > It is; I=E2=80=99m objecting to this change. OK. >> I don't understand what is >> so brittle about it? It's not like we change the build system names >> often. > > I have little to add to what I wrote above: procedure names don=E2=80=99t= mean > anything, especially with higher-order functions, and separation of > concerns is an important design principle. > > I=E2=80=99m speaking with 15+ years of experience with Guile; I don=E2=80= =99t mind being > challenged, it=E2=80=99s healthy, but I think we also need to recognize t= he > expertise of each other and encounter each other halfway. When I don't understand something, I ask for an explanation. I'm happy (and greatly value) that my correspondent has 15 years of experience with Guile, but I'll still ask if something is unclear. I hope you don't mind. > [...] > >>> 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 i= ncludes >>> 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 h= ard 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. > > Yes, I agree it=E2=80=99s more work, but it=E2=80=99s dissimilar in that = you=E2=80=99ll be > confronted with tons of weird cases, some of which we can already > anticipate, but probably others we=E2=80=99ll probably be surprised to di= scover. OK. I'll put this to the test, when I'm done with the current Ruby rabbit-hole I've been pursuing. Thanks for the feedback! --=20 Thanks, Maxim From unknown Thu Jun 12 08:43:49 2025 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: Sun, 12 Mar 2023 04:06: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: 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.16785939407553 (code B ref 60847); Sun, 12 Mar 2023 04:06:02 +0000 Received: (at 60847) by debbugs.gnu.org; 12 Mar 2023 04:05:40 +0000 Received: from localhost ([127.0.0.1]:58902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbCxn-0001xk-Rd for submit@debbugs.gnu.org; Sat, 11 Mar 2023 23:05:40 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:39587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbCxl-0001xX-FA for 60847@debbugs.gnu.org; Sat, 11 Mar 2023 23:05:38 -0500 Received: by mail-qt1-f181.google.com with SMTP id w23so10083618qtn.6 for <60847@debbugs.gnu.org>; Sat, 11 Mar 2023 20:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678593932; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wapCJ+4WPMr3+oPYy9bGOlrHJkyHEl2M5LQvhGbBI5o=; b=LAfLjLO2Utr4NfGOGQOic6i0cUhVW8ZhJk9IGUznCVMBlYGAT6X0qPdJ7jm4yYad1R 96lwS8aJoxU7RbWm4LWTg6UiZipSMh5iNra1Hmh7+xh3CCwpFDvGg4fq0IGfVUSqHdGn ku8O8X8j7dwCrgkA8G5OtBu3I9qXTeX8CbAA88yPOY6zz9zbGgQxu5dSG+QcfOJOSoyW rAuDw++D5PYYMuumjMOLtvwAZj2vzd3VKFxhM9ysPdN4vBCqc/qOIWC8GuOZ/mMwXXwp apwqOsVpjqSAEjugp7nBpS4/6ekj6Iv/eFQUaS8ycQbKvVqxCKawalA/lt/qGRsy6ErH 7HIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678593932; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wapCJ+4WPMr3+oPYy9bGOlrHJkyHEl2M5LQvhGbBI5o=; b=bEFpMw1/kGlLCR8uBq8BeTZPMQDSghS7EeSSO8nyZjJWrCwA6szy7Bvg+g40DsJHji JdN71NFq5OYeekg7Uc4CNLXpN4RWE65g4O+aKeQC548LPTZSdgPXqIJ40UK5WiDRoe6v 06g1AFHLuV6Aw1EKygXk7I93tOKZWuNn706QoUduSuxPnFWtEnXkFh/vDA18PKxCSLXp IFr4QjVfSPSD5qodK8i3RIJjuNw/cWTfaQC2CcAvHDZsRnzEkMLXgFAHFRaYSxL4bzP2 FO0o/azi6eXKGsuHn5d2/F4C7sjLrcS3yz8fw7o8FTJbcWgiYOHw5SH2UWv6hhKadJgt MCiA== X-Gm-Message-State: AO0yUKW96ISdaBh0o1eOefK2w3gXGHJs+dH04RpHK+kDkppXVjEMmcpl 6y8uDPeDGo6PonAkzvTbMlA= X-Google-Smtp-Source: AK7set/+lFx7S9Xfct1ZAxEPH3PawBZ21peIvCtE82GMHp47ITVQYHAl1SLr3t6GKJBrnfiHzsGUKQ== X-Received: by 2002:ac8:7d86:0:b0:3bf:d993:f3aa with SMTP id c6-20020ac87d86000000b003bfd993f3aamr16773360qtd.35.1678593932041; Sat, 11 Mar 2023 20:05:32 -0800 (PST) Received: from hurd ([2607:fad8:4:3::1000]) by smtp.gmail.com with ESMTPSA id g11-20020ac8580b000000b003b86b99690fsm3012957qtg.62.2023.03.11.20.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Mar 2023 20:05:31 -0800 (PST) From: Maxim Cournoyer In-Reply-To: <87a60kh77y.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 10 Mar 2023 18:00:33 +0100") 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> <87v8j8r8jt.fsf@gmail.com> <87a60kh77y.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Date: Sat, 11 Mar 2023 23:05:30 -0500 Message-ID: <87o7oypqb9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > > [...] > >>>>>> + (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 f= ix 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 unt= il >>> >>> To make sure there=E2=80=99s no misunderstanding, I think that=E2=80=99= s not okay even >>> as a =E2=80=9Ctemporary kludge=E2=80=9D (I=E2=80=99m not against tempor= ary kludges in general, >>> I=E2=80=99ve done my share of that ;-), but this would be way too britt= le.) >> >> "way too brittle" is a strong warning :-). > > It is; I=E2=80=99m objecting to this change. OK. >> I don't understand what is >> so brittle about it? It's not like we change the build system names >> often. > > I have little to add to what I wrote above: procedure names don=E2=80=99t= mean > anything, especially with higher-order functions, and separation of > concerns is an important design principle. > > I=E2=80=99m speaking with 15+ years of experience with Guile; I don=E2=80= =99t mind being > challenged, it=E2=80=99s healthy, but I think we also need to recognize t= he > expertise of each other and encounter each other halfway. When I don't understand something, I ask for an explanation. I'm happy (and greatly value) that my correspondent has 15 years of experience with Guile, but I'll still ask if something is unclear. I hope you don't mind. > [...] > >>> 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 i= ncludes >>> 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 h= ard 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. > > Yes, I agree it=E2=80=99s more work, but it=E2=80=99s dissimilar in that = you=E2=80=99ll be > confronted with tons of weird cases, some of which we can already > anticipate, but probably others we=E2=80=99ll probably be surprised to di= scover. OK. I'll put this to the test, when I'm done with the current Ruby rabbit-hole I've been pursuing. Thanks for the feedback! --=20 Thanks, Maxim