Skip to content

Commit b3a10e0

Browse files
alexeagleIgorMinar
authored andcommitted
build: update Bazel dependency to 0.11.1 (angular#23297)
PR Close angular#23297
1 parent 0cb4f12 commit b3a10e0

File tree

9 files changed

+35
-31
lines changed

9 files changed

+35
-31
lines changed

.circleci/config.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
## IMPORTANT
1313
# If you change the `docker_image` version, also change the `cache_key` suffix and the version of
1414
# `com_github_bazelbuild_buildtools` in the `/WORKSPACE` file.
15-
var_1: &docker_image angular/ngcontainer:0.1.0
16-
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.1.0
15+
var_1: &docker_image angular/ngcontainer:0.2.0
16+
var_2: &cache_key v2-angular-{{ .Branch }}-{{ checksum "yarn.lock" }}-0.2.0
1717

1818
# See remote cache documentation in /docs/BAZEL.md
1919
var_3: &setup-bazel-remote-cache
@@ -47,8 +47,10 @@ jobs:
4747
- run: 'buildifier -mode=check $(find . -type f \( -name BUILD.bazel -or -name BUILD \)) ||
4848
(echo "BUILD files not formatted. Please run ''yarn buildifier''" ; exit 1)'
4949
# Run the skylark linter to check our Bazel rules
50+
# deprecated-api is disabled because we use actions.new_file(genfiles_dir)
51+
# which has no replacement, see https://github.com/bazelbuild/bazel/issues/4858
5052
- run: 'find . -type f -name "*.bzl" |
51-
xargs java -jar /usr/local/bin/Skylint_deploy.jar ||
53+
xargs java -jar /usr/local/bin/Skylint_deploy.jar --disable-checks=deprecated-api ||
5254
(echo -e "\n.bzl files have lint errors. Please run ''yarn skylint''"; exit 1)'
5355

5456
- restore_cache:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pubspec.lock
1414
.settings/
1515
*.swo
1616
modules/.settings
17+
.bazelrc
1718
.vscode
1819
modules/.vscode
1920

WORKSPACE

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ http_archive(
99

1010
load("@build_bazel_rules_nodejs//:defs.bzl", "check_bazel_version", "node_repositories", "yarn_install")
1111

12-
check_bazel_version("0.9.0")
12+
check_bazel_version("0.11.1")
1313
node_repositories(package_json = ["//:package.json"])
1414

1515
yarn_install(
@@ -44,19 +44,19 @@ local_repository(
4444
# This commit matches the version of buildifier in angular/ngcontainer
4545
# If you change this, also check if it matches the version in the angular/ngcontainer
4646
# version in /.circleci/config.yml
47-
BAZEL_BUILDTOOLS_VERSION = "b3b620e8bcff18ed3378cd3f35ebeb7016d71f71"
47+
BAZEL_BUILDTOOLS_VERSION = "70bc7843bb9950fece2bc014ed16de03419e36e2"
4848

4949
http_archive(
5050
name = "com_github_bazelbuild_buildtools",
5151
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % BAZEL_BUILDTOOLS_VERSION,
5252
strip_prefix = "buildtools-%s" % BAZEL_BUILDTOOLS_VERSION,
53-
sha256 = "dad19224258ed67cbdbae9b7befb785c3b966e5a33b04b3ce58ddb7824b97d73",
53+
sha256 = "367c23a5fe7fc2a7cb57863d3718b4149f0e57426c48c8ad54c45348a0b53cc1",
5454
)
5555

5656
http_archive(
5757
name = "io_bazel_rules_go",
58-
url = "https://github.com/bazelbuild/rules_go/releases/download/0.7.1/rules_go-0.7.1.tar.gz",
59-
sha256 = "341d5eacef704415386974bc82a1783a8b7ffbff2ab6ba02375e1ca20d9b031c",
58+
url = "https://github.com/bazelbuild/rules_go/releases/download/0.10.3/rules_go-0.10.3.tar.gz",
59+
sha256 = "feba3278c13cde8d67e341a837f69a029f698d7a27ddbb2a202be7a10b22142a",
6060
)
6161

6262
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
@@ -68,9 +68,9 @@ go_register_toolchains()
6868
# Fetching the Bazel source code allows us to compile the Skylark linter
6969
http_archive(
7070
name = "io_bazel",
71-
url = "https://github.com/bazelbuild/bazel/archive/9755c72b48866ed034bd28aa033e9abd27431b1e.zip",
72-
strip_prefix = "bazel-9755c72b48866ed034bd28aa033e9abd27431b1e",
73-
sha256 = "5b8443fc3481b5fcd9e7f348e1dd93c1397f78b223623c39eb56494c55f41962",
71+
url = "https://github.com/bazelbuild/bazel/archive/5a35e72f9e97c06540c479f8c31512fb4656202f.zip",
72+
strip_prefix = "bazel-5a35e72f9e97c06540c479f8c31512fb4656202f",
73+
sha256 = "ed33a52874c14e3b487fb50f390c541fab9c81a33d986d38fb01766a66dbcd21",
7474
)
7575

7676
# We have a source dependency on the Devkit repository, because it's built with

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"scripts": {
1919
"preskylint": "bazel build --noshow_progress @io_bazel//src/tools/skylark/java/com/google/devtools/skylark/skylint:Skylint",
20-
"skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" ! -path \"./dist/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint",
20+
"skylint": "find . -type f -name \"*.bzl\" ! -path \"*/node_modules/*\" ! -path \"./dist/*\" | xargs $(bazel info bazel-bin)/external/io_bazel/src/tools/skylark/java/com/google/devtools/skylark/skylint/Skylint --disable-checks=deprecated-api",
2121
"prebuildifier": "bazel build --noshow_progress @com_github_bazelbuild_buildtools//buildifier",
2222
"buildifier": "find . -type f \\( -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs $(bazel info bazel-bin)/external/com_github_bazelbuild_buildtools/buildifier/buildifier",
2323
"preinstall": "node tools/yarn/check-yarn.js",
@@ -121,4 +121,4 @@
121121
"xhr2": "0.1.4",
122122
"yargs": "9.0.1"
123123
}
124-
}
124+
}

packages/bazel/src/esm5.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _esm5_outputs_aspect(target, ctx):
7070
],
7171
)
7272

73-
ctx.action(
73+
ctx.actions.run(
7474
progress_message = "Compiling TypeScript (ES5 with ES Modules) %s" % target.label,
7575
inputs = target.typescript.replay_params.inputs + [tsconfig],
7676
outputs = outputs,

packages/bazel/src/ng_module.bzl

+13-12
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def ngc_compile_action(ctx, label, inputs, outputs, messages_out, tsconfig_file,
239239

240240
arguments += i18n_args
241241

242-
ctx.action(
242+
ctx.actions.run(
243243
progress_message = progress_message,
244244
mnemonic = mnemonic,
245245
inputs = inputs,
@@ -252,17 +252,18 @@ def ngc_compile_action(ctx, label, inputs, outputs, messages_out, tsconfig_file,
252252
)
253253

254254
if messages_out != None:
255-
ctx.action(inputs = list(inputs),
256-
outputs = messages_out,
257-
executable = ctx.executable._ng_xi18n,
258-
arguments = (_EXTRA_NODE_OPTIONS_FLAGS +
259-
[tsconfig_file.path] +
260-
# The base path is bin_dir because of the way the ngc
261-
# compiler host is configured. So we need to explicitly
262-
# point to genfiles/ to redirect the output.
263-
["../genfiles/" + messages_out[0].short_path]),
264-
progress_message = "Extracting Angular 2 messages (ng_xi18n)",
265-
mnemonic = "Angular2MessageExtractor")
255+
ctx.actions.run(
256+
inputs = list(inputs),
257+
outputs = messages_out,
258+
executable = ctx.executable._ng_xi18n,
259+
arguments = (_EXTRA_NODE_OPTIONS_FLAGS +
260+
[tsconfig_file.path] +
261+
# The base path is bin_dir because of the way the ngc
262+
# compiler host is configured. So we need to explicitly
263+
# point to genfiles/ to redirect the output.
264+
["../genfiles/" + messages_out[0].short_path]),
265+
progress_message = "Extracting Angular 2 messages (ng_xi18n)",
266+
mnemonic = "Angular2MessageExtractor")
266267

267268
if not locale and not ctx.attr.no_i18n:
268269
return struct(

packages/bazel/src/ng_package/ng_package.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ def _ng_package_impl(ctx):
298298
ctx,
299299
devfiles.to_list(),
300300
[npm_package_directory] + ctx.files.packages)
301-
return struct(
301+
return [DefaultInfo(
302302
files = depset([package_dir])
303-
)
303+
)]
304304

305305
NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{
306306
"srcs": attr.label_list(allow_files = True),

packages/bazel/src/ng_rollup_bundle.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BO_ROLLUP="angular_devkit/packages/angular_devkit/build_optimizer/src/build-opti
2828
BO_PLUGIN="require('%s').default(%s)" % (BO_ROLLUP, PLUGIN_CONFIG)
2929

3030
def run_brotli(ctx, input, output):
31-
ctx.action(
31+
ctx.actions.run(
3232
executable = ctx.executable._brotli,
3333
inputs = [input],
3434
outputs = [output],
@@ -77,7 +77,7 @@ ng_rollup_bundle = rule(
7777
executable = True,
7878
cfg = "host",
7979
default = Label("@angular//packages/bazel/src:rollup_with_build_optimizer")),
80-
"_brotli": attr.label(
80+
"_brotli": attr.label(
8181
executable = True,
8282
cfg = "host",
8383
default = Label("@org_brotli//:brotli")),

scripts/ci/env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ setEnvVar YARN_VERSION 1.3.2
4040
# Revision 494239 (which was part of Chrome 62.0.3186.0) is the last version that does not cause flakes. (Latest revision checked: 508578)
4141
setEnvVar CHROMIUM_VERSION 494239 # Chrome 62 linux stable, see https://www.chromium.org/developers/calendar
4242
setEnvVar CHROMEDRIVER_VERSION_ARG "--versions.chrome 2.33"
43-
setEnvVar BAZEL_VERSION 0.9.0
43+
setEnvVar BAZEL_VERSION 0.11.1
4444
setEnvVar SAUCE_CONNECT_VERSION 4.4.9
4545
setEnvVar ANGULAR_CLI_VERSION 1.6.3
4646
setEnvVar PROJECT_ROOT $(cd ${thisDir}/../..; pwd)

0 commit comments

Comments
 (0)