Subject: bug#77947: closed (Re: [PATCH] gnu: [email-masked]: Support cross-compilation.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 21 Apr 2025 22:18:04 +0000

Your bug report

#77947: [PATCH] gnu: [email-masked]: 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 [email-masked].

-- 
77947: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77947
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH] gnu: [email-masked]: Support cross-compilation.
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Sharlatan Hellseher <[email-masked]>, 77947 <[email-masked]>
Date: Tue, 22 Apr 2025 00:16:59 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

[email-masked] writes:

> Apr 21, 2025, 14:46 by [email-masked]:
>
>>
>> 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: [email-masked]: Skip more tests on GNU/Hurd.
  49d9dca64f gnu: [email-masked]: Support cross-compilation.

Thanks,
Ludo’.

Subject: [PATCH] gnu: [email-masked]: Support cross-compilation.
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: Ludovic Courtès <[email-masked]>
Date: Sun, 20 Apr 2025 23:33:49 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* 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 [email-masked], 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 <[email-masked]>
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021, 2023 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2013-2018, 2021, 2023, 2025 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <[email-masked]>
 ;;; Copyright © 2014, 2015 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2014, 2017, 2019 Eric Bavier <[email-masked]>
@@ -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