Description
As far as I can tell, the allow_cache_upload flag is available only on 3 specific binary rules, and nowhere else. allow_cache_upload is also default False on every actions.run() call, so there are probably a hundred places in prelude that have yet to get it threaded through. If that was ever the goal.
Available:
- python_binary
- cxx_binary
- rust_binary
Not available, for example:
- cxx_library
- rust_library
- rust_test
There's obviously some rhyme to this, in that somebody committed those three | buck.allow_cache_upload_arg()
attributes only on binary rules, but I can't find a rationale. I have a few guesses:
- Cache uploads have just not been used much, given they do not work yet in OSS (pending Implement missing parts of OSS RE caching #477). Don't know what happens at Meta. Maybe it's RE all the way, and never keep a local build.
- Maybe RE backends are always able to push and pull from the cache no matter what local buckd instances do, so nobody cares about local builds?
- Conservatively enabling for only binary builds papers over any issues with uploading local action results that might not work on other machines. Binaries are more likely to be portable if you used a slightly different compiler or linked to a different shared library version. We just don't trust local execution or the exhaustiveness of hidden dependency inclusion (to cache-bust different configurations) enough to enable it.
I just quickly patched prelude to enable it on rust_library and supply it in the macro reindeer calls for all crates.io targets, and it seems to work great. You can launch another buckd on a separate isolation dir on a big crate graph that reindeer made, and it eats it for breakfast.
Activity