-
Notifications
You must be signed in to change notification settings - Fork 26.3k
fix(ngcc): re-enable killing ngcc (and CLI) via Ctrl-C #35861
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
fix(ngcc): re-enable killing ngcc (and CLI) via Ctrl-C #35861
Conversation
8ae0fad
to
e8936a3
Compare
The previous implementation mixed up the management of locking a piece of code (both sync and async) with the management of writing and removing the lockFile that is used as the flag for which process has locked the code. This change splits these two concepts up. Apart from avoiding the awkward base class it allows the `LockFile` implementation to be replaced cleanly.
e8936a3
to
6f26443
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
The CI failures seem legit 🤔
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/util.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/util.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/unlocker.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/test/locking/lockfile_with_child_process/unlocker_spec.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/unlocker.ts
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/ngcc/test/locking/lockfile_with_child_process/index_spec.ts
Outdated
Show resolved
Hide resolved
This version of `LockFile` creates an "unlocker" child-process that monitors the main ngcc process and deletes the lock file if it exits unexpectedly. This resolves the issue where the main process could not be killed by pressing Ctrl-C at the terminal. Fixes angular#35761
12f50c1
to
2ba269f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✨
14dad68
to
e5f5883
Compare
@petebacondarwin please rebase and make this work with the |
The previous implementation mixed up the management of locking a piece of code (both sync and async) with the management of writing and removing the lockFile that is used as the flag for which process has locked the code. This change splits these two concepts up. Apart from avoiding the awkward base class it allows the `LockFile` implementation to be replaced cleanly. PR Close #35861
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. |
Fixes #35761
For the moment I have left the old implementation in there too. We should probably remove it either as part of this PR or soonish, unless we decide that we want to make it configurable and allow people the different options.