Skip to content

ngcc: add build marker#25557

Closed
petebacondarwin wants to merge 3 commits into
angular:masterfrom
petebacondarwin:ngcc-build-marker
Closed

ngcc: add build marker#25557
petebacondarwin wants to merge 3 commits into
angular:masterfrom
petebacondarwin:ngcc-build-marker

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

This sits on top of #25406

@petebacondarwin petebacondarwin added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release comp: ivy labels Aug 17, 2018
@petebacondarwin petebacondarwin added this to the Ivy milestone Aug 17, 2018
@petebacondarwin petebacondarwin requested a review from alxhub August 17, 2018 21:03
@googlebot
Copy link
Copy Markdown

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 cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@mary-poppins
Copy link
Copy Markdown

You can preview 03b6121 at https://pr25557-03b6121.ngbuilds.io/.

Copy link
Copy Markdown
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we use @angular/compiler-cli VERSION instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm...I thought ngcc will be part of the compiler-cli package anyway.
In any case, not a big deal 😁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To give more strength to this approach I can also say that I conferred with Alex Eagle about the best approach here as well :-)

@mary-poppins
Copy link
Copy Markdown

You can preview a616204 at https://pr25557-a616204.ngbuilds.io/.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

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.

@mary-poppins
Copy link
Copy Markdown

You can preview a35ec67 at https://pr25557-a35ec67.ngbuilds.io/.

@mary-poppins
Copy link
Copy Markdown

You can preview 02c2f33 at https://pr25557-02c2f33.ngbuilds.io/.

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@mary-poppins
Copy link
Copy Markdown

You can preview a6e05a5 at https://pr25557-a6e05a5.ngbuilds.io/.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

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.
Bazel does not like the filesystem being modified.
This commit a temporary mock filesystem that can be modified as needed.
@mary-poppins
Copy link
Copy Markdown

You can preview 137a198 at https://pr25557-137a198.ngbuilds.io/.

@mary-poppins
Copy link
Copy Markdown

You can preview 736507f at https://pr25557-736507f.ngbuilds.io/.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

I have implemented an (in-memory) mock filesystem for the integration test that was failing.
This allows the test to be able to write to the node_modules folder safely. It could also allow
us to do more subtle testing of file changes at this level, going forward.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Awaiting G3 resubmit and pullapprove for integration test.
^^^ @alxhub or @mhevery

@alxhub alxhub added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 5, 2018
@mhevery mhevery closed this in b0cb134 Sep 5, 2018
mhevery pushed a commit that referenced this pull request Sep 5, 2018
Bazel does not like the filesystem being modified.
This commit a temporary mock filesystem that can be modified as needed.

PR Close #25557
@petebacondarwin petebacondarwin deleted the ngcc-build-marker branch September 6, 2018 07:38
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants