Commit Graph

60 Commits

Author SHA1 Message Date
Greg Magolan dff4e1e19c refactor: simplify bazel saucelabs targets using karma pre-test wrapper and shared saucelabs connection between tests (#34769)
* Added a /tools/saucelabs/sauce-service.sh script that manages the sauce-connect as a service which is used by the karma-saucelabs.js wrapper to start the service.
* Added /tools/saucelabs/README.md that covers the details of SauceLabs karma testing with Bazel.

PR Close #34769
2020-01-28 13:47:00 -08:00
Joey Perrott b5e9264579 build: add --stamp flag to the release config (#34890)
In a recent upgrade of rules_nodejs an update was made the
stamping logic in npm_package.  Triggering stamping for npm_package
now require the --stamp flag.

PR Close #34890
2020-01-22 12:34:12 -05:00
Joey Perrott 6d7d2e439c build: remove remaining internal references to define=compile flag (#33983)
Now that all compile decisions are determined by the define=angular_ivy_enabled
flag, we can remove the setting of the define=compile flag throughout the repo.

PR Close #33983
2019-11-26 16:38:40 -05:00
Joey Perrott f9def8cd30 build: create --config=ivy flag to set the angular_ivy_enabled define flag value (#33983)
Beginning of migration away from --define=compile=* to --define=angular_ivy_enabled=*.
Additionally, to make it clearer to developers, we will encourage use of --config=ivy
instead of directy setting the --define flag, this abstraction will allow us more
flexibility as we move foward with relation to our compile decisions at build time.

PR Close #33983
2019-11-26 16:38:40 -05:00
Joey Perrott 346e1c14d9 build: update setup-rbe.sh script and documentation to remove http-remote-cache config (#33907)
We have determined that the upload time cost of remote caching via http is too costly
to be effective for our distributed usage scenario.  However this cost is still worth
it for us for Windows CI runs on a full cache hit move from a ~60 minute task to ~10
minutes.

It is worth noting that this remote http-caching is entirely separate from RBE caching
mechanisms.

PR Close #33907
2019-11-21 10:45:57 -08:00
Joey Perrott c68200cf42 build: remove rollup-rule temp settings (#33908)
PR Close #33908
2019-11-18 16:02:25 -08:00
Joey Perrott 90c3d98dd9 build: force RBE runs to use linux remote executors (#33902)
PR Close #33902
2019-11-18 16:02:10 -08:00
Joey Perrott 7caed51c24 build: add --nolegacy_external_runfiles flag for build (#33500)
PR Close #33500
2019-10-31 10:21:07 -07:00
Greg Magolan 7193e151d7 build: update to @bazel/bazel 1.0.0 (#33476)
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 https://github.com/bazelbuild/bazel/issues/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 https://github.com/bazelbuild/bazel/issues/7480 for more details.

Not updating to Bazel 1.1.0 yet due to a docker permissions CI issue that was observed on the angular repo that is unresolved. See https://github.com/angular/angular/pull/33367#issuecomment-547643246.

PR Close #33476
2019-10-29 16:22:41 -07:00
Joey Perrott 649093c0ec build: remove --nowatchfs flag as --watchfs is a noop on windows now (#33471)
PR Close #33471
2019-10-29 14:05:47 -07:00
Greg Magolan eb0d8c09e3 build: temporarily set `build --define=enable_legacy_rollup_rule=1` in bazelrc (#33426)
Temporary define while angular depends on the legacy rollup_bundle rule. This will be removed after https://github.com/angular/angular/pull/33201 lands.

PR Close #33426
2019-10-28 10:13:36 -07:00
Greg Magolan e4e8dbdee0 revert: build: update to @bazel/bazel 1.0.0 (#33367) (#33407)
This reverts commit 348615be62.

PR Close #33407
2019-10-25 10:24:58 -07:00
Greg Magolan f085fd5666 revert: build: address review comments in .bazelrc (#33367) (#33407)
This reverts commit aa36b55bd9.

PR Close #33407
2019-10-25 10:24:58 -07:00
Greg Magolan aa36b55bd9 build: address review comments in .bazelrc (#33367)
PR Close #33367
2019-10-25 09:22:13 -07:00
Greg Magolan 348615be62 build: update to @bazel/bazel 1.0.0 (#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 https://github.com/bazelbuild/bazel/issues/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 https://github.com/bazelbuild/bazel/issues/7480 for more details.

PR Close #33367
2019-10-25 09:22:13 -07:00
Joey Perrott 418e9cf3c4 build: address comments, restructure setup-rbe.sh script (#33109)
PR Close #33109
2019-10-21 15:56:52 -04:00
Joey Perrott 37a87418b6 build: migrate to using google_default_credentials and update setup-rbe script (#33109)
PR Close #33109
2019-10-21 15:56:51 -04:00
Joey Perrott 2ea52b0cb9 build: remove cache upload and download flags from build:remote config as they are redundant (#33109)
PR Close #33109
2019-10-21 15:56:51 -04:00
Joey Perrott 931739ac73 build: remove BES config until BES API can be used by end user accounts (#33109)
PR Close #33109
2019-10-21 15:56:51 -04:00
Joey Perrott af1f27e756 build: set up remote http caching flag (#32983)
PR Close #32983
2019-10-10 13:57:53 -07:00
Joey Perrott 894c4b5390 ci: use automatic selection strategies (#32678)
Removes the selection strategies for `AngularTemplateCompile` and `TypeScriptCompile` causing
them to use the automatic selection strategies instead.

PR Close #32678
2019-09-16 15:35:37 -07:00
Joey Perrott a84b5ef81b build: use bazel workers for ngc and tsc in local development (#32246)
PR Close #32246
2019-08-21 15:21:52 -07:00
Filipe Silva 0b1bf14cd8 ci: use circleci windows preview (#31266)
PR Close #31266
2019-08-19 13:32:14 -07:00
Joey Perrott 43163523f6 ci: move bazel saucelabs execution to script to be used across all Angular repos (#32141)
PR Close #32141
2019-08-16 09:57:23 -07:00
Joey Perrott 19a28e599b build: Add incompatible_list_based_execution_strategy_selection flags back in (#31471)
PR Close #31471
2019-07-12 11:38:16 -04:00
Alex Eagle 14ad7562c6 build: use remote actions for TS/NG compilations on CircleCI (#31471)
PR Close #31471
2019-07-12 11:38:16 -04:00
Joey Perrott e92fb68f3c build: remove usage of deprecated experimental_ui bazel flag (#31457)
PR Close #31457
2019-07-09 13:50:01 -07:00
Greg Magolan 64e7af4e43 build(bazel): add build --incompatible_list_based_execution_strategy_selection=false flag (#31325)
This option is changed to true in Bazel 0.27 and exposes a possible
regression in Bazel 0.27.0.
Error observed is in npm_package target `//packages/common/locales:package`:
```
ERROR: /home/circleci/ng/packages/common/locales/BUILD.bazel:13:1: Assembling
npm package packages/common/locales/package failed: No usable spawn strategy found
for spawn with mnemonic SkylarkAction.  Your --spawn_strategyor --strategy flags
are probably too strict. Visit https://github.com/bazelbuild/bazel/issues/7480 for
migration advises
```
Suspect is https://github.com/bazelbuild/rules_nodejs/blob/master/internal/npm_package/npm_package.bzl#L75-L82:
```
 execution_requirements = {
    # Never schedule this action remotely because it's not computationally expensive.
    # It just copies files into a directory; it's not worth copying inputs and outputs to a remote worker.
    # Also don't run it in a sandbox, because it resolves an absolute path to the bazel-out directory
    # allowing the .pack and .publish runnables to work with no symlink_prefix
    # See https://github.com/bazelbuild/rules_nodejs/issues/187
    "local": "1",
},
```

PR Close #31325
2019-07-01 14:16:42 -07:00
Greg Magolan 361109d80f build: update to rules_nodejs 0.32.2 (#31325)
Brings in ts_library fixes required to get angular/angular building after 0.32.0:
typescript: exclude typescript lib declarations in node_module_library transitive_declarations
typescript: remove override of @bazel/tsetse (+1 squashed commit)

@npm//node_modules/foobar:foobar.js labels changed to @npm//:node_modules/foobar/foobar.js with fix for bazelbuild/rules_nodejs#802

also updates to rules_rass commit compatible with rules_nodejs 0.32.0

PR Close #31325
2019-07-01 14:16:42 -07:00
Greg Magolan b7a099d27e build(bazel): update to bazel 0.27.0 and fix compat in @angular/bazel package (#31325)
ctx.actions.declare_file now used in @angular/bazel ng_module rule as ctx.new_file is now deprecated. Fixes error:

```
        File "ng_module.bzl", line 272, in _expected_outs
                ctx.new_file(ctx.genfiles_dir, (ctx.label.name ..."))
Use ctx.actions.declare_file instead of ctx.new_file.
Use --incompatible_new_actions_api=false to temporarily disable this check.
```

This can be worked around with incompatible_new_actions_api flag but may as well fix it proper so downstream doesn't require this flag due to this code.

Also, depset() is no longer iterable by default without a flag. This required fixing in a few spots in @angular/bazel.

fix: foo

PR Close #31325
2019-07-01 14:16:42 -07:00
Alex Rickabaugh 280e8563f0 Revert "build(bazel): update to bazel 0.27.0 and fix compat in @angular/bazel package (#31019)" (#31267)
This reverts commit 28d3bfc416.

Reason: this causes failures in g3 with i18n extraction. See #31267.

PR Close #31267
2019-06-25 14:36:01 -07:00
Alex Rickabaugh 660800ca4e Revert "build: update to rules_nodejs 0.32.2 (#31019)" (#31267)
This reverts commit a38433f36b.

Reason: this causes failures in g3 with i18n extraction. See #31267.

PR Close #31267
2019-06-25 14:36:00 -07:00
Alex Rickabaugh 35acd44a07 Revert "build(bazel): add build --incompatible_list_based_execution_strategy_selection=false flag (#31019)" (#31267)
This reverts commit ab27337612.

Reason: this causes failures in g3 with i18n extraction. See #31267.

PR Close #31267
2019-06-25 14:36:00 -07:00
Joey Perrott e8d0265c1e ci: enable remote build caching for CI jobs (#31204)
Enables remote caching for CI jobs.

This configuration:

always reads from build cache on CI
only write to build cache for local builds for non-PR CI run

PR Close #31204
2019-06-25 10:26:43 -07:00
Greg Magolan ab27337612 build(bazel): add build --incompatible_list_based_execution_strategy_selection=false flag (#31019)
This option is changed to true in Bazel 0.27 and exposes a possible
regression in Bazel 0.27.0.
Error observed is in npm_package target `//packages/common/locales:package`:
```
ERROR: /home/circleci/ng/packages/common/locales/BUILD.bazel:13:1: Assembling
npm package packages/common/locales/package failed: No usable spawn strategy found
for spawn with mnemonic SkylarkAction.  Your --spawn_strategyor --strategy flags
are probably too strict. Visit https://github.com/bazelbuild/bazel/issues/7480 for
migration advises
```
Suspect is https://github.com/bazelbuild/rules_nodejs/blob/master/internal/npm_package/npm_package.bzl#L75-L82:
```
 execution_requirements = {
    # Never schedule this action remotely because it's not computationally expensive.
    # It just copies files into a directory; it's not worth copying inputs and outputs to a remote worker.
    # Also don't run it in a sandbox, because it resolves an absolute path to the bazel-out directory
    # allowing the .pack and .publish runnables to work with no symlink_prefix
    # See https://github.com/bazelbuild/rules_nodejs/issues/187
    "local": "1",
},
```

PR Close #31019
2019-06-25 10:21:07 -07:00
Greg Magolan a38433f36b build: update to rules_nodejs 0.32.2 (#31019)
Brings in ts_library fixes required to get angular/angular building after 0.32.0:
typescript: exclude typescript lib declarations in node_module_library transitive_declarations
typescript: remove override of @bazel/tsetse (+1 squashed commit)

@npm//node_modules/foobar:foobar.js labels changed to @npm//:node_modules/foobar/foobar.js with fix for bazelbuild/rules_nodejs#802

also updates to rules_rass commit compatible with rules_nodejs 0.32.0

PR Close #31019
2019-06-25 10:21:07 -07:00
Greg Magolan 28d3bfc416 build(bazel): update to bazel 0.27.0 and fix compat in @angular/bazel package (#31019)
ctx.actions.declare_file now used in @angular/bazel ng_module rule as ctx.new_file is now deprecated. Fixes error:

```
        File "ng_module.bzl", line 272, in _expected_outs
                ctx.new_file(ctx.genfiles_dir, (ctx.label.name ..."))
Use ctx.actions.declare_file instead of ctx.new_file.
Use --incompatible_new_actions_api=false to temporarily disable this check.
```

This can be worked around with incompatible_new_actions_api flag but may as well fix it proper so downstream doesn't require this flag due to this code.

Also, depset() is no longer iterable by default without a flag. This required fixing in a few spots in @angular/bazel.

fix: foo

PR Close #31019
2019-06-25 10:21:06 -07:00
Joey Perrott 131e2440f2 build: Set up Build Event Service Configuration for RBE executed bazel (#31197)
The Build Event Service (https://docs.bazel.build/versions/master/build-event-protocol.html#the-build-event-service),
allows for build events from bazel builds to be transmitted as opaque bytes to be processed.

Our usage is to send our build events to a Build Event Service an Angular team owned Google Cloud Project which collects
build results and makes each invocation available via a provided URL to view.  The information uploaded includes information
about the build environment, configuration, build status/events, build options, results and actions.

Build Event Protocol Proto: https://github.com/bazelbuild/bazel/blob/0.27.0/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto

PR Close #31197
2019-06-21 15:28:50 -07:00
Paul Gschwendtner 7b3bcc23af build: user bazelrc should be able to overwrite all flags (#31164)
After eb00a37eb8 we accidentally regressed due to some
recent changes where more flags were added at the end of the bazelrc. This means that all
flags which were added after the `try-import` can no longer be overwritten easily in the
user project bazelrc file. Technically developers can always overwrite flags though the
command line, but it's a productivity blocker if developers can't permanently overwrite these
flags  through the user config

PR Close #31164
2019-06-20 11:18:12 -07:00
Greg Magolan a794143820 build(bazel): update to nodejs rules 0.31.1 (#30627)
* entry_point attribute of nodejs_binary & rollup_bundle is now a label
* symlinking of node_modules for yarn_install temporarily disabled (except for integration/bazel) until the fix for https://github.com/bazelbuild/bazel/issues/8487 makes it into a future bazel release

PR Close #30627
2019-06-11 00:03:11 +00:00
Greg Magolan ba83d33dd0 build(bazel): update to nodejs rules 0.30.1 & bazel 0.26.0 (#30627)
nodejs rules 0.30.1 has new feature to symlink node_modules with yarn_install and bazel 0.26.0 includes new managed_directories feature which enables this

PR Close #30627
2019-06-11 00:03:11 +00:00
Xin Gao 9abf114fbb feat(bazel): use rbe_autoconfig() and new container. (#29336)
After this PR is merged, maintainers no longer need to update .bazelrc
file, toolchain and platform related flags for RBE builds and tests
(unless there is a breaking change in Bazel related to those flags).

Maintainers just need to update the pin of @bazel-toolchains repo
regularly in the packages/bazel/package.bzl file according to
https://releases.bazel.build/bazel-toolchains.html to include the
latest checked-in toolchain configs. If rbe_autoconfig() cannot find
appropriate toolchain configs for the version of Bazel in the version of
@bazel_toolchains repo that is currently used by this project, it will pull
down the container and generate the configs on the fly as the beginning
of the build/test.

PR Close #29336
2019-05-09 14:58:34 -07:00
Yun Peng 701da0099b build: Remove --watchfs from bazelrc file (#29635)
--watchfs is causing the build to be flaky on Windows because Bazel
doesn't have proper support for watchfs on Windows, but it doesn't seem
to bring much performance on Linux, either.

Fixes: https://github.com/angular/angular/issues/29541

PR Close #29635
2019-04-01 14:57:30 -07:00
Alex Eagle aaa8a3a957 build: update bazel to 0.24 (#29530)
PR Close #29530
2019-03-27 13:45:29 -07:00
Alex Eagle 410ccacf38 build: disable tsc_wrapped workers (#29197)
Angular devs are hitting a bug with typings forcing them to run "bazel shutdown"

PR Close #29197
2019-03-14 13:11:36 -04:00
Paul Gschwendtner eb00a37eb8 build: user bazelrc should be able to overwrite existing flags (#29279)
Currently the project `bazelrc` file imports a user bazelrc if present. This
has been added in order to allow user-specific Bazel configuration settings
when working within the Angular project. Since we currently import that
user configuration before setting the project-specific settings, it's not
possible for developers to overwrite given options (e.g. the `symlink_prefix`).

Moving the import to the end of the file solves that problem.

PR Close #29279
2019-03-13 10:38:58 -07:00
Greg Magolan 75357ecb32 build(bazel): run a number of web tests with karma_web_test in saucelabs in CircleCI (#27721)
PR Close #27721
2019-02-22 13:07:08 -08:00
Greg Magolan e4f67dfe66 build(bazel): update to bazel 0.22.0 and turn on --incompatible_strict_action_env flag (#28404)
PR Close #28404
2019-01-28 11:48:41 -08:00
Alex Eagle 9a965c9145 build: create dist/bin symlink with Bazel outputs (#27781)
Note that we had nasty problems in the past when this was enabled, but those have supposedly been fixed.

PR Close #27781
2019-01-22 09:52:46 -08:00
Filipe Silva d6cfe2ed7e build: use cross platform workspace_status_command (#27431)
PR Close #27431
2019-01-09 10:47:13 -08:00