Skip to content

Commit

Permalink
build: remove build:remote --spawn_strategy=remote from .bazelrc
Browse files Browse the repository at this point in the history
It seems that with Bazel 1.0.0 setting `--incompatible_list_based_execution_strategy_selection=false` no longer works around the issue with npm_package that it did when it was added. The error that was originally observed has returned after updating to Bazel 1.0.0:

```
ERROR: /home/circleci/ng/packages/angular_devkit/build_optimizer/BUILD:66:1: Assembling npm package packages/angular_devkit/build_optimizer/npm_package failed: No usable spawn strategy found for spawn with mnemonic Action.  Your --spawn_strategy, --genrule_strategy or --strategy flags are probably too strict. Visit bazelbuild/bazel#7480 for migration advice
```

This commit removes both `—incompatible_list_based_execution_strategy_selection=false` as well as `build:remote --spawn_strategy=remote` which means that Bazel will do the default behavior of picking the first available strategy from the default list, which is `remote,worker,sandboxed,local`. See bazelbuild/bazel#7480 for more details.
  • Loading branch information
gregmagolan committed Oct 24, 2019
1 parent 1a84904 commit d8be539
Showing 1 changed file with 4 additions and 33 deletions.
37 changes: 4 additions & 33 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,15 @@ test --test_output=errors
# Remote Execution Setup #
################################

# Use the Angular team internal GCP instance for remote execution.
# Use the Angular team internal GCP instance for remote execution.
build:remote --remote_instance_name=projects/internal-200822/instances/default_instance
build:remote --project_id=internal-200822

# Setup the build strategy for various types of actions. Mixing "local" and "remote"
# can cause unexpected results and we want to run everything remotely if possible.
build:remote --spawn_strategy=remote
build:remote --strategy=Javac=remote
build:remote --strategy=Closure=remote
build:remote --strategy=Genrule=remote
# Starting with Bazel 0.27.0 strategies do not need to be explicitly
# defined. See https://github.com/bazelbuild/bazel/issues/7480
build:remote --define=EXECUTOR=remote

# Setup the remote build execution servers.
# Setup the remote build execution servers.
build:remote --remote_cache=remotebuildexecution.googleapis.com
build:remote --remote_executor=remotebuildexecution.googleapis.com
build:remote --tls_enabled=true
Expand Down Expand Up @@ -138,31 +134,6 @@ build:remote --remote_accept_cached=true
# This allows us to avoid installing a second copy of node_modules
common --experimental_allow_incremental_repository_updates

# This option is changed to true in Bazel 0.27 and exposes a possible
# regression in Bazel 0.27.0.
# Error observed is in npm_package target `//packages/common/locales:package`:
# ```
# ERROR: /home/circleci/ng/packages/common/locales/BUILD.bazel:13:1: Assembling
# npm package packages/common/locales/package failed: No usable spawn strategy found
# for spawn with mnemonic SkylarkAction. Your --spawn_strategy or --strategy flags
# are probably too strict. Visit https://github.com/bazelbuild/bazel/issues/7480 for
# migration advises
# ```
# Suspect is https://github.com/bazelbuild/rules_nodejs/blob/master/internal/npm_package/npm_package.bzl#L75-L82:
# ```
# execution_requirements = {
# # Never schedule this action remotely because it's not computationally expensive.
# # It just copies files into a directory; it's not worth copying inputs and outputs to a remote worker.
# # Also don't run it in a sandbox, because it resolves an absolute path to the bazel-out directory
# # allowing the .pack and .publish runnables to work with no symlink_prefix
# # See https://github.com/bazelbuild/rules_nodejs/issues/187
# "local": "1",
# },
# ```
build --incompatible_list_based_execution_strategy_selection=false
test --incompatible_list_based_execution_strategy_selection=false
run --incompatible_list_based_execution_strategy_selection=false

####################################################
# User bazel configuration
# NOTE: This needs to be the *last* entry in the config.
Expand Down

0 comments on commit d8be539

Please sign in to comment.