bazelbuild/bazel

bazel run do not clean/regenerate runfiles

Open

#14.414 aperta il 13 dic 2021

Vedi su GitHub
 (1 commento) (3 reazioni) (0 assegnatari)Java (4465 fork)batch import
P4help wantedteam-Documentationteam-OSStype: documentation (cleanup)

Metriche repository

Star
 (25.384 star)
Metriche merge PR
 (Merge medio 22g 20h) (77 PR mergiate in 30 g)

Descrizione

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?

Guida contributor