Skip to content

Commit 00d8011

Browse files
josephperrottAndrewKushnir
authored andcommitted
build: Use Ivy compiler for bazel builds by default (angular#43862)
Setting the angular_ivy_enabled environment variable to True will default Bazel builds to use the Ivy compiler rather than defaulting to ViewEngine. PR Close angular#43862
1 parent 9f40d2a commit 00d8011

File tree

16 files changed

+30
-51
lines changed

16 files changed

+30
-51
lines changed

.bazelrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ query --deleted_packages=integration/bazel,integration/bazel/src,integration/baz
8484
################################
8585
# Temporary Settings for Ivy #
8686
################################
87-
# To determine if the compiler used should be Ivy instead of ViewEngine, one can use `--config=ivy`
88-
# on any bazel target. This is a temporary flag until codebase is permanently switched to Ivy.
89-
build --define=angular_ivy_enabled=False
87+
# Set the default compiler used for bazel builds to be Ivy.
88+
build --define=angular_ivy_enabled=True
9089

9190
build:view-engine --define=angular_ivy_enabled=False
9291
build:ivy --define=angular_ivy_enabled=True

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ jobs:
358358
command: |
359359
yarn bazel run //tools/saucelabs:sauce_service_setup
360360
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "ivy-only", ...) except attr("tags", "fixme-saucelabs-ve", ...)')
361-
yarn bazel test --config=saucelabs ${TESTS}
361+
yarn bazel test --config=saucelabs --config=view-engine ${TESTS}
362362
yarn bazel run //tools/saucelabs:sauce_service_stop
363363
no_output_timeout: 40m
364364
- notify_webhook_on_fail:
@@ -382,7 +382,7 @@ jobs:
382382
command: |
383383
yarn bazel run //tools/saucelabs:sauce_service_setup
384384
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "no-ivy-aot", ...) except attr("tags", "fixme-saucelabs-ivy", ...)')
385-
yarn bazel test --config=saucelabs --config=ivy ${TESTS}
385+
yarn bazel test --config=saucelabs ${TESTS}
386386
yarn bazel run //tools/saucelabs:sauce_service_stop
387387
no_output_timeout: 40m
388388
- notify_webhook_on_fail:
@@ -776,11 +776,11 @@ jobs:
776776
- setup_win
777777
- run:
778778
name: Build all windows CI targets
779-
command: bazel build --build_tag_filters=-ivy-only //packages/compiler-cli/...
779+
command: bazel build --config=view-engine --build_tag_filters=-ivy-only //packages/compiler-cli/...
780780
no_output_timeout: 15m
781781
- run:
782782
name: Test all windows CI targets
783-
command: bazel test --test_tag_filters="-ivy-only,-browser:chromium-local" //packages/compiler-cli/...
783+
command: bazel test --config=view-engine --test_tag_filters="-ivy-only,-browser:chromium-local" //packages/compiler-cli/...
784784
no_output_timeout: 15m
785785

786786
test_ivy_aot_win:
@@ -789,11 +789,11 @@ jobs:
789789
- setup_win
790790
- run:
791791
name: Build all windows CI targets
792-
command: bazel build --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot //packages/compiler-cli/...
792+
command: bazel build --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot //packages/compiler-cli/...
793793
no_output_timeout: 15m
794794
- run:
795795
name: Test all windows CI targets
796-
command: bazel test --config=ivy --test_tag_filters="-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //packages/localize/...
796+
command: bazel test --test_tag_filters="-no-ivy-aot,-fixme-ivy-aot,-browser:chromium-local" //packages/compiler-cli/... //packages/localize/...
797797
no_output_timeout: 15m
798798
# Save dependencies to use on subsequent runs.
799799
- save_cache:

.vscode/recommended-launch.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
4040
"args": [
4141
"test",
42-
"--config=ivy",
4342
"packages/core/test/acceptance",
4443
"--config=debug"
4544
],
@@ -57,7 +56,6 @@
5756
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
5857
"args": [
5958
"test",
60-
"--config=ivy",
6159
"packages/core/test/render3",
6260
"--config=debug"
6361
],
@@ -75,7 +73,6 @@
7573
"program": "${workspaceFolder}/node_modules/.bin/bazelisk",
7674
"args": [
7775
"test",
78-
"--config=ivy",
7976
"packages/core/test",
8077
"--config=debug"
8178
],

.vscode/recommended-tasks.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
1010
"args": [
1111
"test",
12-
"--config=ivy",
1312
"packages/core/test",
1413
"packages/core/test/acceptance",
1514
"packages/core/test/render3",
@@ -42,7 +41,6 @@
4241
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
4342
"args": [
4443
"test",
45-
"--config=ivy",
4644
"packages/core/test/acceptance",
4745
],
4846
"group": "test",
@@ -71,7 +69,6 @@
7169
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
7270
"args": [
7371
"test",
74-
"--config=ivy",
7572
"packages/core/test",
7673
],
7774
"group": "test",
@@ -100,7 +97,6 @@
10097
"command": "${workspaceFolder}/node_modules/.bin/bazelisk",
10198
"args": [
10299
"test",
103-
"--config=ivy",
104100
"packages/core/test/render3",
105101
],
106102
"group": "test",

docs/BAZEL.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,8 @@ See also: [`//.bazelrc`](https://github.com/angular/angular/blob/master/.bazelrc
6363

6464
- `--config=debug`: build and launch in debug mode (see [debugging](#debugging) instructions below)
6565
- `--test_arg=--node_options=--inspect=9228`: change the inspector port.
66-
- `--config=ivy` Enables ivy mode if present, otherwise ViewEngine is used. This switches which compiler is used (ngc or ngtsc)
67-
- `--config=view-engine` Enables ViewEngine mode if present, currently this the default mode. This switches which compiler is used (ngc or ngtsc)
66+
- `--config=view-engine` Enables ViewEngine mode if present, otherwise Ivy is used. This switches which compiler is used (ngc or ngtsc)
6867
- `--test_tag_filters=<tag>`: filter tests down to tags defined in the `tag` config of your rules in any given `BUILD.bazel`.
69-
- `no-ivy-aot`: Useful for excluding build and test targets that are not meant to be executed in Ivy AOT mode (`--config=ivy`).
70-
- `ivy-only`: Useful for excluding all Ivy build and tests targets with `--config=view-engine`.
71-
- `fixme-ivy-aot`: Useful for including/excluding build and test targets that are currently broken in Ivy AOT mode (`--config=ivy`).
7268

7369

7470
### Debugging a Node Test
@@ -276,7 +272,7 @@ Require stack:
276272

277273
`bazel run` only works in Bazel Windows with non-test targets. Ensure that you are using `bazel test` instead.
278274

279-
e.g: `yarn bazel test packages/core/test/bundling/forms:symbol_test --config=ivy`
275+
e.g: `yarn bazel test packages/core/test/bundling/forms:symbol_test`
280276

281277
#### mkdir missing
282278
If you see the following error::

docs/DEBUG_COMPONENTS_REPO_IVY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ node ./scripts/ci/update-framework-deps-to-dist-packages.js {COMPONENTS_REPO}/pa
2020
following command:
2121

2222
```bash
23-
yarn test --deleted_packages=//src/dev-app --config=ivy
23+
yarn test --deleted_packages=//src/dev-app
2424
```
2525

2626
### Running tests for individual entry-points

packages/core/src/render3/util/global_utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import {getComponent, getContext, getDirectiveMetadata, getDirectives, getHostEl
1919
*
2020
* To see this in action run the following command:
2121
*
22-
* bazel run --config=ivy
23-
* //packages/core/test/bundling/todo:devserver
22+
* bazel run //packages/core/test/bundling/todo:devserver
2423
*
2524
* Then load `localhost:5432` and start using the console tools.
2625
*/

packages/core/test/bundling/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ This is asserted by keeping gold files of all symbols which are expected to be r
66
When doing renaming it is often necessary to update the gold files, to do so use these commands:
77

88
```
9-
yarn bazel run --config=ivy //packages/core/test/bundling/injection:symbol_test.accept
10-
yarn bazel run --config=ivy //packages/core/test/bundling/cyclic_import:symbol_test.accept
11-
yarn bazel run --config=ivy //packages/core/test/bundling/forms:symbol_test.accept
12-
yarn bazel run --config=ivy //packages/core/test/bundling/hello_world:symbol_test.accept
13-
yarn bazel run --config=ivy //packages/core/test/bundling/router:symbol_test.accept
14-
yarn bazel run --config=ivy //packages/core/test/bundling/todo:symbol_test.accept
9+
yarn bazel run //packages/core/test/bundling/injection:symbol_test.accept
10+
yarn bazel run //packages/core/test/bundling/cyclic_import:symbol_test.accept
11+
yarn bazel run //packages/core/test/bundling/forms:symbol_test.accept
12+
yarn bazel run //packages/core/test/bundling/hello_world:symbol_test.accept
13+
yarn bazel run //packages/core/test/bundling/router:symbol_test.accept
14+
yarn bazel run //packages/core/test/bundling/todo:symbol_test.accept
1515
```
1616

1717
## Running all symbol tests

packages/core/test/bundling/core_all/BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ ng_rollup_bundle(
2828
js_size_tracking_test(
2929
name = "size_test",
3030
src = "angular/packages/core/test/bundling/core_all/bundle.min.js",
31-
# Ensures that this target runs with "--config=ivy" (aka Ivy). This is necessary
32-
# because we don't run this test on CI currently, but if we run it manually, we need to
33-
# ensure that it runs with Ivy for proper size comparisons.
3431
angular_ivy_enabled = "True",
3532
data = [
3633
"bundle.golden_size_map_ivy.json",

packages/core/test/render3/perf/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### Build
22

33
```
4-
yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}_lib.min_debug.js --config=ivy
4+
yarn bazel build //packages/core/test/render3/perf:${BENCHMARK}_lib.min_debug.js
55
```
66

77
### Run
@@ -72,15 +72,15 @@ The resulting output should look something like this:
7272
### Notes
7373

7474
To run the benchmark use `bazel run <benchmark_target>`, example:
75-
- `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection`
75+
- `yarn bazel run //packages/core/test/render3/perf:noop_change_detection`
7676

7777
To profile, append `_profile` to the target name and attach a debugger via chrome://inspect, example:
78-
- `yarn bazel run --config=ivy //packages/core/test/render3/perf:noop_change_detection_profile`
78+
- `yarn bazel run //packages/core/test/render3/perf:noop_change_detection_profile`
7979

8080
To interactively edit/rerun benchmarks use `ibazel` instead of `bazel`.
8181

8282
To debug
8383
- Follow the directions in `profile_in_browser.html`
8484
OR
85-
- `yarn bazel build --config=ivy //packages/core/test/render3/perf:noop_change_detection`
85+
- `yarn bazel build //packages/core/test/render3/perf:noop_change_detection`
8686
- `node --inspect-brk bazel-out/darwin-fastbuild/bin/packages/core/test/render3/perf/noop_change_detection.min_debug.js`

0 commit comments

Comments
 (0)