Remote: Register "remote" strategy even if remote execution is not available.#13490
Closed
coeuvre wants to merge 3 commits intobazelbuild:masterfrom
Closed
Remote: Register "remote" strategy even if remote execution is not available.#13490coeuvre wants to merge 3 commits intobazelbuild:masterfrom
coeuvre wants to merge 3 commits intobazelbuild:masterfrom
Conversation
90f3ece to
2d3ca7f
Compare
…ailable. So that you can set a `--spawn_strategy` that includes `remote` without set `--remote_executor`. In addition, if `--remote_local_fallback` is set and `remote_executor` is unreachable when build starts, Bazel will fallback to next available strategy. Fixes bazelbuild#13340 and bazelbuild#13487.
a4c2b64 to
7207586
Compare
philwo
approved these changes
May 20, 2021
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
…ailable. So that you can set a `--spawn_strategy` that includes `remote` without setting `--remote_executor`. In addition, if `--remote_local_fallback` is set and `remote_executor` is unreachable when build starts, Bazel will fallback to next available strategy. Fixes bazelbuild#13340 and bazelbuild#13487. Closes bazelbuild#13490. PiperOrigin-RevId: 378339904
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
…ailable. So that you can set a `--spawn_strategy` that includes `remote` without setting `--remote_executor`. In addition, if `--remote_local_fallback` is set and `remote_executor` is unreachable when build starts, Bazel will fallback to next available strategy. Fixes bazelbuild#13340 and bazelbuild#13487. Closes bazelbuild#13490. PiperOrigin-RevId: 378339904
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
…ailable. So that you can set a `--spawn_strategy` that includes `remote` without setting `--remote_executor`. In addition, if `--remote_local_fallback` is set and `remote_executor` is unreachable when build starts, Bazel will fallback to next available strategy. Fixes bazelbuild#13340 and bazelbuild#13487. Closes bazelbuild#13490. PiperOrigin-RevId: 378339904
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 15, 2021
…ailable. So that you can set a `--spawn_strategy` that includes `remote` without setting `--remote_executor`. In addition, if `--remote_local_fallback` is set and `remote_executor` is unreachable when build starts, Bazel will fallback to next available strategy. Fixes bazelbuild#13340 and bazelbuild#13487. Closes bazelbuild#13490. PiperOrigin-RevId: 378339904
coeuvre
added a commit
to coeuvre/bazel
that referenced
this pull request
Jul 16, 2021
…ailable. So that you can set a `--spawn_strategy` that includes `remote` without setting `--remote_executor`. In addition, if `--remote_local_fallback` is set and `remote_executor` is unreachable when build starts, Bazel will fallback to next available strategy. Fixes bazelbuild#13340 and bazelbuild#13487. Closes bazelbuild#13490. PiperOrigin-RevId: 378339904
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/datadog-agent
that referenced
this pull request
Mar 31, 2026
…7945) ### What does this PR do? Adjust the `cache` Bazel config following a complete review of the remote flags: 1. switch `--remote_executor` to `--remote_cache` since RBE infrastructure is not ready, 2. add `--incompatible_remote_local_fallback_for_remote_cache` to enable local fallback on remote cache failures, 3. remove `--remote_local_fallback_strategy=sandboxed` from the `linux` and `macos` configs, which became dead letter. ### Motivation [Earlier discussion](https://dd.slack.com/archives/C08SK4B0FK8/p1773737357223759). #### 1. `--remote_executor` to `--remote_cache` The build farm is used as a remote cache, not a remote executor. [Quoting](#47945 (comment)) @JSGette, who filed bazelbuild/bazel#29129: > fallback is basically broken for remote executor if an endpoint is unavailable **before** the build. So if buildbarn was to fail **during** the build Bazel would just continue locally. #### 2. `--incompatible_remote_local_fallback_for_remote_cache` The flag was introduced with Bazel 8.5.1 (bazelbuild/bazel#27996) since `--remote_local_fallback` alone does not cover cache-layer failures. Both flags are required because [they are AND-gated at the single decision point](https://github.com/bazelbuild/bazel/blob/9.0.1/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java#L191): ```java boolean shouldLocalFallback = options.remoteLocalFallbackForRemoteCache && options.remoteLocalFallback; ``` Without **both** flags, a `RemoteExecutionCapabilitiesException` (capabilities fetch failure) causes a hard build failure instead of a local fallback. #### 3. `--remote_local_fallback_strategy` removal The flag is unreachable in a `--remote_cache`-only setup: its single call site is `RemoteSpawnRunner.execLocally()`, gated by `RemoteExecutionService.mayBeExecutedRemotely()`, which requires `remoteExecutor != null`. It is also `@Deprecated` (bazelbuild/bazel#7480). ### Describe how you validated your changes The flag is a no-op outside `--config=cache` (local builds unaffected by default), but CI benefits from it by default. ### Additional Notes The stale `registerRemoteSpawnStrategy()` javadoc (["otherwise does nothing"](https://github.com/bazelbuild/bazel/blob/9.0.1/src/main/java/com/google/devtools/build/lib/remote/RemoteActionContextProvider.java#L195-L196) when no executor is set) is a known source-reading hazard: the null-check was deliberately removed in bazelbuild/bazel#13490 (2021), moving the guard to `canExec()`. The javadoc was never updated. Co-authored-by: regis.desgroppes <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So that you can set a
--spawn_strategythat includesremotewithout setting--remote_executor. In addition, if--remote_local_fallbackis set andremote_executoris unreachable when build starts, Bazel will fallback to next available strategy.Fixes #13340 and #13487.