Repository navigation
build(docs-infra): fix version mismatch of local built packages - #55282
Closed
devversion wants to merge 3 commits into
Closed
devversion wants to merge 3 commits into
devversion wants to merge 3 commits into
Conversation
devversion
force-pushed
the
filter-transitive-deps
branch
from
April 10, 2024 15:09
30754ef to
4607e73
Compare
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. angular#54858 (comment) - Compiler changes not being picked up. angular#54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support.
Similar to `aio`, disables caching inside Bazel as it would be discarded anyway and is likely a source of slowness then.
Similar to what we did for aio, we should not clear the architect CLI output in Bazel. This messes up with the output and makes debugging hard.
devversion
force-pushed
the
filter-transitive-deps
branch
from
April 10, 2024 15:24
4607e73 to
72b8373
Compare
devversion
marked this pull request as ready for review
April 10, 2024 15:24
|
Deployed adev-preview for 72b8373 to: https://ng-dev-previews-fw--pr-angular-angular-55282-adev-prev-cre620xx.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
Contributor
|
This PR was merged into the repository by commit 28b3c92. |
atscott
pushed a commit
that referenced
this pull request
Apr 10, 2024
Similar to `aio`, disables caching inside Bazel as it would be discarded anyway and is likely a source of slowness then. PR Close #55282
atscott
pushed a commit
that referenced
this pull request
Apr 10, 2024
Similar to what we did for aio, we should not clear the architect CLI output in Bazel. This messes up with the output and makes debugging hard. PR Close #55282
atscott
pushed a commit
that referenced
this pull request
Apr 10, 2024
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. #54858 (comment) - Compiler changes not being picked up. #54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support. PR Close #55282
atscott
pushed a commit
that referenced
this pull request
Apr 10, 2024
Similar to `aio`, disables caching inside Bazel as it would be discarded anyway and is likely a source of slowness then. PR Close #55282
atscott
pushed a commit
that referenced
this pull request
Apr 10, 2024
Similar to what we did for aio, we should not clear the architect CLI output in Bazel. This messes up with the output and makes debugging hard. PR Close #55282
iteriani
pushed a commit
to iteriani/angular
that referenced
this pull request
Apr 11, 2024
…lar#55282) There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. angular#54858 (comment) - Compiler changes not being picked up. angular#54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support. PR Close angular#55282
iteriani
pushed a commit
to iteriani/angular
that referenced
this pull request
Apr 11, 2024
Similar to `aio`, disables caching inside Bazel as it would be discarded anyway and is likely a source of slowness then. PR Close angular#55282
iteriani
pushed a commit
to iteriani/angular
that referenced
this pull request
Apr 11, 2024
…ar#55282) Similar to what we did for aio, we should not clear the architect CLI output in Bazel. This messes up with the output and makes debugging hard. PR Close angular#55282
Member
|
It looks like this change introduced a regression #55298 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is quite some trickery going on with the adev build related to
local packages:
/node_modulesHEADpackages for e.g.@angular/coretothe bundles.
@angular/corefrom/node_modules/— which is the core version fromnpm, transitively installed via
@angular/docs.This causes a version mismatch, leading to issues like:
This commit attempts to fix this by:
HEADpackages intoadev/node_modules. Thecurrent logic attempts to link into
/node_modules, but this does notoverride existing
@angular/core!@angular_devkit/build-angularintoadev/node_moduleswithout theirtransitive deps. This allows proper resolution of e.g. compiler as
node looks in
adev/node_modulesfirst, and falls back for the restto the execroot
node_modules, or symlink target destination (ifpreserveSymlinks=false).Note: This is still not 100% ideal because a direct external NPM
dependency may have a transitive dependency that has another transitive
dependency on
@angular/core. In those cases, the may be a conflictthat is not resolvable until we switch to a Bazel toolchain with better
first party resolution support.
Related to: #54858 (not closing because a real long-term sustainable fix is a better toolchain)