Disable the remote cache for an entire mnemonic. For instance, have something in command line like
bazel --nocache=CppLink.
We have a big C++ code base. For various reasons, we have to use static linkage. When we build the code base with debug symbols, the generated C++ binaries take a huge amount of space in total. To this end, we are thinking of disabling remote cache for the mnemonic CppLink. However, it would be great if we can still have remote cache for CppCompile.
If this is possible, then we can have something like the following in our bazelrc
build:debug -c dbg
build:debug --nocache=CppLink
Yes. I found this page on stackoverflow:
https://stackoverflow.com/questions/48438650/how-to-disable-remote-cache-for-specified-bazel-rules/48443469#48443469
The only answer on that page says that bazel by far doesn't provide a way to disable remote cache for an entire mnemonic. That's why I came here to propose a feature request.
Is the issue that the 1) storage space in the remote cache is too costly, 2) the upload takes too long or 3) the download takes too long?
If #4343 was fixed (by, for example, merging #7011), you would be able to do this by passing --modify_execution_info CppLink=+no-cache.
FYI: @agoulti
If #4343 was fixed (by, for example, merging #7011), you would be able to do this by passing
--modify_execution_info CppLink=+no-cache.
FYI - I'm successfully applying this method as a temporary solution with Bazel 0.29.1 and 1.x.x
Sorry that I did not notice the reply until now. I thought nobody would reply to this issue in the year of 2018 :P
@buchgr All of the three reasons are true for us. We generally find that linking, in comparison to uploading/downloading the cc_binary results, takes much less time, and can save a lot of storage space.
@benjaminp Thanks! It works!
Most helpful comment
If #4343 was fixed (by, for example, merging #7011), you would be able to do this by passing
--modify_execution_info CppLink=+no-cache.