|
| 1 | +# Disable NG CLI TTY mode |
| 2 | +build --action_env=NG_FORCE_TTY=false |
| 3 | + |
| 4 | +# Required by `rules_ts`. |
| 5 | +common --@aspect_rules_ts//ts:skipLibCheck=always |
| 6 | +common --@aspect_rules_ts//ts:default_to_tsc_transpiler |
| 7 | + |
| 8 | +# Make TypeScript compilation fast, by keeping a few copies of the compiler |
| 9 | +# running as daemons, and cache SourceFile AST's to reduce parse time. |
| 10 | +build --strategy=TypeScriptCompile=worker |
| 11 | + |
| 12 | +# Enable debugging tests with --config=debug |
| 13 | +test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results |
| 14 | + |
| 15 | +# Enable debugging tests with --config=no-sharding |
| 16 | +# The below is useful to while using `fit` and `fdescribe` to avoid sharing and re-runs of failed flaky tests. |
| 17 | +test:no-sharding --flaky_test_attempts=1 --test_sharding_strategy=disabled |
| 18 | + |
| 19 | +# Frozen lockfile |
| 20 | +common --lockfile_mode=error |
| 21 | + |
| 22 | +############################### |
| 23 | +# Filesystem interactions # |
| 24 | +############################### |
| 25 | + |
| 26 | +# Create symlinks in the project: |
| 27 | +# - dist/bin for outputs |
| 28 | +# - dist/testlogs, dist/genfiles |
| 29 | +# - bazel-out |
| 30 | +# NB: bazel-out should be excluded from the editor configuration. |
| 31 | +# The checked-in /.vscode/settings.json does this for VSCode. |
| 32 | +# Other editors may require manual config to ignore this directory. |
| 33 | +# In the past, we saw a problem where VSCode traversed a massive tree, opening file handles and |
| 34 | +# eventually a surprising failure with auto-discovery of the C++ toolchain in |
| 35 | +# MacOS High Sierra. |
| 36 | +# See https://github.com/bazelbuild/bazel/issues/4603 |
| 37 | +build --symlink_prefix=dist/ |
| 38 | + |
| 39 | +# Turn off legacy external runfiles |
| 40 | +build --nolegacy_external_runfiles |
| 41 | + |
| 42 | +# Turn on --incompatible_strict_action_env which was on by default |
| 43 | +# in Bazel 0.21.0 but turned off again in 0.22.0. Follow |
| 44 | +# https://github.com/bazelbuild/bazel/issues/7026 for more details. |
| 45 | +# This flag is needed to so that the bazel cache is not invalidated |
| 46 | +# when running bazel via `pnpm bazel`. |
| 47 | +# See https://github.com/angular/angular/issues/27514. |
| 48 | +build --incompatible_strict_action_env |
| 49 | +run --incompatible_strict_action_env |
| 50 | +test --incompatible_strict_action_env |
| 51 | + |
| 52 | +# Enable remote caching of build/action tree |
| 53 | +build --experimental_remote_merkle_tree_cache |
| 54 | + |
| 55 | +# Ensure that tags applied in BUILDs propagate to actions |
| 56 | +common --incompatible_allow_tags_propagation |
| 57 | + |
| 58 | +# Ensure sandboxing is enabled even for exclusive tests |
| 59 | +test --incompatible_exclusive_test_sandboxed |
| 60 | + |
| 61 | +############################### |
| 62 | +# Saucelabs support # |
| 63 | +# Turn on these settings with # |
| 64 | +# --config=saucelabs # |
| 65 | +############################### |
| 66 | + |
| 67 | +# Expose SauceLabs environment to actions |
| 68 | +# These environment variables are needed by |
| 69 | +# web_test_karma to run on Saucelabs |
| 70 | +test:saucelabs --action_env=SAUCE_USERNAME |
| 71 | +test:saucelabs --action_env=SAUCE_ACCESS_KEY |
| 72 | +test:saucelabs --action_env=SAUCE_READY_FILE |
| 73 | +test:saucelabs --action_env=SAUCE_PID_FILE |
| 74 | +test:saucelabs --action_env=SAUCE_TUNNEL_IDENTIFIER |
| 75 | +test:saucelabs --define=KARMA_WEB_TEST_MODE=SL_REQUIRED |
| 76 | + |
| 77 | +############################### |
| 78 | +# Release support # |
| 79 | +# Turn on these settings with # |
| 80 | +# --config=release # |
| 81 | +############################### |
| 82 | + |
| 83 | +# Releases should always be stamped with version control info |
| 84 | +# This command assumes node on the path and is a workaround for |
| 85 | +# https://github.com/bazelbuild/bazel/issues/4802 |
| 86 | +build:release --workspace_status_command="pnpm -s ng-dev release build-env-stamp --mode=release" |
| 87 | +build:release --stamp |
| 88 | + |
| 89 | +build:snapshot --workspace_status_command="pnpm -s ng-dev release build-env-stamp --mode=snapshot" |
| 90 | +build:snapshot --stamp |
| 91 | +build:snapshot --//:enable_snapshot_repo_deps |
| 92 | + |
| 93 | +build:e2e --workspace_status_command="pnpm -s ng-dev release build-env-stamp --mode=release" |
| 94 | +build:e2e --stamp |
| 95 | +test:e2e --test_timeout=3600 --experimental_ui_max_stdouterr_bytes=2097152 |
| 96 | + |
| 97 | +# Retry in the event of flakes |
| 98 | +test:e2e --flaky_test_attempts=2 |
| 99 | + |
| 100 | +build:local --//:enable_package_json_tar_deps |
| 101 | + |
| 102 | +############################### |
| 103 | +# Output # |
| 104 | +############################### |
| 105 | + |
| 106 | +# A more useful default output mode for bazel query |
| 107 | +# Prints eg. "ng_module rule //foo:bar" rather than just "//foo:bar" |
| 108 | +query --output=label_kind |
| 109 | + |
| 110 | +# By default, failing tests don't print any output, it goes to the log file |
| 111 | +test --test_output=errors |
| 112 | +################################ |
| 113 | +# Remote Execution Setup # |
| 114 | +################################ |
| 115 | + |
| 116 | +# Use the Angular team internal GCP instance for remote execution. |
| 117 | +build:remote --remote_instance_name=projects/internal-200822/instances/primary_instance |
| 118 | +build:remote --bes_instance_name=internal-200822 |
| 119 | + |
| 120 | +# Starting with Bazel 0.27.0 strategies do not need to be explicitly |
| 121 | +# defined. See https://github.com/bazelbuild/bazel/issues/7480 |
| 122 | +build:remote --define=EXECUTOR=remote |
| 123 | + |
| 124 | +# Setup the remote build execution servers. |
| 125 | +build:remote --remote_cache=remotebuildexecution.googleapis.com |
| 126 | +build:remote --remote_executor=remotebuildexecution.googleapis.com |
| 127 | +build:remote --remote_timeout=600 |
| 128 | +build:remote --jobs=150 |
| 129 | + |
| 130 | +# Setup the toolchain and platform for the remote build execution. The platform |
| 131 | +# is provided by the shared dev-infra package and targets k8 remote containers. |
| 132 | +build:remote --extra_execution_platforms=@devinfra//bazel/remote-execution:platform_with_network |
| 133 | +build:remote --host_platform=@devinfra//bazel/remote-execution:platform_with_network |
| 134 | +build:remote --platforms=@devinfra//bazel/remote-execution:platform_with_network |
| 135 | + |
| 136 | +# Set remote caching settings |
| 137 | +build:remote --remote_accept_cached=true |
| 138 | +build:remote --remote_upload_local_results=false |
| 139 | + |
| 140 | +# Force remote executions to consider the entire run as linux. |
| 141 | +# This is required for OSX cross-platform RBE. |
| 142 | +build:remote --cpu=k8 |
| 143 | +build:remote --host_cpu=k8 |
| 144 | + |
| 145 | +# Set up authentication mechanism for RBE |
| 146 | +build:remote --google_default_credentials |
| 147 | + |
| 148 | +# Use HTTP remote cache |
| 149 | +build:remote-cache --remote_cache=https://storage.googleapis.com/angular-team-cache |
| 150 | +build:remote-cache --remote_accept_cached=true |
| 151 | +build:remote-cache --remote_upload_local_results=false |
| 152 | +build:remote-cache --google_default_credentials |
| 153 | + |
| 154 | +# Additional flags added when running a "trusted build" with additional access |
| 155 | +build:trusted-build --remote_upload_local_results=true |
| 156 | + |
| 157 | +# Fixes issues with browser archives and files with spaces. Could be |
| 158 | +# removed in Bazel 8 when Bazel runfiles supports spaces. |
| 159 | +build --experimental_inprocess_symlink_creation |
| 160 | + |
| 161 | +#################################################### |
| 162 | +# rules_js specific flags |
| 163 | +#################################################### |
| 164 | + |
| 165 | +# TODO(josephperrott): investigate if this can be removed eventually. |
| 166 | +# Prevents the npm package extract from occuring or caching on RBE which overwhelms our quota |
| 167 | +build --modify_execution_info=NpmPackageExtract=+no-remote |
| 168 | + |
| 169 | +# Allow the Bazel server to check directory sources for changes. `rules_js` previously |
| 170 | +# heavily relied on this, but still uses directory "inputs" in some cases. |
| 171 | +# See: https://github.com/aspect-build/rules_js/issues/1408. |
| 172 | +startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1 |
| 173 | + |
| 174 | +#################################################### |
| 175 | +# User bazel configuration |
| 176 | +# NOTE: This needs to be the *last* entry in the config. |
| 177 | +#################################################### |
| 178 | + |
| 179 | +# Load any settings which are specific to the current user. Needs to be *last* statement |
| 180 | +# in this config, as the user configuration should be able to overwrite flags from this file. |
| 181 | +try-import .bazelrc.user |
0 commit comments