Skip to content

Commit 348615b

Browse files
gregmagolanAndrewKushnir
authored andcommitted
build: update to @bazel/bazel 1.0.0 (angular#33367)
Also removes `build:remote --spawn_strategy=remote` from .bazelrc. 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. PR Close angular#33367
1 parent e231073 commit 348615b

6 files changed

Lines changed: 43 additions & 112 deletions

File tree

.bazelrc

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,23 @@ build:remote-http-caching --google_default_credentials
9292
# --config=remote #
9393
##################################
9494

95-
# Load default settings for Remote Build Execution.
96-
import %workspace%/third_party/github.com/bazelbuild/bazel-toolchains/bazelrc/.bazelrc.notoolchain
95+
# Starting with Bazel 0.27.0 strategies do not need to be explicitly
96+
# defined. See https://github.com/bazelbuild/bazel/issues/7480
97+
build:remote --define=EXECUTOR=remote
98+
99+
# Enable remote execution so actions are performed on the remote systems.
100+
build:remote --remote_executor=remotebuildexecution.googleapis.com
101+
102+
# Enable encryption.
103+
build:remote --tls_enabled=true
104+
105+
# Set a higher timeout value, just in case.
106+
build:remote --remote_timeout=3600
107+
108+
# Enable authentication. This will pick up application default credentials by
109+
# default. You can use --auth_credentials=some_file.json to use a service
110+
# account credential instead.
111+
build:remote --auth_enabled=true
97112

98113
# Increase the default number of jobs by 50% because our build has lots of
99114
# parallelism
@@ -126,31 +141,6 @@ build:remote --remote_cache=remotebuildexecution.googleapis.com
126141
# This allows us to avoid installing a second copy of node_modules
127142
common --experimental_allow_incremental_repository_updates
128143

129-
# This option is changed to true in Bazel 0.27 and exposes a possible
130-
# regression in Bazel 0.27.0.
131-
# Error observed is in npm_package target `//packages/common/locales:package`:
132-
# ```
133-
# ERROR: /home/circleci/ng/packages/common/locales/BUILD.bazel:13:1: Assembling
134-
# npm package packages/common/locales/package failed: No usable spawn strategy found
135-
# for spawn with mnemonic SkylarkAction. Your --spawn_strategyor --strategy flags
136-
# are probably too strict. Visit https://github.com/bazelbuild/bazel/issues/7480 for
137-
# migration advises
138-
# ```
139-
# Suspect is https://github.com/bazelbuild/rules_nodejs/blob/master/internal/npm_package/npm_package.bzl#L75-L82:
140-
# ```
141-
# execution_requirements = {
142-
# # Never schedule this action remotely because it's not computationally expensive.
143-
# # It just copies files into a directory; it's not worth copying inputs and outputs to a remote worker.
144-
# # Also don't run it in a sandbox, because it resolves an absolute path to the bazel-out directory
145-
# # allowing the .pack and .publish runnables to work with no symlink_prefix
146-
# # See https://github.com/bazelbuild/rules_nodejs/issues/187
147-
# "local": "1",
148-
# },
149-
# ```
150-
build --incompatible_list_based_execution_strategy_selection=false
151-
test --incompatible_list_based_execution_strategy_selection=false
152-
run --incompatible_list_based_execution_strategy_selection=false
153-
154144
####################################################
155145
# User bazel configuration
156146
# NOTE: This needs to be the *last* entry in the config.

integration/bazel/.bazelrc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,3 @@ build --symlink_prefix=/
2020
# Turn on managed directories feature in Bazel
2121
# This allows us to avoid installing a second copy of node_modules
2222
common --experimental_allow_incremental_repository_updates
23-
24-
# This option is changed to true in Bazel 0.27 and exposes a possible
25-
# regression in Bazel 0.27.0.
26-
# See root /.bazelrc for more info. integration/bazel uses
27-
# ng_package which depends on npm_package so this flag needs to be set
28-
# her as well.
29-
build --incompatible_list_based_execution_strategy_selection=false
30-
test --incompatible_list_based_execution_strategy_selection=false
31-
run --incompatible_list_based_execution_strategy_selection=false

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
"// 3": "when updating @bazel/bazel version you also need to update the RBE settings in .bazelrc (see https://github.com/angular/angular/pull/27935)",
130130
"devDependencies": {
131131
"@angular/cli": "^9.0.0-next.15",
132-
"@bazel/bazel": "0.28.1",
132+
"@bazel/bazel": "1.0.0",
133133
"@bazel/buildifier": "^0.26.0",
134134
"@bazel/ibazel": "^0.10.3",
135135
"@types/minimist": "^1.2.0",

packages/bazel/package.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def rules_angular_dev_dependencies():
2929
_maybe(
3030
http_archive,
3131
name = "bazel_toolchains",
32-
sha256 = "dcb58e7e5f0b4da54c6c5f8ebc65e63fcfb37414466010cf82ceff912162296e",
33-
strip_prefix = "bazel-toolchains-0.28.2",
34-
url = "https://github.com/bazelbuild/bazel-toolchains/archive/0.28.2.tar.gz",
32+
sha256 = "0b36eef8a66f39c8dbae88e522d5bbbef49d5e66e834a982402c79962281be10",
33+
strip_prefix = "bazel-toolchains-1.0.1",
34+
url = "https://github.com/bazelbuild/bazel-toolchains/archive/1.0.1.tar.gz",
3535
)
3636

3737
#############################################

third_party/github.com/bazelbuild/bazel-toolchains/bazelrc/.bazelrc.notoolchain

Lines changed: 0 additions & 50 deletions
This file was deleted.

yarn.lock

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -221,31 +221,31 @@
221221
lodash "^4.17.13"
222222
to-fast-properties "^2.0.0"
223223

224-
"@bazel/bazel-darwin_x64@0.28.1":
225-
version "0.28.1"
226-
resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-0.28.1.tgz#415658785e1dbd6f7ab5c8f2b98c1c99c614e1d5"
227-
integrity sha512-VDKWmplAfa4uCAbkIQ5nRn04MFQqtsPNuc2HkluJ8OIum773yC2dPR+OlLBKxrlBuKJYB27TtbOwOa6w/uK7aw==
228-
229-
"@bazel/bazel-linux_x64@0.28.1":
230-
version "0.28.1"
231-
resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-0.28.1.tgz#f78006089e17660261088272a0e04fc886572e34"
232-
integrity sha512-n4XfNxagYhejQD32V4XSxT/qzuH1l/2jxslbKSak66/uQ+wad8Ew9rjNb4JUin3xtrfFtzmxx2jpQkybZsRVGA==
233-
234-
"@bazel/bazel-win32_x64@0.28.1":
235-
version "0.28.1"
236-
resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-0.28.1.tgz#60a2819618cf7582cc35ac16c01763a5e807b414"
237-
integrity sha512-T4xksGfKikaHS4zxnGT6r5R436mz9j2lz//L1vc5sJnaEF/1e2Gv6MLl86vfZW2Xxo6iIEi6ntSzgYxP2Blohw==
238-
239-
"@bazel/bazel@0.28.1":
240-
version "0.28.1"
241-
resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-0.28.1.tgz#3a6b9b7a74d566c66805242ccaa2f907592b5bff"
242-
integrity sha512-s4bn5/vegEec66l15ZjyUe4jNybQ5J/cg9gFzR5f8deKj8lM+2WtCfvTLO3XfUe2pbrB4BG7C31jpyFPOC+6aw==
224+
"@bazel/bazel-darwin_x64@1.0.0":
225+
version "1.0.0"
226+
resolved "https://registry.yarnpkg.com/@bazel/bazel-darwin_x64/-/bazel-darwin_x64-1.0.0.tgz#8ab7ecba867130d87e3ecd6cfd5757e59ea274ab"
227+
integrity sha512-2J8qPpUAhSsuZ1P0kMFLvAQUz8zB8mkKmGL3/8raXUnw9TblsykwAdeg3QlJwTLORn+ZqdAjOYEQIarnTpS1NA==
228+
229+
"@bazel/bazel-linux_x64@1.0.0":
230+
version "1.0.0"
231+
resolved "https://registry.yarnpkg.com/@bazel/bazel-linux_x64/-/bazel-linux_x64-1.0.0.tgz#7043cc41eaf7b1d2618766e0759d513873bb9659"
232+
integrity sha512-/ZpOrYyDNGqUyAGPHFr4Y1kn8xCG1G4Lg2VMZtfCZzDohzoYFYs8iyQGU2/8PwldH8XX+oJT9atWqSt1EyoeAw==
233+
234+
"@bazel/bazel-win32_x64@1.0.0":
235+
version "1.0.0"
236+
resolved "https://registry.yarnpkg.com/@bazel/bazel-win32_x64/-/bazel-win32_x64-1.0.0.tgz#1111e4910c155a1917162ae96fd3737d062d20dd"
237+
integrity sha512-p5LpQ/WiijwOS+eBkdD7UewHL8JwK+8gpb4tIKqgh/a2yawgzEQPJDPBUV9ykss5t+s85BL2kEMhduuDewt/MA==
238+
239+
"@bazel/bazel@1.0.0":
240+
version "1.0.0"
241+
resolved "https://registry.yarnpkg.com/@bazel/bazel/-/bazel-1.0.0.tgz#7c6e306d8ced3a6e087f041861364ef742560342"
242+
integrity sha512-bxNjlieM1HwgIgqx+AqtNeUA6bvqIQ0X5YysWuCCtT24Dd+wTs6fRSx1KGOA1NiRBrg+kpk7ebitOU8yaM+tiA==
243243
dependencies:
244244
"@bazel/hide-bazel-files" latest
245245
optionalDependencies:
246-
"@bazel/bazel-darwin_x64" "0.28.1"
247-
"@bazel/bazel-linux_x64" "0.28.1"
248-
"@bazel/bazel-win32_x64" "0.28.1"
246+
"@bazel/bazel-darwin_x64" "1.0.0"
247+
"@bazel/bazel-linux_x64" "1.0.0"
248+
"@bazel/bazel-win32_x64" "1.0.0"
249249

250250
"@bazel/buildifier-darwin_x64@0.26.0":
251251
version "0.26.0"

0 commit comments

Comments
 (0)