119 Commits

Author SHA1 Message Date
Joey Perrott aa92f19307 build: update to bazel version 8.4.2
Update bazel to use version 8.4.2
2025-12-08 10:21:59 -08:00
Alan Agius 5a38aed388 build: move NG_FORCE_TTY environment variable
This moved the `NG_FORCE_TTY` from individual `ng_web_app` rules to a global Bazel build flag as this is also needed for integration tests that under the hood run `ng serve` .
2025-12-08 09:12:39 -08:00
Alan Agius 8693959fc7 build: use snapshot builds for dependencies in @angular/language-server (#64334)
This commit introduces a mechanism to use snapshot builds for @angular/language-service dependencies when building the VSCode extension.

A new --//:enable_snapshot_repo_deps flag allows swapping the stable versioned dependency with a snapshot build from the angular/language-server-builds GitHub repository. This enables testing and development against the latest unreleased version of the language service.

PR Close #64334
2025-10-10 06:48:51 -07:00
Joey Perrott 1fec2a2cb0 build: remove bazel flag usage for adev (#63845)
Previously we used a configuration flag for adev, instead we now separate into two different targets since our flag didn't
need to cause a full reanalysis to run since everything before the final target should be a cache hit.

PR Close #63845
2025-09-16 20:49:04 +00:00
Alan Agius 1c5fb1e5c1 build: enforce frozen lockfile mode (#63260)
This commit adds `lockfile_mode=error` to the `.bazelrc` file. This change ensures that any future builds will fail if the lock file is not up-to-date with the `BUILD.bazel` file, preventing inconsistencies and encouraging developers to commit updated lock files.

PR Close #63260
2025-08-20 16:00:05 +00:00
Joey Perrott 82cc576e6f build: use pnpm as the package manager instead of yarn (#62924)
Use pnpm instead of yarn as the package manager and interaction tool for the repo

PR Close #62924
2025-07-31 22:06:27 +00:00
Joey Perrott 90cb49462b build: migrate to @devinfra for toolchains (#62302)
Migrate the toolchains we depend on to use @devinfra instead of @npm//

PR Close #62302
2025-06-27 07:19:18 +00:00
Joey Perrott 1182fe7053 build: migrate to usages of @devinfra// instead of @npm//@angular/build-tooling (#62050)
Use workspace imported devinfra deps instead of npm dep

PR Close #62050
2025-06-16 10:23:30 +02:00
Paul Gschwendtner 0e7597bb82 build: enable merging of default shell_env and env in Bazel (#61566)
This is necessary to support later versions of e.g. `rules_ts`.

PR Close #61566
2025-05-29 14:39:11 -04:00
Paul Gschwendtner 1e86aa7871 build: --config=debug should not disable sandbox for all actions (#61468)
Instead of disabling sandbox/workers for every action; which also could
slow-down development turnaround significantly, the flag should only
disable sandboxing for the test actions; allowing for e.g. DevTools to
connect to them, even if they are inside the sandbox.

Arguably, this strategy isn't seemingly necessary in all environments,
but given that we enable network sandboxing in this repo, it seems
reasonable. Ideally we'd also expose `_debug` targets for e.g. Node
tests that have the proper no-sandbox, or requires-network tag.

PR Close #61468
2025-05-19 12:36:43 +00:00
Joey Perrott 1c7f669f33 build: setup rules_ts for compiling TypeScript sources (#61087)
This commit sets up `rules_ts`, providing the `ts_library` equivalent
for the `rules_js` migration.

PR Close #61087
2025-05-02 09:12:23 -07:00
Joey Perrott 059a2cb38e build: setup rules_js and link dependencies (#61087)
Sets up `rules_js` and links dependencies into the bazel-bin.

PR Close #61087
2025-05-02 09:12:23 -07:00
Joey Perrott cfa0591c8b build: update to bazel 6 (#61087)
This is necessary for an incremental migration to `rules_js` which
requires Bazel v6. Bazel v6 removed the managed directories feature,
which means we no longer can rely on symlinked node modules as the Bazel
repository; but rather need to duplicate dependencies. This is
okay/acceptable to enable the incremental migration.

PR Close #61087
2025-05-02 09:12:23 -07:00
Joey Perrott e400424563 ci: update bazel RBE setup on CI and use trusted build configuration for upstream CI runs (#60589)
Update to use the latest bazel/configure-remote action from dev-infra and set up trusted builds
for CI runs from upstream branches.

PR Close #60589
2025-03-27 18:16:09 +00:00
Joey Perrott 98bf4d5afd build: disable remote upload of local action results to RBE cache (#60568)
disable remote upload for local actions

PR Close #60568
2025-03-26 20:48:16 -07:00
Paul Gschwendtner eb867c3d23 build: upload grpc remote logs for debugging (#60393)
This should be helpful in figuring out why RBE is currently unstable.

PR Close #60393
2025-03-14 19:51:26 +01:00
Paul Gschwendtner 03a32ca6d2 build: enable remote execution keepalive (#60355)
This should help with network issues of spawned RBE actions. It should
also introduce timeouts when actions couldn't be spawned in a timely
manner.

PR Close #60355
2025-03-12 10:35:27 -07:00
Joey Perrott 9fced64146 ci: remove circleci as we no longer rely on it (#58615)
Remove CircleCI artifacts and configuration

PR Close #58615
2024-11-12 18:39:25 +00:00
Alan Agius 65de20c415 refactor(docs-infra): rename Bazel flag --prerender_adev to --full_build_adev (#58320)
This change updates the flag name for better clarity and specificity.

PR Close #58320
2024-10-23 08:04:11 -07:00
Joey Perrott 7ee9e7f386 fix(docs-infra): leverage http_server rule from @angular/build-tooling for adev local serving (#57427)
Use the http_server rule to serve adev locally to allow for slightly faster rebuilds and livereload on changes

PR Close #57427
2024-08-19 09:18:47 -07:00
Joey Perrott 0bd55a684f refactor(docs-infra): complete removal of aio directory (#56496)
Finish removal of aio directory as it is no longer used or relied upon.

PR Close #56496
2024-06-18 12:26:00 -07:00
Doug Parker eb1af1ed5c refactor(devtools): remove --config snapshot-build and leave a note for Firefox (#55717)
We removed display of the Git SHA in Angular DevTools in https://github.com/angular/angular/pull/55694, so there is no longer a need to stamp release builds in Chrome or Firefox.

I opted to leave a `--config snapshot-build-firefox` option as a no-op which a reader could follow to a comment explaining exactly _why_ we can't stamp Firefox releases. This should hopefully make it less likely that we forget and attempt to re-add this feature in the future only to encounter the same release problems.

PR Close #55717
2024-05-08 11:08:49 -07:00
Joey Perrott ade024407d fix(docs-infra): remove part aio infra (#54929)
Remove parts of the aio infra

PR Close #54929
2024-04-02 18:38:04 +00:00
Doug Parker 3e0b3a1ec4 refactor: add --spawn_strategy local to --config debug (#54167)
This seems to be necessary to debug Node tests.

PR Close #54167
2024-02-26 18:36:38 -08:00
Joey Perrott 9bc386e3f5 refactor(docs-infra): create fast mode (#54364)
Creates a "fast mode" for building the adev site, currently only disabling prerender during fast build.
This is intended to be used for local development.

PR Close #54364
2024-02-09 10:59:06 -08:00
JoostK eb0137de8a build: migrate project_id option to use bes_instance_name (#51696)
This commit update the RBE configuration to use `bes_instance_name` instead
of `project_id`, which got renamed [in Bazel 5.1][1]. Doing so avoids several warnings
in the CI output.

[1]: https://github.com/bazelbuild/bazel/commit/2b48c6b9a447756fcb3295b8a75899b96efa7fd4

PR Close #51696
2023-09-07 13:49:07 -07:00
Joey Perrott 743be79749 ci: migrate windows job to GHA (#51010)
Migrate windows job to use Github Actions

PR Close #51010
2023-07-17 14:51:36 +00:00
Paul Gschwendtner 39935ee005 build: do not attempt deflaking locally (#50852)
We've recently marked the ngtsc test as flaky for the Windows
job. We should not attempt running tests 3 times locally. This
negatively impacts the debugging/developer workflow.

Instead, flaky test attempts can still be made on CI. Using the
default attempt count of 3.

PR Close #50852
2023-06-26 13:38:17 -07:00
Paul Gschwendtner 4af49106aa build: speed up remote execution by allowing more concurrent jobs (#50734)
Bazel detects maximum number of jobs based on host resources.
Since we run remotely, we can increase this number significantly.

PR Close #50734
2023-06-20 18:05:24 +02:00
Paul Gschwendtner 2a4d9879db build: avoid unnecessary re-evaluation of starlark code (#49106)
The experimental allow tags propagation flag is a `BuildLanguage` option
and causes all Starlark code to be re-invoked. This causes a slow-down
when switching between bazel query/ bazel build because the option is not set for `bazel query`.

We fix it by applying the option to all commands, using `common`.

PR Close #49106
2023-02-16 15:31:55 -08:00
Paul Gschwendtner f72401091c build: fix AIO jobs not running with RBE and CircleCI Bazel settings (#48316)
The `.bazelrc` workspace file attempted to imported the `.bazelrc.user`
file. This user file is set on CI to include the CI specific Bazel
settings.

Apparently this user rc import does not work, and fails silently given
the `try-import`. It fails because for AIO Bazel commands we change
the working directory using `yarn --cwd aio` and the `try-import`
is relative to the working directory..

PR Close #48316
2022-12-02 08:57:43 -08:00
Derek Cormier 6948f0f0f3 build(bazel): fix AIO deployment script (#48188)
Don't run the script under Bazel, except for the tests. Configure a
Bazel flag to select the AIO build configuration.

PR Close #48188
2022-11-23 14:00:03 +00:00
Derek Cormier 2e823d3fb8 build(bazel): tweak parallel jobs for AIO local deps ci
Parallel runs of tests on circleci executor push RAM to the limits.
2022-11-22 13:51:16 -07:00
Derek Cormier 6cc3256018 build(bazel): fix linking of local angular packages
Npm angular deps were transitively being included, confusing the
rules_nodejs linker.
2022-11-22 13:51:16 -07:00
Derek Cormier 885d74f204 build(bazel): allow tag propagation on host machine
Fixes a bug where 'requires-network' tag was not propagated locally.
2022-11-22 13:51:16 -07:00
Derek Cormier 7bcefdcc63 build(bazel): selectively enable network access for some aio targets
By default network access is disabled for actions on ci.
2022-11-22 13:51:16 -07:00
Derek Cormier 50dee93f35 build(bazel): add aio targets to ci
This is a first pass. There is more work to do on package.json, adding
more test targets under bazel, and revising documentation.
2022-11-22 13:51:16 -07:00
Derek Cormier 22a317de3d build(bazel): stamp targets to build, test, and serve aio against
first party deps

Architect is not compatible with disabling the rules_nodejs linker so
these targets must use npm_link to link first party deps
2022-11-22 13:51:16 -07:00
Alan Agius ce59f1a14d test: delete bazel_ngtsc_plugin integration test (#47584)
This does not provide any added value.

PR Close #47584
2022-09-30 10:53:04 -07:00
Paul Gschwendtner b757b1387c build: update dev-infra packages and account for build-tooling split from ng-dev (#46976)
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.

PR Close #46976
2022-08-02 09:37:37 -07:00
Paul Gschwendtner d248d83c17 build: convert release package build scripts to typescript (#46456)
Follow-up to: cce395a928.

PR Close #46456
2022-06-22 14:35:31 -07:00
Derek Cormier 2c8fd2b57b build(bazel): enable runfiles (#46313)
Patches are required for tsec and rules_webtesting. The fix for
rules_webtesting was merged to that repo
(https://github.com/bazelbuild/rules_webtesting/commit/581b1557e382f93419da6a03b91a45c2ac9a9ec8)
but it's unclear when a release will be cut.

PR Close #46313
2022-06-14 16:58:19 +00:00
Paul Gschwendtner 5837fbd357 refactor: setup bazel integration test with new integration rule (#44238)
Sets up the Bazel integration test with the new integration rule. This
commit is separate from the other changes because it required some
additional work. i.e.

The test has moved from `integration/bazel` to `integration/<..>/bazel`
where `<..>` is a new Bazel package defining the integration test.

This is necessary because we could not declare the integration test
within the `BUILD.bazel` file actually being part of the nested bazel
workspace. In those cases we can just define it at a higher-level and
use integration test `working_dir` attribute.

PR Close #44238
2021-12-08 13:42:41 -05:00
Alex Rickabaugh aadfad739b build: remove view engine build infrastructure (#43884)
This commit removes --config=viewengine and makes Ivy the default for
building Angular.

PR Close #43884
2021-11-23 21:10:06 +00:00
Paul Gschwendtner bac03a95d7 ci: do not capture nested bazel integration test workspace within Bazel (#44061)
The `integration/bazel` folder cannot be excluded within the
`.bazelignore` file. This is necessary so that the integration test
rule can glob for all files within the integration test.

The downside is that the `integration/bazel/<..>` folder is being
discovered by the `//...` target query, causing Starlark files to
be interpreted/validated. e.g.

https://app.circleci.com/pipelines/github/angular/angular/39255/workflows/c6c448ed-9a44-49b3-a0c2-2c7328ce2855/jobs/1079169

Previously such errors did not appear because no Starlark `.bzl` files
within the test imported other files using the `//` absolute resolution.

Explicitly excluding the nested packages using the `--deleted_packages`
option is the most idiomatic way of achieving this currently (similarly
done by `rules_nodejs`). More information on why this is so verbose
currently:

https://github.com/bazelbuild/bazel/issues/12034

PR Close #44061
2021-11-05 16:22:17 +00:00
Joey Perrott 00d801122c build: Use Ivy compiler for bazel builds by default (#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 #43862
2021-10-19 10:06:54 -07:00
Joey Perrott 81e4257761 build: remove dev-infra directory and migrate to relying on @angular/dev-infra-private-builds (#43061)
Remove the dev-infra directory and complete the migration to using the code generated by the
angular/dev-infra repository.

PR Close #43061
2021-08-16 10:44:27 -07:00
Joey Perrott 2340cbcab8 build: update to new remote instance name for RBE (#42636)
Update to use remote instance name, primary_instance, for RBE

PR Close #42636
2021-06-24 08:28:57 -07:00
Paul Gschwendtner 50713310bf build: use platform from shared dev-infra package for remote execution (#41767)
Uses the new shared RBE platform from the dev-infra package.

PR Close #41767
2021-04-23 11:01:40 -07:00
Alex Rickabaugh b61c009c54 build: emit performance JSON file for each ng_module() (#41125)
A previous commit implemented a streamlined performance metric reporting
system for the compiler-cli, controlled via the compiler option
`tracePerformance`.

This commit adds a custom Bazel flag rule //packages/compiler-cli:ng_perf
to the repository, and wires it through to the `ng_module` implementation
such that if the flag is set, `ng_module` will produce perf results as part
of the build. The underlying mechanism of `//:ng_perf` is not exported from
`@angular/bazel` as a public rule that consumers can use, so there is little
risk of accidental dependency on the contents of these perf traces.

An alias is added so that `--ng_perf` is a Bazel flag which works in our
repository.

PR Close #41125
2021-03-24 13:42:25 -07:00