GNU bug report logs - #77947
[PATCH] gnu: python@3.11: Support cross-compilation.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sun, 20 Apr 2025 21:35:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Subject: bug#77947: closed (Re: [PATCH] gnu: python <at> 3.11: Support
 cross-compilation.)
Date: Mon, 21 Apr 2025 22:18:04 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#77947: [PATCH] gnu: python <at> 3.11: Support cross-compilation.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 77947 <at> debbugs.gnu.org.

-- 
77947: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77947
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: yelninei <at> tutamail.com
Cc: Sharlatan Hellseher <sharlatanus <at> gmail.com>,
 77947 <77947-done <at> debbugs.gnu.org>
Subject: Re: [PATCH] gnu: python <at> 3.11: Support cross-compilation.
Date: Tue, 22 Apr 2025 00:16:59 +0200
Hi,

yelninei <at> tutamail.com writes:

> Apr 21, 2025, 14:46 by sharlatanus <at> gmail.com:
>
>>
>> Hi Ludovic,
>>
>> I have no strong opinion here, patch looks clear and reasonable if it
>> fixes cross-compilation.
>>
>> There is other one 77957, fixing tests on GNU/Hurd which we may consider
>> to merge together to prevent double re-build the world event ;-) which I
>> guess we can't escape.
>>
>>
> From what I can see both should not cause rebuilds for the regular python.
> The cross compilation fix is behind a ,@(if (%current-target-system)
> ...) and my test skips are only for ,@(if (system-hurd?) ...) so only
> the python on hurd and a cross compiled python should change (which
> currently dont build)
>
> I checked that the x86-linux python is the same before sending my patch.

Yes, it’s all fine.  Pushed both!

  5f1ee7ba73 gnu: python <at> 3.11: Skip more tests on GNU/Hurd.
  49d9dca64f gnu: python <at> 3.11: Support cross-compilation.

Thanks,
Ludo’.

[Message part 3 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH] gnu: python <at> 3.11: Support cross-compilation.
Date: Sun, 20 Apr 2025 23:33:49 +0200
* gnu/packages/python.scm (python-3.11)[arguments]: Pass
‘--with-build-python’ when cross-compiling.

Change-Id: Ibb210cc599ff06c5da7e73f706488488c84f5cba
---
 gnu/packages/python.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Hello Python team,

This fixes cross-compilation of python <at> 3.11, adding the ‘--with-build-python’
flag, which apparently wasn’t needed for 3.10.

I found this while attempting to build a childhurd as part of my system
config.

Thoughts?

Ludo’.

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index ebc9712294..0f2b0891aa 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Nikita Karetnikov <nikita <at> karetnikov.org>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021, 2023 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2013-2018, 2021, 2023, 2025 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2014, 2017, 2019 Eric Bavier <bavier <at> member.fsf.org>
@@ -728,9 +728,12 @@ (define-public python-3.11
               ;; Disable runtime check failing if cross-compiling, see:
               ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
               #$@(if (%current-target-system)
-                     '("ac_cv_buggy_getaddrinfo=no"
-                       "ac_cv_file__dev_ptmx=no"
-                       "ac_cv_file__dev_ptc=no")
+                     #~("ac_cv_buggy_getaddrinfo=no"
+                        "ac_cv_file__dev_ptmx=no"
+                        "ac_cv_file__dev_ptc=no"
+                        (string-append "--with-build-python="
+                                       #+(this-package-native-input "python")
+                                       "/bin/python3"))
                      '())
               ;; -fno-semantic-interposition reinstates some
               ;; optimizations by gcc leading to around 15% speedup.

base-commit: ba53ff9cc403c7f0388e2dc932cb46e665e81be7
-- 
2.49.0




This bug report was last modified 32 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.