Sandbox reuse preserves test`_tmp` directory
Description of the bug:
The _tmp directory created for tests is preserved in the sandbox stash.
While I haven't benchmarked the effect of this, it would at least waste disk space and may also negatively affect performance of sandbox reuse.
Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
No response
What is the output of bazel info release?
No response
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What's the output of git remote get-url origin; git rev-parse HEAD ?
No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
Cc @oquenchil @lberki
@bazel-io flag
@bazel-io fork 7.1.0
Hey Fabian, are you sure about this?
I see here that we are only stashing the execroot from the sandboxBase. The _hermetic_tmp directory is a sibling of the execroot.
The testing code I wrote to repro this isn't giving me any hermetic tmp directory being copied into the stash. Under sandboxBase/execroot/$TEST_WORKSPACE/, I do see a _tmp directory. It would be good not to copy that one too but it's not related to the hermetic tmp dir. Is that the one you meant? As far as I can see that would only be created for test rules though. Was this prompted by the test rules in rules_oci?
Thanks!
Thanks for investigating and sorry for the false alarm - I saw the _tmp and thought that it was the hermetic tmp dir.
Oh I can still fix the _tmp one. I think it makes total sense not to stash that in tests.
I updated title and description.