1- # Enable debugging tests with --config=debug
2- test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
3-
4- # By default, network access should be disabled unless explicitly granted for certain targets
5- # using the `requires-network` tag. https://docs.bazel.build/versions/main/be/common-definitions.html
6- build --sandbox_default_allow_network=false
7- test --sandbox_default_allow_network=false
8-
9- # Frozen lockfile
10- common --lockfile_mode=error
111
122# Required by `rules_ts`.
133common --@aspect_rules_ts//ts:skipLibCheck=always
144common --@aspect_rules_ts//ts:default_to_tsc_transpiler
15- # TODO(josephperrott): remove this flag once we get to bazel version >7.
16- common --incompatible_merge_fixed_and_default_shell_env
17-
18- # Turn off legacy external runfiles
19- build --nolegacy_external_runfiles
20- run --nolegacy_external_runfiles
21- test --nolegacy_external_runfiles
225
236# The nested Bazel integration test workspace should not be analysed as part of
247# Skyframe, but should also not be ignored in order to be able to glob for its files.
258# TODO: Simplify this once https://github.com/bazelbuild/bazel/issues/12034 is fixed
269build --deleted_packages=bazel/integration/tests/nested_bazel_workspaces/basic
2710query --deleted_packages=bazel/integration/tests/nested_bazel_workspaces/basic
2811
29- ###############################
30- # Filesystem interactions #
31- ###############################
32-
33- # Create symlinks in the project:
34- # - dist/bin for outputs
35- # - dist/testlogs, dist/genfiles
36- # - bazel-out
37- build --symlink_prefix=dist/
38-
39- # Write testing errors to log on test failure
40- test --test_output=errors
41-
42- # Do not build runfile forests by default. If an execution strategy relies on runfile
43- # forests, the forest is created on-demand. See: https://github.com/bazelbuild/bazel/issues/6627
44- # and https://github.com/bazelbuild/bazel/commit/03246077f948f2790a83520e7dccc2625650e6df. This
45- # also helps with: https://github.com/bazelbuild/bazel/issues/4327#issuecomment-922106293.
46- build --nobuild_runfile_links
47-
48- # Turn on --incompatible_strict_action_env which was on by default
49- # in Bazel 0.21.0 but turned off again in 0.22.0. Follow
50- # https://github.com/bazelbuild/bazel/issues/7026 for more details.
51- # This flag is needed to so that the bazel cache is not invalidated
52- # when running bazel via `yarn bazel`.
53- # See https://github.com/angular/angular/issues/27514.
54- build --incompatible_strict_action_env
55- run --incompatible_strict_action_env
56- test --incompatible_strict_action_env
57-
58- ################################
59- # Remote Execution Setup #
60- ################################
61-
62- # Use the Angular team internal GCP instance for remote execution.
63- build:remote --remote_instance_name=projects/internal-200822/instances/primary_instance
64- build:remote --bes_instance_name=internal-200822
65-
66- # Needed due to: https://github.com/bazelbuild/bazel/issues/7254
67- build:remote --define=EXECUTOR=remote
68-
69- # Since remote builds run within Google Cloud `k8`-based containers, we set the
70- # host and target CPU accordingly.
71- build:remote --cpu=k8
72- build:remote --host_cpu=k8
73-
74- # Bazel detects maximum number of jobs based on host resources.
75- # Since we run remotely, we can increase this number significantly.
76- common:remote --jobs=100
77-
78- # Setup the remote build execution servers.
79- build:remote --remote_cache=remotebuildexecution.googleapis.com
80- build:remote --remote_executor=remotebuildexecution.googleapis.com
81- build:remote --google_default_credentials
82-
83- # Setup the toolchain and platform for the remote build execution. The platform
84- # is provided by the shared dev-infra package and targets k8 remote containers.
85- build:remote --extra_execution_platforms=//bazel/remote-execution:platform_with_network
86- build:remote --host_platform=//bazel/remote-execution:platform_with_network
87- build:remote --platforms=//bazel/remote-execution:platform_with_network
88-
89- # Set remote caching settings
90- build:remote --remote_accept_cached=true
91- build:remote --remote_upload_local_results=false
92-
93- # Enable Build Event Service
94- build:remote --bes_backend=buildeventservice.googleapis.com
95- build:remote --bes_instance_name=internal-200822
96- build:remote --bes_header=X-Goog-User-Project=internal-200822
97- build:remote --bes_results_url=https://source.cloud.google.com/results/invocations
98- build:remote --bes_upload_mode=fully_async
99-
100- # Use HTTP remote cache
101- build:remote-cache --remote_cache=https://storage.googleapis.com/angular-team-cache
102- build:remote-cache --remote_accept_cached=true
103- build:remote-cache --remote_upload_local_results=false
104- build:remote-cache --google_default_credentials
105-
106-
107- # Additional flags added when running a "trusted build" with additional access
108- build:trusted-build --remote_upload_local_results=true
109-
110- ################################
111- # Release setup #
112- ################################
113-
114- # Releases should always be stamped with version control info. The dev-infra project
115- # does not have actual versions so we need to skip version stamping. Our NPM package
116- # will have a version composed with the current SHA from the SCM stamping info.
117- # Note: We usually would use the `ng-dev` tool directly, but that one would need to be
118- # built with Bazel and building with Bazel inside the Bazel-invoked workspace status
119- # script does not work. To workaround this, we have a `tsx`-based stamping script.
120- # TODO: Consider using `ng-dev` directly if this is possible.
121- build:release --workspace_status_command="pnpm --silent build-env-stamp --mode=release --include-version=false"
122- build:release --stamp
123-
124- ####################################################
125- # User bazel configuration
126- # NOTE: This needs to be the *last* entry in the config to allow for it to override other
127- # configuration in this file.
128- ####################################################
129-
130- # Load any settings which are specific to the current user. Needs to be *last* statement
131- # in this config, as the user configuration should be able to overwrite flags from this file.
132- try-import .bazelrc.user
12+ import .bazelrc.common
0 commit comments