-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtualenvs created from links are broken #380
Comments
Do you think this is a case of astral-sh/uv#8429 or are you suggesting we can fix this at build time? |
I expect a sys variable is resolved incorrectly during interpreter startup, causing the wrong home in
|
I need a little more exposition alongside these examples, I don't follow what you're demonstrating there. I would be surprised if this wasn't a sysconfig issue, but of course it'd be great to fix here if we can. |
As shown, pbs creates broken venv when the base interpreter is a symlink. This is a bug, since it should be able to do this, as system interpreter and pyenv succeed at this. The crash happens because This bug is the most likely candidate to crash the test suite in astral-sh/uv#8481 (comment). We need to figure out how |
Interestingly, after symlinking, some of the
|
That would definitely affect compilations of extension modules. |
Ohh interesting, it's because Python does:
|
I'm pretty sure I had to do something in PyOxidizer to work around this. Essentially mucking with the Python interpreter config to get it to resolve paths correctly because the default logic was insufficient. We should consider involving a CPython maintainer on this one as the behavior is a smell. ISTR Windows having special logic for path resolution because portable installs are a thing on Windows. But since most UNIX-like installs are to a fixed path, CPython doesn't support dynamic paths as well as we'd like. If CPython doesn't recognize the issue, we may have to patch our CPython build to handle dynamic install paths/symlibks correctly. This could be done with a custom site customize file. But since this included file can be disabled, we may need to patch C code. |
Unlike a system interpreter or a pyenv installation, pbs can't create venv from a symlink to the pbs installation location. PYTHONHOME is in the wrong location (that of the link, i think), which causes the encoding error.
I've only tested linux, i expect windows isn't affected (different venv mechanism, no symlinks by default), but i expect macos is affected, too.
The text was updated successfully, but these errors were encountered: