[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#73304: Python in relocatable guix pack leads to wrong sys.path
From: |
Ludovic Courtès |
Subject: |
bug#73304: Python in relocatable guix pack leads to wrong sys.path |
Date: |
Mon, 30 Sep 2024 23:08:29 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Hello,
Rutherther <rutherther@protonmail.com> skribis:
> 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
>
> ./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']
>
>
> Now if you instead use the realpath of this python
>
> $(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']
>
> As can be observed, the first instance misses "gnu/store" in the path,
> and instead points to a path that does not exist.
Commit d5e0180805f52ef38a03ff9d6c11dd6174e3526b fixed a similar issue I
think, discussed at <https://issues.guix.gnu.org/53258>.
Not sure whether it’s a new problem here. Konrad, Maxim, Josselin,
WDYT? :-)
Thanks,
Ludo’.