Don't write to runfiles #634
Open
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.
py_binary
targets create virtual environments in runfiles. This can be problematic in remote execution contexts (we're seeing errors in Buildfarm with certain sandboxing options enabled) because runfiles are often read-only on those environments. This is a safety measure—action inputs are sometimes symbolically linked or shared between actions to reduce unnecessary I/O, and apy_binary
can be the executable of an action.This PR updates
py/private/run.tmpl.sh
to create the virtual environment in a/tmp
subdirectory. This directory is randomly generated, which should minimize the likelihood of actions stepping on each other's toes. If more separation is needed, each action can get its own/tmp
directory with--incompatible_sandbox_hermetic_tmp
,Changes are visible to end-users: no
I don't think users should rely on the virtual environment being in one place or another, but if they are, this does constitute a visible change.
Test plan
New test cases addedrules_py
-backed actions