Skip to content

Zipapps no longer deleting Bazel.runfiles_* directories placed in /tmp #17342

@sethasadi

Description

@sethasadi

Description of the bug:

As of Bazel 6.0.0, a change was made to bazel/rules/python/python_stub_template.txt that gates the deletion of the Bazel.runfiles_* directory that is created in /tmp. This is because it depends on workspace being set, and workspace is only set when RUN_UNDER_RUNFILES is set. This is a regression from the previous behavior where the directory placed in /tmp would be deleted as long as it was running under a zip. This should be fixed so that the Bazel.runfiles_* directories are cleaned up whenever it is running under a zip.

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Build a zipapp target on Bazel 6.0.0 (without RUN_UNDER_RUNFILES set) and on whatever machine you consume that zipapp there will be a Bazel.runfiles_<sha> directory with the zipapp contents left around from execution.

Which operating system are you running Bazel on?

Linux

What is the output of bazel info release?

release 6.0.0

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 master; git rev-parse HEAD ?

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions