-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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(compiler-cli): updates ngc
to pass the build when only warnings are emitted
#43673
Conversation
17dd41e
to
bdde505
Compare
@alxhub is this required for v13 so |
Chatted in Slack, the deprecating warning won't make v13 anyways so no need to get this in. |
bdde505
to
d3b3da8
Compare
d3b3da8
to
0a0a25f
Compare
0a0a25f
to
8eb6a56
Compare
… are emitted Refs angular#42966. Previously, a build when emitted one warning and no errors would fail with a non-zero exit code. This is not what users would expect, but had not been an issue before since the compiler did not actually emit any warnings. With upcoming extended template diagnostics and other warnings, this is now a case that needs to be supported. Warnings are printed to `stderr` as before, but `ngc` now exits with code `0` and the build is considered successful. Implemented this by adding a new `expectedExitCode` parameter to `driveDiagnostics()` which asserts against the real exit code. Most importantly, it does not **require** the the build to pass since any exit code can be given, so it is up to the test to assert this as well as many messages printed to make sure they are acceptable. This is useful for testing warnings and ensuring the build still passes.
8eb6a56
to
e0a15ef
Compare
This PR was merged into the repository by commit b2b5972. |
… are emitted (#43673) Refs #42966. Previously, a build when emitted one warning and no errors would fail with a non-zero exit code. This is not what users would expect, but had not been an issue before since the compiler did not actually emit any warnings. With upcoming extended template diagnostics and other warnings, this is now a case that needs to be supported. Warnings are printed to `stderr` as before, but `ngc` now exits with code `0` and the build is considered successful. Implemented this by adding a new `expectedExitCode` parameter to `driveDiagnostics()` which asserts against the real exit code. Most importantly, it does not **require** the the build to pass since any exit code can be given, so it is up to the test to assert this as well as many messages printed to make sure they are acceptable. This is useful for testing warnings and ensuring the build still passes. PR Close #43673
@dgp1130 there was a merge conflict with the 12.2.x branch, so I merged the change to master and 13.0.x. If this change needs to land in 12.2.x, could you please create a new PR with the necessary changes? Thank you. |
@AndrewKushnir, considering |
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. |
Refs #42966.
Previously, a build when emitted one warning and no errors would fail with a non-zero exit code. This is not what users would expect, but had not been an issue before since the compiler did not actually emit any warnings. With upcoming extended template diagnostics and other warnings, this is now a case that needs to be supported. Warnings are printed to
stderr
as before, butngc
now exits with code0
and the build is considered successful.Implemented this by adding a new
driveMainWithWarnings()
test method which returns the exit code and any messages logged tostderr
. Most importantly, it does not require the the build to pass, so it is up to the test to assert this as well as many messages printed to make sure they are acceptable. This is useful for testing warnings and ensuring the build still passes.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #42966.
ngc
fails when a compilation returns warnings but no errors. It should succeed as long as no errors are emitted, regardless of any warnings.What is the new behavior?
ngc
now exits with code 0 (passes) when a compilation returns no errors, even if warnings are emitted.Does this PR introduce a breaking change?
The compiler does not currently produce warnings, so there is no change in behavior. This is intended to unblock future compiler changes.
Other information
/cc @atscott.