[core-updates] python-boot0 fails to build on armhf and aarch64

  • Done
  • quality assurance status badge
Details
2 participants
  • Marius Bakke
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Marius Bakke
Severity
normal
M
M
Marius Bakke wrote on 6 Jul 2019 01:44
(address . bug-guix@gnu.org)
87o928qc5p.fsf@devup.no
On the core-updates branch, since commit
5f3f70391809f8791c55c05bd1646bc58508fa2c, bootstrapping fails early for
armhf-linux and aarch64 when trying to build pkg-config (for
python-boot0). That can be easily worked around with this patch:
Toggle diff (12 lines)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d28296449d..183536d0b4 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1866,6 +1866,7 @@ the bootstrap environment."
(inherit python-minimal)
(inputs
`(("expat" ,expat-sans-tests))) ;remove OpenSSL, zlib, etc.
+ (native-inputs '()) ;and pkg-config
(arguments
(substitute-keyword-arguments (package-arguments
python-minimal)
But then Python fails at the configure stage because pthreads is not
working with the bootstrap compiler on those platforms.

I'm not sure what to do about it. I tried using 'python-on-guile' with
this patch:
Toggle diff (37 lines)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index f26145cb0b..747ec7c594 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -816,6 +816,33 @@ with the Linux kernel.")
(license lgpl2.0+)
(home-page "https://www.gnu.org/software/libc/")))
+(define-public glibc-sans-python
+ (package
+ (inherit glibc)
+ (name "glibc-with-guile-python")
+ (arguments
+ (substitute-keyword-arguments (package-arguments glibc)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'unpack 'patch-configure
+ (lambda _
+ ;; Relax Python version check.
+ (substitute* "configure"
+ (("\\$critic_missing python") "")
+ (("\\$PYTHON_PROG -B") "$PYTHON_PROG"))
+ #t))))))
+ (native-inputs `(("texinfo" ,texinfo)
+ ("perl" ,perl)
+ ("bison" ,bison)
+ ("gettext" ,gettext-minimal)
+ ("python" ,(@ (gnu packages guile-xyz) python-on-guile))
+ ,@(if (hurd-target?)
+ `(("mig" ,mig)
+ ("perl" ,perl))
+ '())))))
+
+
+
;; Below are old libc versions, which we use mostly to build locale data in
;; the old format (which the new libc cannot cope with.)
But the interpreter fails with 'unbound variable: this' upon running
glibcs Python scripts.

Until python-on-guile is complete enough to run the glibc scripts, I
think we'll have to insert an older version of glibc into the
bootstrap graph, so that Python can be built with pthreads on all
platforms. WDYT?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0f4PIACgkQoqBt8qM6
VPrQiAgAtmQWj7WTCaVlq3RMvzN9QBquRfmGwi+G79uO5fctTwQOB0Z8WpLDsqRB
TA035flOWuSnKSxaIJ/VKhiF+4mPU5Rl/iR8R+hVyQTq8KgGEPWhpN0Ha7t2YKKM
omo6FXD3xJr0Di6i5ZnNa9UVsaIYEkAlz4/DtZfOjEjCiBzb2VPsupDTwzm5G72C
EHyftm+nhGN+HxLJAM3FdtcbmBChrotM+ZiJPetEV+Yi4hjmoX+iD7qbFE3Mo0zi
/6otDB3DHPMMzu/fHKr7E/LtRzdkGAz2Afp6j2dCZH86qbU0mhJUaBoxNA7KmqSP
UarteivPcJpLv0wDIjHLtV3lGC5SKQ==
=1PGz
-----END PGP SIGNATURE-----

R
R
Ricardo Wurmus wrote on 6 Jul 2019 11:35
(address . mbakke@fastmail.com)(address . 36518@debbugs.gnu.org)
871rz3sdxe.fsf@elephly.net
Hi Marius,

Toggle quote (3 lines)
> But the interpreter fails with 'unbound variable: this' upon running
> glibcs Python scripts.

This means it fell through to the case where “python” is called with
more than one argument:

Toggle snippet (21 lines)
(define* (main #:optional (args (command-line)))
(match args
((_ file)
(let ((compiled (string-append file ".go")))
(compile-file file
#:from python
#:output-file compiled)
(load-compiled compiled)))
((_)
(repl-default-option-set! 'prompt ">>> ")
(set! (@@ (system repl common) repl-welcome)
(const (display "\
Python on Guile, version 0.1.0
(Hit Ctrl-D to exit.)
")))
(start-repl python)
#t)
(_ (format (current-error-port)
"usage: ~a file.py~%" this))))

“this” was supposed to be the first match, i.e. the “python” executable
itself. Anyway, the problem is that “python” doesn’t handle any flags
at all. I’ll implement option “handling” soon (maybe we can ignore most
options to “python”).

--
Ricardo
M
M
Marius Bakke wrote on 7 Jul 2019 16:42
(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 36518-done@debbugs.gnu.org)
87d0ilrjms.fsf@devup.no
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (35 lines)
> Hi Marius,
>
>> But the interpreter fails with 'unbound variable: this' upon running
>> glibcs Python scripts.
>
> This means it fell through to the case where “python” is called with
> more than one argument:
>
> --8<---------------cut here---------------start------------->8---
> (define* (main #:optional (args (command-line)))
> (match args
> ((_ file)
> (let ((compiled (string-append file ".go")))
> (compile-file file
> #:from python
> #:output-file compiled)
> (load-compiled compiled)))
> ((_)
> (repl-default-option-set! 'prompt ">>> ")
> (set! (@@ (system repl common) repl-welcome)
> (const (display "\
> Python on Guile, version 0.1.0
> (Hit Ctrl-D to exit.)
> ")))
> (start-repl python)
> #t)
> (_ (format (current-error-port)
> "usage: ~a file.py~%" this))))
> --8<---------------cut here---------------end--------------->8---
>
> “this” was supposed to be the first match, i.e. the “python” executable
> itself. Anyway, the problem is that “python” doesn’t handle any flags
> at all. I’ll implement option “handling” soon (maybe we can ignore most
> options to “python”).

I pushed a workaround in 4f5fe46388eb70055b6935df053f74b7ccdaf55f, which
uses an older version of Python that can be built without threads.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0iBNwACgkQoqBt8qM6
VPpAHQgArziLhu0Wg4IkB+M4KuF2c244g592zr0Oz0T6CvKoaC+2L65AvRdOD07O
TnyXiXvCPubSLtfjRvfCuOJC1n/BpAmuE7mbX/zTmQPTDhsk08qZj9Qldj9juwj4
iTijyu9bE206iVIX4CIu4OjUObfWkn6phJuT/xv4UVqZsXeLImi3AO4z1bzEtZ3E
eQx+MdWNwd2cI6YVRtNl5JokJ8VNu7CWcNVneEDeWH79jBbyj4qKkLIeiZNiPsrJ
N78m0CGKALGdX/RYNTSBdiVs3jZidkuSopdHIABB7VzlL3Sv6vB8VBQI3vpGH8tk
TS/A8BrG9Jkg3zXEojLsiMAhfADcKA==
=D5eX
-----END PGP SIGNATURE-----

Closed
?