Deprecate --remote_cache flag in favor of --remote_executor or a new --remote flag
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
### Problem statement ###
Till version `8.5` it wasn't possible to set a fallback strategy if `--remote_cache` flag is used.
- If we set `--remote_cache` bazel sends `GetCapabilities` request to the remote server and expects to see `CacheCapabilities`. If we set `--remote_executor` bazel expects to see `ExecutionCapabilities`.
- So what you can actually do is use a combination of `--remote_executor` and `--strategy=sandboxed` or `--spawn_strategy=sandboxed` to instruct bazel to not build anything remotely but keep using remote cache. But if the remote server reports in `GetCapabilities` that `ExecutionCapabilities` isn't there the build will fail even though we explicitly told bazel not to use RBE at all via `--strategy` or `--spawn_strategy` flags.
### Proposal ###
- Drop `--remote_cache` in favor of `--remote_executor` flag or even simple `--remote`
- Adjust bazel's behavior based on `GetCapabilities` response.
So `--remote_executor` flag should take values of `strategy` or `spawn_strategy` flags into account:
- If either of those set to `sandboxed` or any other strategy that is not `remote` bazel only expects to get `CacheCapabilities`
- If either of those are missing the default strategy would be `remote`.
- If either of those contains multiple values (e.g. `remote, sandboxed`) but `remote` is among them bazel will expect `ExecutionCapabilities` or fail otherwise.
This smart handling would unify the usage of both and slightly reduce the confusion. Also, there will be no need to have a [separate flag](https://bazel.build/reference/command-line-reference#common_options-flag--incompatible_remote_local_fallback_for_remote_cache).
P.S. I deliberately left dynamic strategy flags out of scope for now. But if we agree it makes sense to make this configuration piece better I would definitely take those into account as well.
### Which category does this issue belong to?
Remote Execution
Contributor guide
Research direction
Start by reading Bazel's command-line handling for --remote_cache, --remote_executor, --strategy, and --spawn_strategy, then trace how GetCapabilities responses are interpreted. Done means the remote configuration is unified as proposed, including the documented fallback behavior and removal of the separate remote-cache fallback flag.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100