[PATCH] gnu: sbcl-py4cl: Fix path to python3.

DoneSubmitted by Paul A. Patience.
Details
3 participants
  • Guillaume Le Vaillant
  • Maxime Devos
  • Paul A. Patience
Owner
unassigned
Severity
normal
P
P
Paul A. Patience wrote on 12 Apr 04:55 +0200
(address . guix-patches@gnu.org)(name . Paul A. Patience)(address . paul@apatience.com)
20220412025518.5253-1-paul@apatience.com
* gnu/packages/lisp-xyz.scm (sbcl-py4cl)[arguments]: Add the
'fix-python3-path phase which sets py4cl:*python-command* to the
absolute path to python3.
---
gnu/packages/lisp-xyz.scm | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (17 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 358bba4e89..10a46d4b9a 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -5180,6 +5180,12 @@ (define-public sbcl-py4cl
       (arguments
        '(#:phases
          (modify-phases %standard-phases
+           (add-after 'unpack 'fix-python3-path
+             (lambda _
+               (substitute* "src/callpython.lisp"
+                 (("\\*python-command\\* \"python\"")
+                  (string-append "*python-command* "
+                                 "\"" (which "python3") "\"")))))
            (add-after 'unpack 'replace-*base-directory*-var
              (lambda* (#:key outputs #:allow-other-keys)
                ;; In the ASD, the author makes an attempt to
--
2.35.1
G
G
Guillaume Le Vaillant wrote on 12 Apr 14:07 +0200
(name . Paul A. Patience)(address . paul@apatience.com)(address . 54876-done@debbugs.gnu.org)
87bkx6wll3.fsf@kitej
Patch pushed as 917c25b3ba0575c6c6e44f8af0d1365bb2378220.
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYlVruA8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j/MtQEAmoNbSwCmsbSfljV5BCweW1rWu57BAdzXBZPv
3lvFA48BAJm9kMpo5Nj/khpwS4Fpo3MYG0vN4xXoMwt1CzRufRvr
=IKwn
-----END PGP SIGNATURE-----

Closed
M
M
Maxime Devos wrote on 12 Apr 14:46 +0200
1a38e6e61473683ff134dd477042b061ff605ac0.camel@telenet.be
Paul A. Patience schreef op di 12-04-2022 om 02:55 [+0000]:
+               (substitute* "src/callpython.lisp"
+                 (("\\*python-command\\* \"python\"")
+                  (string-append "*python-command* "
+                                 "\"" (which "python3") "\"")))))

This is most likely incorrect when cross-compiling. Do

(lambda* (#:key inputs #:allow-other-keys)
[...]
(string-append [...] (search-input-file inputs "bin/python3") [...]) [...])

instead, such that it looks in 'inputs' instead of 'native-inputs'.


Also, now that 'python3' is patched in, is the following still relevant:

(propagated-inputs
;; This package doesn't do anything without python available
(list python

(I mean, does it still need to be propagated?)

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYlV0nxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7lrsAQCSIrc0rf3rGxilY4dBXULcB9oL
uiPXhLwfZhAcZkkK5QEAzsEXjzpD1Ql9heYeVSGoBjKzBi9HEPFFVoLqMdZiIg8=
=T0Ym
-----END PGP SIGNATURE-----


G
G
Guillaume Le Vaillant wrote on 12 Apr 15:15 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)
8735iiwi3m.fsf@kitej
Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (14 lines)
> Paul A. Patience schreef op di 12-04-2022 om 02:55 [+0000]:
> +               (substitute* "src/callpython.lisp"
> +                 (("\\*python-command\\* \"python\"")
> +                  (string-append "*python-command* "
> +                                 "\"" (which "python3") "\"")))))
>
> This is most likely incorrect when cross-compiling. Do
>
> (lambda* (#:key inputs #:allow-other-keys)
> [...]
> (string-append [...] (search-input-file inputs "bin/python3") [...]) [...])
>
> instead, such that it looks in 'inputs' instead of 'native-inputs'.

The two are equivalent because so far asdf-build-system doesn't support
cross builds using "--target=TRIPLET". But using 'search-input-file'
looks better.

Toggle quote (8 lines)
> Also, now that 'python3' is patched in, is the following still relevant:
>
> (propagated-inputs
> ;; This package doesn't do anything without python available
> (list python
>
> (I mean, does it still need to be propagated?)

Indeed, having python3 in 'inputs' should be enough now.

Pushed in 59377f88ed1e31d38b34279f393949bf17e505ad.
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYlV9XQ8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j9o9AD/TV67K6CJ4VADd1iTA1IczbtXZ76mm8ZbNXQg
OKDZeJ8A/jL/iONZREwYkE3zX3SLYYVfiyIz6h6CFJFC/ulTlqme
=k/Gl
-----END PGP SIGNATURE-----

P
P
Paul A. Patience wrote on 12 Apr 15:36 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 54876@debbugs.gnu.org)
87lewah1gp.fsf@apatience.com
Hello,

On 2022-04-12 08:46:23-04:00, Maxime Devos wrote:
Toggle quote (17 lines)
> This is most likely incorrect when cross-compiling. Do
>
> (lambda* (#:key inputs #:allow-other-keys)
> [...]
> (string-append [...] (search-input-file inputs "bin/python3") [...]) [...])
>
> instead, such that it looks in 'inputs' instead of 'native-inputs'.
>
>
> Also, now that 'python3' is patched in, is the following still relevant:
>
> (propagated-inputs
> ;; This package doesn't do anything without python available
> (list python
>
> (I mean, does it still need to be propagated?)

So you're suggesting we call search-input-file and move the python
dependency to inputs rather than propagated-inputs?
Right, since the correct path to python3 is now hardcoded, it doesn't
need to be propagated.

One other thing we could do is move python-numpy to native-inputs.
It's required only for the tests and multidimensional array support, but
py4cl.py looks up python-numpy at runtime for the latter, and gracefully
handles the situation when it is not found.
A user could opt-in to the multidimensional array support by explicitly
installing python-numpy.
However, I'm not familiar with how Guix deals with Python module paths.
Would the python3 in sbcl-py4cl's inputs be able to find python-numpy if
only sbcl-py4cl and python-numpy are explicitly installed by the user?

Best regards,
Paul
?
Your comment

This issue is archived.

To comment on this conversation send email to 54876@debbugs.gnu.org