angular/packages/bazel
Paul Gschwendtner dc72f3007a fix(bazel): ng module compilation workers are subject to linker race-conditions (#45393)
The Bazel NodeJS rules provide two ways of accessing node modules:

* A linker which creates a `node_modules` directory in the execroot/or in the runfiles.
* A patched module resolution where no node modules directory necessarily needs to exist.

The first is the default in `rules_nodejs` and the second is technically the most idiomatic
resolution mechanism in Bazel (as it matches with a runfile resolution library).

The linker is prone to race conditions in persistent workers, or non-sandbox environments (like
windows). This is because the linker for all workers will operate on a shared `execroot` directory
and the same `node_modules` directory is modified all the time / potentially conflicting with other
linker processes from other concurrently-running workers.

We rely on the patched module resolution anyway, but just need to disable the unused linker to avoid
issues like the following:

```
---8<---8<--- Start of log, file at /private/var/tmp/_bazel_splaktar/280f06d55552a0d01f89f0955b5acd78/bazel-workers/worker-8-TypeScriptCompile.log ---8<---8<---
[link_node_modules.js] An error has been reported: [Error: ENOENT: no such file or directory, unlink 'node_modules'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'unlink',
  path: 'node_modules'
} Error: ENOENT: no such file or directory, unlink 'node_modules'
---8<---8<--- End of log ---8<---8<---
INFO: Elapsed time: 12.796s, Critical Path: 5.39s
INFO: 645 processes: 477 internal, 12 darwin-sandbox, 156 worker.
```

PR Close #45393
2022-03-24 10:52:12 -07:00
..
docs refactor(bazel): remove old Angular CLI schematics and builder (#41575) 2021-04-13 13:01:59 -07:00
src fix(bazel): ng module compilation workers are subject to linker race-conditions (#45393) 2022-03-24 10:52:12 -07:00
test build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
third_party/github.com/bazelbuild/bazel/src/main/protobuf build: upgrade angular build, integration/bazel and @angular/bazel package to rule_nodejs 2.2.0 (#39182) 2020-10-08 11:54:59 -07:00
BUILD.bazel build: update visibility for npm package targets to work with new integration test structure (#44238) 2021-12-08 13:42:41 -05:00
index.bzl refactor(bazel): move ng_module.bzl file into sub-directory for consistent structure (#43431) 2021-10-01 18:28:42 +00:00
package.json feat(core): drop support for TypeScript 4.4 and 4.5 (#45394) 2022-03-24 10:51:47 -07:00