bug#73304: Python in relocatable guix pack leads to wrong sys.path

2025-01-31 Thread Maxim Cournoyer
Hi, [...] >> That's indeed preferable, but according to my analysis not possible, as >> there are situations of faulty startup behavior in which out >> sitecustomize.py is not run at all. > > I think I had read this from you before but I hadn't grasped how that's > possible/when it occurs. Do yo

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2025-01-31 Thread Maxim Cournoyer
Hi Konrad, Konrad Hinsen writes: > Hi, > > Maxim Cournoyer writes: > >> The workaround looks smart (too smart for my tired brain tonight), but >> to be honest I'd rather have Python handle the relative paths correctly, >> or work around it in our sitecustomize.py script that runs early when > >

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2025-01-31 Thread Konrad Hinsen
Hi, Maxim Cournoyer writes: > The workaround looks smart (too smart for my tired brain tonight), but > to be honest I'd rather have Python handle the relative paths correctly, > or work around it in our sitecustomize.py script that runs early when That's indeed preferable, but according to my a

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2025-01-31 Thread Maxim Cournoyer
Hi, Rutherther writes: [...] > Okay, I spent a bit of time on this, and I think I get it now. > This seems to boil down to something in Python wrongly handling > the argv0, where it looks at the path, being /tmp/a/profile/bin/python3, > substitutes the symlink > /tmp/a/profile/bin/python3/../.

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2025-01-31 Thread Rutherther via Bug reports for GNU Guix
"Rutherther" writes: >> Hello, >> >> Konrad Hinsen skribis: >> >>> Konrad Hinsen writes: >>> I have changed my mind. In the sys.path outputs shown, there are no paths from add-on packages. It's just the Python standard library. Maybe our sitecustomize.py is not run at all, but if

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2025-01-31 Thread Rutherther via Bug reports for GNU Guix
> Hello, > > Konrad Hinsen skribis: > >> Konrad Hinsen writes: >> >>> I have changed my mind. In the sys.path outputs shown, there are no >>> paths from add-on packages. It's just the Python standard library. >>> Maybe our sitecustomize.py is not run at all, but if it is, it didn't do >>> anyth

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-10-14 Thread Ludovic Courtès
Hello, Konrad Hinsen skribis: > Konrad Hinsen writes: > >> I have changed my mind. In the sys.path outputs shown, there are no >> paths from add-on packages. It's just the Python standard library. >> Maybe our sitecustomize.py is not run at all, but if it is, it didn't do >> anything to sys.pat

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-10-06 Thread Konrad Hinsen
Konrad Hinsen writes: > I have changed my mind. In the sys.path outputs shown, there are no > paths from add-on packages. It's just the Python standard library. > Maybe our sitecustomize.py is not run at all, but if it is, it didn't do > anything to sys.path. There must be a bug somewhere else.

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-10-02 Thread Rutherther via Bug reports for GNU Guix
Ludovic Courtès writes: > Commit d5e0180805f52ef38a03ff9d6c11dd6174e3526b fixed a similar issue I > think, discussed at . > > Not sure whether it’s a new problem here. Konrad, Maxim, Josselin, > WDYT? :-) Hello Ludovic, if I understand correctly this commit

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-10-02 Thread Konrad Hinsen
Konrad Hinsen writes: > This problem clearly looks like it's caused by our sitecustomize.py. > One indicator is "When I add both python and a python package": if there > is no additional package, only python by itself, our sitecustomize > doesn't do anything. I have changed my mind. In the sys.p

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-10-01 Thread Konrad Hinsen
Ludovic Courtès writes: > Rutherther 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. > Commit d5e0180805f52ef38a03ff9d6

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-09-30 Thread Ludovic Courtès
Hello, Rutherther 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 > ta

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-09-16 Thread Rutherther via Bug reports for GNU Guix
As a workaround, the profile in gnu/store can be used instead of the one exposed by -S symlink. Specifically, getting `realpath ./profile` and using that as the profile instead of `./profile` directly resolves the issue.

bug#73304: Python in relocatable guix pack leads to wrong sys.path

2024-09-16 Thread Rutherther via Bug reports for GNU Guix
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-pyflak