Skip to content

0.14 has no way to unset --disk_cache flag (interferes with remote build testing) #5308

@jmillikin-stripe

Description

@jmillikin-stripe

Description of the problem / feature request:

The local disk cache and remote execution action strategy are incompatible -- if both are enabled in flags or bazelrc, Bazel will refuse to run.

In 0.13, disk caching is controlled by --experimental_local_disk_cache_path (string) and --experimental_local_disk_cache (bool). It was possible to enable caching in /etc/bazel.bazelrc, and disable it in a project's tools/bazel.rc for testing remote execution.

In 0.14 the flags were unified into --disk_cache (string) which is definitely nicer, but provides no mechanism to disable the disk cache in a project's local bazelrc. The check for "disk cache enabled?" is whether the diskCache option is not null, which is true if the flag has ever been set to anything.

This makes it very difficult to work with remote builds in 0.14 when running in a build environment with a standard cross-project /etc/bazel.bazelrc.

It would be nice if an empty value could also be considered "disk cache not enabled", so passing an empty string like bazel build --disk-cache= //... would work.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions