ngcc: add build marker#25557
Conversation
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
You can preview 03b6121 at https://pr25557-03b6121.ngbuilds.io/. |
gkalpak
left a comment
There was a problem hiding this comment.
AFAICT, more logic is needed. E.g. when we detect that a package has been compiled by a different ngcc version.
I.e. we need a way to "uncompile" before compiling with the new version. ("Uncompiling" could be as simple as rimrafing node_modules_ngtsc/ or as complex as walking node_modules/ and renaming all backup files to their original name.)
I think we also need to record the compilations output path (e.g. node_modules/ or node_modules_ngtsc/) in the marker metadata.
There was a problem hiding this comment.
Couldn't we use @angular/compiler-cli VERSION instead?
There was a problem hiding this comment.
I would rather not have a dependency on compiler-cli if we can avoid it. That version is created in exactly the same way as this anyway.
There was a problem hiding this comment.
Hm...I thought ngcc will be part of the compiler-cli package anyway.
In any case, not a big deal 😁
There was a problem hiding this comment.
To give more strength to this approach I can also say that I conferred with Alex Eagle about the best approach here as well :-)
03b6121 to
a616204
Compare
|
You can preview a616204 at https://pr25557-a616204.ngbuilds.io/. |
|
We should avoid trying to "uncompile" at this stage. The backups are there if we need them for adding such a strategy later. In the meantime I will add a message telling the user to blow away their node_modules if the ngcc version changes. |
a616204 to
a35ec67
Compare
|
You can preview a35ec67 at https://pr25557-a35ec67.ngbuilds.io/. |
|
You can preview 02c2f33 at https://pr25557-02c2f33.ngbuilds.io/. |
02c2f33 to
a6e05a5
Compare
|
CLAs look good, thanks! |
|
You can preview a6e05a5 at https://pr25557-a6e05a5.ngbuilds.io/. |
|
We just need to work out what to do about the failing integration test: bazel tests do not allow the subject to write over the node_modules of the test folder. |
`ngcc` adds marker files to each folder that has been compiled, containing the version of the ngcc used. When compiling, it will ignore folders that contain these marker files, as long as the version matches.
a6e05a5 to
137a198
Compare
Bazel does not like the filesystem being modified. This commit a temporary mock filesystem that can be modified as needed.
137a198 to
736507f
Compare
|
You can preview 137a198 at https://pr25557-137a198.ngbuilds.io/. |
|
You can preview 736507f at https://pr25557-736507f.ngbuilds.io/. |
|
I have implemented an (in-memory) mock filesystem for the integration test that was failing. |
Bazel does not like the filesystem being modified. This commit a temporary mock filesystem that can be modified as needed. PR Close #25557
|
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 sits on top of #25406