-
Notifications
You must be signed in to change notification settings - Fork 52
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
[ENH] - Ensure that the length of all environment paths <= 255 characters #649
Comments
One challenging aspect here might be how to migrate folks from existing installations. |
This is the sort of error you get from a long package path on Windows. The long prefix path errors look more like
(see #588 (comment)) And actually, in this case at least, conda-store didn't even print this error message, it swallowed it. I had to dig into the code to extract the failing command and run it manually to get it. So really users might see no error. Meaning it's definitely a good idea to manually test this. |
The only simple way to do it right now, even with a smaller hash, would be adding a runtime check to For now, I'll just add a size check to |
Status update: will be fixed by #653 and conda-incubator/conda-store-ui#332, which are being reviewed. |
Feature description
Comes from #588
conda
packages are guaranteed to be relocatable as long as the environment prefix length is <=255 characters.Since we can have control over that, so I am suggesting we add checks to ensure that:
The 255 char value can also be adjusted down depending on the system, because we might need more wiggle room for Windows installations. So I'd say a
MAX_PREFIX_LENGTH=255
should be default, but it can be adjusted to a value smaller than that.Value and/or benefit
If this is not controlled, users might run into hard to diagnose bugs like
, or buffer overflows, linking errors, etc.
It will also help palliating the problems with long paths in Windows, in general, where we might want to set an even lower threshold.
Anything else?
Extra explanation about relocatability:
conda packages are relocatable thanks to a neat trick: all packages are built under a 255-char long prefix. This long prefix acts as a "placeholder" that gets replaced at install-time so it matches the destination prefix.
For example: I have a binary that hardcodes (for whatever reason) a path to another executable it needs to do a certain operation. At build time, the long prefix will have something like
/opt/conda-build-workspace/project-1234abcd/envs/_h_env_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeholder_placeho
. At install time, after requestingconda create -p /opt/my_envs/hallo
, it will be replaced with that path, and the remaining characters will be NULL, and everyone's happy.This trick is guaranteed to work 100% AS LONG AS the target prefix is under 255 characters. In some cases, longer paths might work because the environment doesn't contain binaries (text replacement is not as constrained) that need to be patched, but it's not guaranteed.
The text was updated successfully, but these errors were encountered: