Skip to content

Commit 6fbe6d5

Browse files
authored
Upgrade rules_nodejs to 5.7.0, rules_sass to 1.55, minimum bazel to 4.2.2. (#5977)
Upgrades rule_nodejs dependency to 5.7.0. This also requires upgrading: * npm @bazel dependencies to 5.7.0 * rules_sass to its latest version 1.55.0. * minimum bazel version to 4.2.2 Following two sets of instructions: * General instructions for migration to 5.X major release: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0 * Instructions for 5.7.0 specifically: https://github.com/bazelbuild/rules_nodejs/releases/tag/5.7.0 Other notable things: * yarn_install's exports_directories_only property now defaults to True. We must set this to False in order to remain compatible with ts_library * See: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0#exports_directories_only * No longer need to override node_version as rules_nodejs default version of node is now 16.12.0. * See: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0#updated-defaults * We were overriding this only because rules_nodejs defaul version of node was too old. * ts_library has moved from @bazel/typescript to @bazel/concatjs * See: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0#ts_library * rules_sass upgrade was necessary to avoid SassCompiler hanging indefinitely. Builds were not completing. * bazel version upgrade was not necessary but does match the minimum version specified by rules_nodejs: * See: https://github.com/bazelbuild/rules_nodejs/blob/5.7.0/index.bzl#L96
1 parent 8dd5a3b commit 6fbe6d5

File tree

6 files changed

+55
-50
lines changed

6 files changed

+55
-50
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ on:
2222
env:
2323
# Keep this Bazel version in sync with the `versions.check` directive
2424
# in our WORKSPACE file.
25-
BAZEL_VERSION: '4.0.0'
26-
BAZEL_SHA256SUM: '7bee349a626281fc8b8d04a7a0b0358492712377400ab12533aeb39c2eb2b901'
25+
BAZEL_VERSION: '4.2.2'
26+
BAZEL_SHA256SUM: '11dea6c7cfd866ed520af19a6bb1d952f3e9f4ee60ffe84e63c0825d95cb5859'
2727
BUILDTOOLS_VERSION: '3.0.0'
2828
BUILDIFIER_SHA256SUM: 'e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db'
2929
BUILDOZER_SHA256SUM: '3d58a0b6972e4535718cdd6c12778170ea7382de7c75bc3728f5719437ffb84d'

WORKSPACE

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ load("@bazel_skylib//lib:versions.bzl", "versions")
2525

2626
# Keep this version in sync with:
2727
# * The BAZEL environment variable defined in .github/workflows/ci.yml, which is used for CI and nightly builds.
28-
versions.check(minimum_bazel_version = "4.0.0")
28+
versions.check(minimum_bazel_version = "4.2.2")
2929

3030
http_archive(
3131
name = "io_bazel_rules_webtesting",
@@ -64,27 +64,27 @@ rules_closure_dependencies(
6464

6565
http_archive(
6666
name = "build_bazel_rules_nodejs",
67-
sha256 = "d63ecec7192394f5cc4ad95a115f8a6c9de55c60d56c1f08da79c306355e4654",
67+
sha256 = "c29944ba9b0b430aadcaf3bf2570fece6fc5ebfb76df145c6cdad40d65c20811",
6868
urls = [
69-
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-4.6.1.tar.gz",
70-
"https://github.com/bazelbuild/rules_nodejs/releases/download/4.6.1/rules_nodejs-4.6.1.tar.gz",
69+
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_nodejs/releases/download/5.7.0/rules_nodejs-5.7.0.tar.gz",
70+
"https://github.com/bazelbuild/rules_nodejs/releases/download/5.7.0/rules_nodejs-5.7.0.tar.gz",
7171
],
7272
)
7373

74-
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")
74+
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
7575

76-
node_repositories(
77-
node_version = "12.21.0",
78-
)
76+
build_bazel_rules_nodejs_dependencies()
77+
78+
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
7979

8080
yarn_install(
8181
name = "npm",
82+
# "Some rules only work by referencing labels nested inside npm packages
83+
# and therefore require turning off exports_directories_only."
84+
# This includes "ts_library".
85+
# See: https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0#exports_directories_only
86+
exports_directories_only = False,
8287
package_json = "//:package.json",
83-
# Opt out of symlinking local node_modules folder into bazel internal
84-
# directory. Symlinking is incompatible with our toolchain which often
85-
# removes source directory without `bazel clean` which creates broken
86-
# symlink into node_modules folder.
87-
symlink_node_modules = False,
8888
yarn_lock = "//:yarn.lock",
8989
)
9090

@@ -94,13 +94,18 @@ load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "
9494

9595
esbuild_repositories(npm_repository = "npm")
9696

97+
# rules_sass release information is difficult to find but it does seem to
98+
# regularly release with same cadence and version as core sass.
99+
# We typically upgrade this library whenever we upgrade rules_nodejs.
100+
#
101+
# rules_sass 1.55.0: https://github.com/bazelbuild/rules_sass/tree/1.55.0
97102
http_archive(
98103
name = "io_bazel_rules_sass",
99-
sha256 = "ee6d527550d42af182673c3718da98bb9205cabdeb08eacc0e3767fa3f2b051a",
100-
strip_prefix = "rules_sass-1.49.11",
104+
sha256 = "1ea0103fa6adcb7d43ff26373b5082efe1d4b2e09c4f34f8a8f8b351e9a8a9b0",
105+
strip_prefix = "rules_sass-1.55.0",
101106
urls = [
102-
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_sass/archive/1.49.11.zip",
103-
"https://github.com/bazelbuild/rules_sass/archive/1.49.11.zip",
107+
"http://mirror.tensorflow.org/github.com/bazelbuild/rules_sass/archive/1.55.0.zip",
108+
"https://github.com/bazelbuild/rules_sass/archive/1.55.0.zip",
104109
],
105110
)
106111

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"@angular/cli": "^12.2.0",
3232
"@angular/compiler": "^12.2.0",
3333
"@angular/compiler-cli": "^12.2.0",
34-
"@bazel/concatjs": "^4.6.1",
35-
"@bazel/esbuild": "^4.6.2",
34+
"@bazel/concatjs": "5.7.0",
35+
"@bazel/esbuild": "5.7.0",
3636
"@bazel/ibazel": "^0.15.9",
37-
"@bazel/jasmine": "^4.6.1",
38-
"@bazel/typescript": "^4.6.1",
37+
"@bazel/jasmine": "5.7.0",
38+
"@bazel/typescript": "5.7.0",
3939
"@types/d3": "5.7.2",
4040
"@types/jasmine": "^3.8.2",
4141
"@types/lodash": "^4.14.172",

tensorboard/defs/BUILD

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("//tensorboard/defs:protos.bzl", "tb_proto_library")
22
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
3-
load("@npm//@bazel/typescript:index.bzl", "ts_library")
3+
load("@npm//@bazel/concatjs:index.bzl", "ts_library")
44

55
package(default_visibility = ["//tensorboard:internal"])
66

@@ -50,14 +50,15 @@ ts_library(
5050
# Custom ts_library compiler that runs tsc_wrapped with angular/compiler-cli statically linked
5151
# This can be used with worker mode because we don't need the linker at runtime to make
5252
# the angular plugin loadable
53-
# Just a clone of @npm//@bazel/typescript/bin:tsc_wrapped with added deps
53+
# Just a clone of @npm//@bazel/concatjs/bin:tsc_wrapped with added deps
5454
nodejs_binary(
5555
name = "tsc_wrapped_with_angular",
5656
data = [
5757
"@npm//@angular/compiler-cli",
58+
"@npm//@bazel/concatjs",
5859
"@npm//@bazel/typescript",
5960
],
60-
entry_point = "@npm//:node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js",
61+
entry_point = "@npm//:node_modules/@bazel/concatjs/internal/tsc_wrapped/tsc_wrapped.js",
6162
# Disables the Bazel node modules linker. The node module linker is unreliable for the
6263
# persistent worker executable, as it would rely on the `node_modules/` folder in the
6364
# execroot that can be shared in non-sandbox environments or for persistent workers.

tensorboard/defs/defs.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"""External-only delegates for various BUILD rules."""
1515

1616
load("@io_bazel_rules_sass//:defs.bzl", "npm_sass_library", "sass_binary", "sass_library")
17-
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite")
17+
load("@npm//@bazel/concatjs:index.bzl", "karma_web_test_suite", "ts_library")
1818
load("@npm//@bazel/esbuild:index.bzl", "esbuild")
19-
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_library")
19+
load("@npm//@bazel/typescript:index.bzl", "ts_config")
2020

2121

2222
def tensorboard_webcomponent_library(**kwargs):

yarn.lock

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -359,48 +359,47 @@
359359
"@babel/helper-validator-identifier" "^7.18.6"
360360
to-fast-properties "^2.0.0"
361361

362-
"@bazel/concatjs@^4.6.1":
363-
version "4.6.2"
364-
resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-4.6.2.tgz#f034a33a2cb5b8a5426c3166ed6ea5857cb31940"
365-
integrity sha512-5wpASLPgWU+ti7+/iHquym0mY1lFZkkNUlHPzCjSOBolzdSWO9yFO/S5k2agzULNbNrZInI9IErakyc6K3xvog==
362+
"@bazel/concatjs@5.7.0":
363+
version "5.7.0"
364+
resolved "https://registry.yarnpkg.com/@bazel/concatjs/-/concatjs-5.7.0.tgz#ee9e2369ceabca7fdba9ee1539ddcdf0fc57a283"
365+
integrity sha512-FlUthrDl9oq8HYP6mXVvhJ1dGCEgZ9TOsHJ6aab56bwBJWNDRwWuCYElozZO/Lgu7NB6GkD3CGG8HBjxYM+ZZg==
366366
dependencies:
367367
protobufjs "6.8.8"
368368
source-map-support "0.5.9"
369369
tsutils "3.21.0"
370370

371-
"@bazel/esbuild@^4.6.2":
372-
version "4.6.2"
373-
resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-4.6.2.tgz#1be88b6c4c07cabb2dd84a698d5be0f32de934f4"
374-
integrity sha512-VqmeIlEDq7tVNpIk88zS3DZSAV1F1VN92IBPekKuQqIU6PTt3+iID/v4lkK80SwFBthF4pi/PG0PPaulIe/qGA==
371+
"@bazel/esbuild@5.7.0":
372+
version "5.7.0"
373+
resolved "https://registry.yarnpkg.com/@bazel/esbuild/-/esbuild-5.7.0.tgz#8eb01e18994553f24e08df175fd43d0298bfc51d"
374+
integrity sha512-5QQVa9gZ7sOVA7b9HdSXLvDuZ8crqubGJkEsNUjSh1pSzHuyMIqKYbYaEhCFrhfk4M/XoTy/BkIER0bJSZYjMw==
375375

376376
"@bazel/ibazel@^0.15.9":
377377
version "0.15.10"
378378
resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.15.10.tgz#cf0cff1aec6d8e7bb23e1fc618d09fbd39b7a13f"
379379
integrity sha512-0v+OwCQ6fsGFa50r6MXWbUkSGuWOoZ22K4pMSdtWiL5LKFIE4kfmMmtQS+M7/ICNwk2EIYob+NRreyi/DGUz5A==
380380

381-
"@bazel/jasmine@^4.6.1":
382-
version "4.6.2"
383-
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-4.6.2.tgz#0cda13b88b62345ea0f3a52b24b903b29e90a4cd"
384-
integrity sha512-T5YOIy800khE+NXf0IsV1KcQjPjppf9CzSBe68LluFg+cgnF59GHn9qnlz4Ml9/L6bx5TQxG3yWbWY/jiAwziQ==
381+
"@bazel/jasmine@5.7.0":
382+
version "5.7.0"
383+
resolved "https://registry.yarnpkg.com/@bazel/jasmine/-/jasmine-5.7.0.tgz#85b136f0e671e17d7907ab7bc725648c3267dc1d"
384+
integrity sha512-ZUFyNk1PxMtbeQkF3JshuOpdEpNczKLP2es70Kp7oLZfPQ5DySpGX07utuM/o3gkawdZGVtRMFF+UbQa/wG5mA==
385385
dependencies:
386386
c8 "~7.5.0"
387387
jasmine-reporters "~2.5.0"
388388

389-
"@bazel/typescript@^4.6.1":
390-
version "4.6.2"
391-
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-4.6.2.tgz#9f07b6f8cfb6b0a0e228e5971de412911c910a90"
392-
integrity sha512-AUF7kq82bP6DX9Brihr/eQqvNccxVfSXosFxt80h94og5cmMyoc/euXha6rxlOBP3yWXmSo+/qjzO7o8PWJduQ==
389+
"@bazel/typescript@5.7.0":
390+
version "5.7.0"
391+
resolved "https://registry.yarnpkg.com/@bazel/typescript/-/typescript-5.7.0.tgz#3f888c603bf5f159dfb4c0c38584fb31d248d5a2"
392+
integrity sha512-5c06vi2rQqd75GieqYGsNVon3tnkvbjMlVLJuwJ5/VtC9uOXKlCwrqxV8tbx789PTTtACNYzwKJTVW++58tgDA==
393393
dependencies:
394-
"@bazel/worker" "4.6.2"
395-
protobufjs "6.8.8"
394+
"@bazel/worker" "5.7.0"
396395
semver "5.6.0"
397396
source-map-support "0.5.9"
398397
tsutils "3.21.0"
399398

400-
"@bazel/worker@4.6.2":
401-
version "4.6.2"
402-
resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-4.6.2.tgz#0bd105344533335327c2edfa3fc65b04c39cdea8"
403-
integrity sha512-DLpN6iQAH6uiUraAs4CESyqs60u55fcKmYgOOVObGuLSQQuX49Lw7XRIN90NibRPwpbBDQichWE3zfra0yKTTw==
399+
"@bazel/worker@5.7.0":
400+
version "5.7.0"
401+
resolved "https://registry.yarnpkg.com/@bazel/worker/-/worker-5.7.0.tgz#d121261ee1833c5f5858f818f0e4d9a2d8e2c3c5"
402+
integrity sha512-VqTG+0gsgXM07q+HiQcSAggNnAzjLei8lzlJQ+mey12KGI4AbNJ1vxlk2pnw9BZdckfe2rRzwkF44B5SNqIgSQ==
404403
dependencies:
405404
google-protobuf "^3.6.1"
406405

0 commit comments

Comments
 (0)