bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Sandbox reuse preserves test`_tmp` directory

Open fmeum opened this issue 1 year ago • 7 comments

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

fmeum avatar Feb 08 '24 09:02 fmeum

Cc @oquenchil @lberki

fmeum avatar Feb 08 '24 09:02 fmeum

@bazel-io flag

fmeum avatar Feb 08 '24 09:02 fmeum

@bazel-io fork 7.1.0

keertk avatar Feb 08 '24 12:02 keertk

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!

oquenchil avatar Feb 12 '24 20:02 oquenchil

Thanks for investigating and sorry for the false alarm - I saw the _tmp and thought that it was the hermetic tmp dir.

fmeum avatar Feb 12 '24 20:02 fmeum

Oh I can still fix the _tmp one. I think it makes total sense not to stash that in tests.

oquenchil avatar Feb 12 '24 21:02 oquenchil

I updated title and description.

fmeum avatar Feb 12 '24 22:02 fmeum