-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.14 has no way to unset --disk_cache flag (interferes with remote build testing) #5308
Comments
Related to (possible duplicate of?) #4595 |
Actually I’d like to suggest that the empty string will mean bazel uses a sensible default (like external dependencies cache) and will be on by default. |
Gentle ping -- this is kinda important for us (Stripe) because we're canarying remote execution in some of our larger builds, and we can't upgrade Bazel to 0.14 or later if doing so will break the remote execution flags. |
I am currently on vacation until the 18th of June. I have totally missed that use case. I‘d be happy to fix that then or you can submit a PR and @laurentlb can cherry pick that into 0.15 (I think?). Both /dev/null and the empty string sound good to me. |
I’d really ask reserving the empty string to mean working in a default location (like the external dependencies cache). This doesn’t mean I don’t think we need to solve this issue (toggle off / unifying the behavior like what @buchgr started to work on) but I wonder if you can’t unblock yourself for the time being |
This fixes a regression from v0.13. When the local disk cache flags were unified into `--disk_cache`, it became impossible to override a default cache location such that the cache became disabled. This prevents canarying of remote execution in the presence of a default bazelrc that enables the disk cache. Fixes bazelbuild#5308
@buchgr OK, sent #5338 to treat an empty disk cache path the same as being unset. @ittaiz I think we might be talking about different things. There is no meaningful "default location" for the SimpleBlobStore enabled by |
Why do you think there’s no meaningful default location for the disk cache?
Also,
My point about composition is that the disk cache options only exist in the
.bazelrc which doesn’t get evaluated when you run in CI since there you
override the bazelrc location to point to the remote.bazelrc.
I’d really ask not to merge #5308 before we get to a conclusion here (cc
@dslomov)
…On Wed, 6 Jun 2018 at 20:46 jmillikin-stripe ***@***.***> wrote:
@buchgr <https://github.com/buchgr> OK, sent #5338
<#5338> to treat an empty disk
cache path the same as being unset.
@ittaiz <https://github.com/ittaiz> I think we might be talking about
different things. There is no meaningful "default location" for the
SimpleBlobStore enabled by --disk_cache. And composing bazelrcs doesn't
help when the presence of a flag in an "earlier" bazelrc will cause another
flag to become invalid regardless of later overrides.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5308 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF8aXZ3E15aJNM-Jq3wFKJDuHLqucks5t6BVbgaJpZM4UV-2k>
.
|
Because if I run
If my CI system has a |
Re default- what I meant is running “bazel build —disk_cache= //:foo” (in actuality —disk_cache is specified in the project bazelrc). The reason to use this notation is because different operating systems might have different options for where to store it and Bazel people prefer not to allow ~ in the options. Re unset- I now understand the difference in perspectives. I was thinking about only Dev machines using this flag while CI using only remote so my composition idea works. Wdyt about adding another flag to unset it? |
In your model, how would the behavior of |
Given “—disk_cache=“ bazel will turn on the disk cache and write it to
~/.bazel/cache (or something like this). I think that in future releases
running “bazel build //:foo” will implicitly have a disk cache which uses
the above location.
Given “—unset_disk_cache” bazel will not use the disk cache at all.
…On Wed, 6 Jun 2018 at 23:49 jmillikin-stripe ***@***.***> wrote:
In your model, how would the behavior of bazel build
--unset_disk_cache_flag //:foo and bazel build --disk_cache= //:foo be
different?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5308 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF8m9rrVRULYJOKJ2g25XlsVqPcCTks5t6EBngaJpZM4UV-2k>
.
|
I don't think the empty string should turn on the disk cache, that seems rather confusing. Note that we do always use the action cache by default, which is also on disk. The difference between the disk cache and the action cache is that the disk cache contains full copies of all the files in your build, increasing on-disk footprint by at least a factor of 2, or more if you want it to be actually useful. As such, I don't see us enabling it by default. |
In the interest of time, here is the resolution:
|
This fixes a regression from v0.13. When the local disk cache flags were unified into `--disk_cache`, it became impossible to override a default cache location such that the cache became disabled. This prevents canarying of remote execution in the presence of a default bazelrc that enables the disk cache. Fixes #5308 Closes #5338. PiperOrigin-RevId: 199613922
Ulf, Dmitry, thank you both for the quick response and the patch cherrypick! |
Thanks @dslomov! |
@ittaiz - I understand that - I have the disk cache enabled myself -, but I'm not sure that's the common case across all Bazel users, and I am concerned about the increase in disk usage in the case where users just checkout a single source tree and build it once or twice. I think the disk usage increase is amortized if you have multiple checkouts for the same code base. |
Baseline: 5c3f5c9 Cherry picks: + f96f037: Windows, Java launcher: Support jar files under different drives + ff8162d: sh_configure.bzl: FreeBSD is also a known platform + 7092ed3: Remove unneeded exec_compatible_with from local_sh_toolchain + 57bc201: Do not autodetect C++ toolchain when BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 is present + 35a78c0: remote: recursively delete incomplete downloaded output directory. + 3c9cd82: distfile: pack the archives needed later in the build + 27487c7: Slightly refactor SpawnAction to improve env handling + 1b333a2: Fix Cpp{Compile,Link}Action environment and cache key computation + 3da8929: Make SymlinkTreeAction properly use the configuration's environment + eca7b81: Add a missing dependency from checker framework dataflow to javacutils + 10a4de9: Release 0.14.0 (2018-06-01) + 4b80f24: Add option to enable Docker sandboxing. + 6b16352: Allow disabling the simple blob caches via CLI flag overrides. Bug fix for [#5336](#5336) Bug fix fot [#5308](#5308)
This fixes a regression from v0.13. When the local disk cache flags were unified into `--disk_cache`, it became impossible to override a default cache location such that the cache became disabled. This prevents canarying of remote execution in the presence of a default bazelrc that enables the disk cache. Fixes #5308 Closes #5338. PiperOrigin-RevId: 199613922
Baseline: 5c3f5c9 Cherry picks: + f96f037: Windows, Java launcher: Support jar files under different drives + ff8162d: sh_configure.bzl: FreeBSD is also a known platform + 7092ed3: Remove unneeded exec_compatible_with from local_sh_toolchain + 57bc201: Do not autodetect C++ toolchain when BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 is present + 35a78c0: remote: recursively delete incomplete downloaded output directory. + 3c9cd82: distfile: pack the archives needed later in the build + 27487c7: Slightly refactor SpawnAction to improve env handling + 1b333a2: Fix Cpp{Compile,Link}Action environment and cache key computation + 3da8929: Make SymlinkTreeAction properly use the configuration's environment + eca7b81: Add a missing dependency from checker framework dataflow to javacutils + 10a4de9: Release 0.14.0 (2018-06-01) + 4b80f24: Add option to enable Docker sandboxing. + 6b16352: Allow disabling the simple blob caches via CLI flag overrides. Bug fix for [bazelbuild#5336](bazelbuild#5336) Bug fix fot [bazelbuild#5308](bazelbuild#5308)
This fixes a regression from v0.13. When the local disk cache flags were unified into `--disk_cache`, it became impossible to override a default cache location such that the cache became disabled. This prevents canarying of remote execution in the presence of a default bazelrc that enables the disk cache. Fixes bazelbuild#5308 Closes bazelbuild#5338. PiperOrigin-RevId: 199613922
This fixes a regression from v0.13. When the local disk cache flags were unified into `--disk_cache`, it became impossible to override a default cache location such that the cache became disabled. This prevents canarying of remote execution in the presence of a default bazelrc that enables the disk cache. Fixes bazelbuild#5308 Closes bazelbuild#5338. PiperOrigin-RevId: 199613922
Baseline: 5c3f5c9 Cherry picks: + f96f037: Windows, Java launcher: Support jar files under different drives + ff8162d: sh_configure.bzl: FreeBSD is also a known platform + 7092ed3: Remove unneeded exec_compatible_with from local_sh_toolchain + 57bc201: Do not autodetect C++ toolchain when BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 is present + 35a78c0: remote: recursively delete incomplete downloaded output directory. + 3c9cd82: distfile: pack the archives needed later in the build + 27487c7: Slightly refactor SpawnAction to improve env handling + 1b333a2: Fix Cpp{Compile,Link}Action environment and cache key computation + 3da8929: Make SymlinkTreeAction properly use the configuration's environment + eca7b81: Add a missing dependency from checker framework dataflow to javacutils + 10a4de9: Release 0.14.0 (2018-06-01) + 4b80f24: Add option to enable Docker sandboxing. + 6b16352: Allow disabling the simple blob caches via CLI flag overrides. Bug fix for [bazelbuild#5336](bazelbuild#5336) Bug fix fot [bazelbuild#5308](bazelbuild#5308)
@dslomov - seems like the |
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'stools/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 thediskCache
option is notnull
, 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.The text was updated successfully, but these errors were encountered: