Skip to content

Commit c05d57f

Browse files
devversionjelbourn
authored andcommitted
build: use bazel automatic execution strategy selection (#16823)
Currenlty all `ts_library`'s using the test tsconfig file are not hermetic and will break when running remotely. This is because just `tsconfig-test.json` is referenced as action input while the tsconfig actually extends from the `tsconfig-build.json`.
1 parent eaf70ca commit c05d57f

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

.bazelrc

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ test --test_output=errors
3636
# See https://docs.bazel.build/versions/master/user-manual.html#flag--workspace_status_command
3737
build:release --workspace_status_command="node ./tools/bazel-stamp-vars.js"
3838

39-
###############################
40-
# Typescript / Angular / Sass #
41-
###############################
42-
43-
# Make compilation fast, by keeping a few copies of the compilers
44-
# running as daemons, and cache SourceFile AST's to reduce parse time.
45-
build --strategy=TypeScriptCompile=worker
46-
build --strategy=AngularTemplateCompile=worker
47-
build --strategy=SassCompiler=worker
48-
4939
################################
5040
# Temporary Settings for Ivy #
5141
################################
@@ -62,12 +52,7 @@ build --define=compile=legacy
6252
build:remote --remote_instance_name=projects/internal-200822/instances/default_instance
6353
build:remote --project_id=internal-200822
6454

65-
# Setup the build strategy for various types of actions. Mixing "local" and "remote"
66-
# can cause unexpected results and we want to run everything remotely if possible.
67-
build:remote --spawn_strategy=remote,local
68-
build:remote --strategy=Javac=remote
69-
build:remote --strategy=Closure=remote
70-
build:remote --strategy=Genrule=remote
55+
# Needed due to: https://github.com/bazelbuild/bazel/issues/7254
7156
build:remote --define=EXECUTOR=remote
7257

7358
# Setup the remote build execution servers.

src/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3+
load("@npm_bazel_typescript//:index.bzl", "ts_config")
34
load("//:packages.bzl", "CDK_PACKAGES", "MATERIAL_PACKAGES")
45
load("//tools:defaults.bzl", "ts_library")
56
load("//tools/dgeni:index.bzl", "dgeni_api_docs")
@@ -21,6 +22,12 @@ ts_library(
2122
srcs = [":module-typings.d.ts"],
2223
)
2324

25+
ts_config(
26+
name = "tsconfig-test",
27+
src = "bazel-tsconfig-test.json",
28+
deps = ["bazel-tsconfig-build.json"],
29+
)
30+
2431
dgeni_api_docs(
2532
name = "api-docs",
2633
srcs = apiSourceFiles + [

tools/defaults.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load("//tools/markdown-to-html:index.bzl", _markdown_to_html = "markdown_to_html
88
load("//:packages.bzl", "ANGULAR_LIBRARY_UMDS", "VERSION_PLACEHOLDER_REPLACEMENTS")
99

1010
_DEFAULT_TSCONFIG_BUILD = "//src:bazel-tsconfig-build.json"
11-
_DEFAULT_TSCONFIG_TEST = "//src:bazel-tsconfig-test.json"
11+
_DEFAULT_TSCONFIG_TEST = "//src:tsconfig-test"
1212

1313
# Whether Angular type checking should be enabled or not. Enabled by
1414
# default but will be overwritten when running snapshots tests with Ivy

0 commit comments

Comments
 (0)