all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#73304: Python in relocatable guix pack leads to wrong sys.path
@ 2024-09-16 19:23 Rutherther via Bug reports for GNU Guix
  2024-09-16 19:28 ` Rutherther via Bug reports for GNU Guix
  2024-09-30 21:08 ` Ludovic Courtès
  0 siblings, 2 replies; 8+ messages in thread
From: Rutherther via Bug reports for GNU Guix @ 2024-09-16 19:23 UTC (permalink / raw)
  To: 73304


When I add both python and a python package (seems like any) to a
relocatable guix pack, the resulting python in the merged profile seems
to be broken. Specifically its `sys.path` contains missing paths.

To replicate:
```
mkdir -p /tmp/b && cd /tmp/b
tar xzvf $(guix pack -RR python python-pyflakes -S /profile=)`
```

Then try executing the python from merged profile, and see sys.path output
--8<---------------cut here---------------start------------->8---
./profile/bin/python3
>>> import sys
>>> print(sys.path)
['', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python310.zip', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/lib-dynload', '/tmp/b/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/site-packages']
--8<---------------cut here---------------end--------------->8---

Now if you instead use the realpath of this python
--8<---------------cut here---------------start------------->8---
$(realpath ./profile/bin/python3)
>>> import sys
>>> print(sys.path)
['', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python310.zip', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/lib-dynload', '/tmp/b/gnu/store/pwajwfiygrkmag8fm1wzn3cf362j7sri-python-3.10.7R/lib/python3.10/site-packages']
--8<---------------cut here---------------end--------------->8---

As can be observed, the first instance misses "gnu/store" in the path,
and instead points to a path that does not exist. I have not
investigated, at least not yet, where this discrepancy comes from.
I was not able to replicate this with anything else than relocatable
pack. So my guess would be something strange happens when making
bwrap/fakechroot etc.

Regards,
Rutherther





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

end of thread, other threads:[~2024-10-14 11:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-16 19:23 bug#73304: Python in relocatable guix pack leads to wrong sys.path Rutherther via Bug reports for GNU Guix
2024-09-16 19:28 ` Rutherther via Bug reports for GNU Guix
2024-09-30 21:08 ` Ludovic Courtès
2024-10-01 19:39   ` Rutherther via Bug reports for GNU Guix
2024-10-02  6:20   ` Konrad Hinsen
2024-10-02 11:59     ` Konrad Hinsen
2024-10-06  8:29       ` Konrad Hinsen
2024-10-14 11:11         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.