fix: ensure exec staging dir, preferring user dirs over tmp#336
Open
jonaslb wants to merge 1 commit intoaxodotdev:mainfrom
Open
fix: ensure exec staging dir, preferring user dirs over tmp#336jonaslb wants to merge 1 commit intoaxodotdev:mainfrom
jonaslb wants to merge 1 commit intoaxodotdev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #324 . Related to astral-sh/uv#17191.
As a bit extra context for the issue,
/tmpis sometimes mountednoexec, as it is I believe considered "security best practice" according to CIS. So probably, most users hit by this are enterprisy. But I suppose there might be some distros out there as well.This PR handles the issue by:
directoriescrate that I added as dependency), and then finally TMPDIR at last as before./run/user/<uid>on Linux,$HOME/Library/Cacheson MacOS, and{FOLDERID_LocalAppData}on Windows (as documented by the directories crate).tempfilelibrary as before for cleanup on dropI've tested this with a script that sets up a "fake root":
Although it's not easy to run the tests due to rate limiting from Github. I also had to adapt the cli tests to have a fallback to the runtime dir themselves, as they each individually do the whole "download and execute" dance, which won't work with a noexec tmp either.