-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
A loose layout, venv-with-symlink PEX creates brittle symlinks #2023
Comments
Pants doesn't use loose, only packed. The same problem likely exists there though. Is loose use new or not a relevant / accurate detail here? |
I'm declaring a |
I also couldn't reproduce with |
Gotcha. Thanks for the extra context. Bug fix aside, if you're willing to share the use case, loose -> venv. Its supported and needs to be fixed, but also the oddest use case in the matrix of layouts x execution mode so I'm curious. |
No specific use-case other than "was using |
What was the loose for in the 1st place though? I am aware of 0 loose users (Pants would be if sandboxing were performant); so I'd love to learn what problems it helps people with. |
The PR that introduced it lacks context 😒 If I had to guess it was either to workaround a bug or was a result of "bang on it until it works" |
Both packed and zipped PEXes undergo an unzip into the PEX_ROOT prior to any other action, establishing a known private cache of their contents. Loose PEXes skip this step and run directly from their loose contents. This is fine and speedy for the "zipapp" execution mode, but leads to an incorrect venv cache in symlink mode where venv entries symlink back out to the loose PEX and can thus be invalidated by moves outside Pex control. Force loose PEXes in `--venv` mode to use copies so that their cached venv is robust to external moves. Fixes pex-tool#2023
Both packed and zipped PEXes undergo an unzip into the PEX_ROOT prior to any other action, establishing a known private cache of their contents. Loose PEXes skip this step and run directly from their loose contents. This is fine and speedy for the "zipapp" execution mode, but leads to an incorrect venv cache in symlink mode where venv entries symlink back out to the loose PEX and can thus be invalidated by moves outside Pex control. Force loose PEXes in `--venv` mode to use copies so that their cached venv is robust to external moves. Fixes #2023
Pex version
2.1.113
I found this through Pants, but ultimately seems like a PEX issue/fix.
See also:
In Pants-land, this manifests as being a symlink to an ephemeral Pants sandbox which has since gone bye-bye.
What I might expect is that on first run, the wheels get copied into the PEX root and then the venv symlinks to the extracted wheels in the pex root so moving/deleting the original pex doesn't invalidate the venv.
The text was updated successfully, but these errors were encountered: