-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running ngcc in postinstall. Angular CLI should not run as part of the build step #38216
Comments
It is hard to tell what might be going on. Any chance you could put together a reproduction, @Rush? |
@gkalpak ok will do! |
@gkalpak Please see this repo for a reproducible test case https://github.com/Rush/ngcc-issue-repro/blob/master/README.md
Please let me know if you have any questions or need additional clarity. |
With Angular 10, it seems to have worsened. We did an upgrade PR and now the CI doesn't even pass in a single run (CI worker completely free).
|
@Rush, based on your last comment I wonder whether you have accidentally cached a stale Other than that, everything seems to work as expected. If you have run Is this different from what you are seeing? |
Good theory. Unfortunately I checked it by disabling cache, removing node_modules before, removing all
Definitely not what I'm seeing. In Angular 9 - the builds are timing out before ngcc gets unblocked (if CI machine is busy running multiple builds) We'll try to provide a better test case for Angular 10 which shows the crash. @gkalpak my point is that if files are pre-generated shouldn't ngcc not run at all? It seems it would be nice to be able to delete it completely. Anyway - will try harder to produce a better reproducible test case. |
Neither
You might want to open a feature request on the CLI repo. In the meantime, it would be interesting to try "manually" disabling the However, the idea with the current way things work is that you should not need to worry about |
@Rush - is it that |
@petebacondarwin Not the cleanest way to debug but here you go .. :-)
and it's always printing
And then I checked on my machine by setting
Of course ... Docker is running on root. So root will always have write access, regardless of file write flags. To summarize:
And the root cause for failures is still unknown. |
Hi @Rush - I just wanted to come back to you on this. I spent some time today trying to get some timings from the reproduction you provided (https://github.com/Rush/ngcc-issue-repro). What I have found is that ngcc is indeed being triggered (as expected) for each of the 5 builds that are kicked off in parallel.
What this means in practice is that your overall build (of around 90secs in this repro) is delayed by up to 400ms x 5 = 2secs. I am loathe to add a |
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. |
🐞 bug report / feature request
This issue is a follow up to #35000
Affected Package
@angular/compiler-cli
Is this a regression?
Maybe - #35000
Description
The advice in #35000 (comment) from @Toxicable was to set up a postinstall hook like so:
the angular cli wont run it as part of it's build step. <- this is the key part I would expect to happen but it doesn't seem to be the case. as I see ngcc being run in my build for every webpack build
Unfortunately when CI is busy with other work the max retries is used up and the build fails. We have about 10 parallel builds of different flavors of our Angular App so there is A LOT of parallelism going on.
Would it be possible to disable NGCC in ngtools/webpack builds when the dependencies have already been compiled before? @Toxicable @petebacondarwin @AndrewKushnir @gkalpak
🌍 Your Environment
Angular Version:
Angular: 9.1.0
The text was updated successfully, but these errors were encountered: