unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3.
@ 2022-04-12  2:55 Paul A. Patience
  2022-04-12 12:07 ` bug#54876: " Guillaume Le Vaillant
  2022-04-12 12:46 ` [bug#54876] " Maxime Devos
  0 siblings, 2 replies; 5+ messages in thread
From: Paul A. Patience @ 2022-04-12  2:55 UTC (permalink / raw)
  To: 54876; +Cc: Paul A. Patience

* 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(+)

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






^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#54876: [PATCH] gnu: sbcl-py4cl: Fix path to python3.
  2022-04-12  2:55 [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3 Paul A. Patience
@ 2022-04-12 12:07 ` Guillaume Le Vaillant
  2022-04-12 12:46 ` [bug#54876] " Maxime Devos
  1 sibling, 0 replies; 5+ messages in thread
From: Guillaume Le Vaillant @ 2022-04-12 12:07 UTC (permalink / raw)
  To: Paul A. Patience; +Cc: 54876-done

[-- Attachment #1: Type: text/plain, Size: 66 bytes --]

Patch pushed as 917c25b3ba0575c6c6e44f8af0d1365bb2378220.
Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3.
  2022-04-12  2:55 [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3 Paul A. Patience
  2022-04-12 12:07 ` bug#54876: " Guillaume Le Vaillant
@ 2022-04-12 12:46 ` Maxime Devos
  2022-04-12 13:15   ` Guillaume Le Vaillant
  2022-04-12 13:36   ` Paul A. Patience
  1 sibling, 2 replies; 5+ messages in thread
From: Maxime Devos @ 2022-04-12 12:46 UTC (permalink / raw)
  To: Paul A. Patience, 54876

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3.
  2022-04-12 12:46 ` [bug#54876] " Maxime Devos
@ 2022-04-12 13:15   ` Guillaume Le Vaillant
  2022-04-12 13:36   ` Paul A. Patience
  1 sibling, 0 replies; 5+ messages in thread
From: Guillaume Le Vaillant @ 2022-04-12 13:15 UTC (permalink / raw)
  To: Maxime Devos; +Cc: Paul A. Patience, 54876

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

Maxime Devos <maximedevos@telenet.be> skribis:

> 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.

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3.
  2022-04-12 12:46 ` [bug#54876] " Maxime Devos
  2022-04-12 13:15   ` Guillaume Le Vaillant
@ 2022-04-12 13:36   ` Paul A. Patience
  1 sibling, 0 replies; 5+ messages in thread
From: Paul A. Patience @ 2022-04-12 13:36 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 54876

Hello,

On 2022-04-12 08:46:23-04:00, Maxime Devos wrote:
> 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-12 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12  2:55 [bug#54876] [PATCH] gnu: sbcl-py4cl: Fix path to python3 Paul A. Patience
2022-04-12 12:07 ` bug#54876: " Guillaume Le Vaillant
2022-04-12 12:46 ` [bug#54876] " Maxime Devos
2022-04-12 13:15   ` Guillaume Le Vaillant
2022-04-12 13:36   ` Paul A. Patience

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).