bazelbuild/bazel

bazel run do not clean/regenerate runfiles

Open

#14,414 opened on 2021年12月13日

GitHub で見る
 (1 comment) (3 reactions) (0 assignees)Java (4,465 forks)batch import
P4help wantedteam-Documentationteam-OSStype: documentation (cleanup)

Repository metrics

Stars
 (25,384 stars)
PR merge metrics
 (平均マージ 22d 20h) (30d で 77 merged PRs)

説明

Description of the problem / feature request:

When a binary run by bazel run generates files in its working directory (i.e. its runfiles), they stay for the next run.

I would like them to be cleaned at each bazel run invocation. Right now I need to bazel clean before. A flag, such as bazel run --clean_runfiles is another option.

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

If target //:foo looks like this pseudo code:

if fileExists "a"
  then echo "Exists"
  else echo "Does not exist"

createFile "a"

The following:

```bazel clean; bazel run //:foo; bazel run //:foo` will print "Do not exists" followed by "Exists".

What operating system are you running Bazel on?

Linux

What's the output of bazel info release?

release 4.1.0- (@non-git)

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

NixOS

Have you found anything relevant by searching the web?

Any other information, logs, or outputs that you want to share?

コントリビューターガイド