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): handle compilation diagnostics #31996
Conversation
2ff361d
to
00035a1
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.
One suggestion to avoid having to make up our own FormatDiagnosticHost
.
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.
😍
8738754
to
e8a2878
Compare
Blocked on a legit Codefresh failure. Instead of fixing it right away, we'll first make sure the emulated Windows FS mode behaves identical to the native Windows FS mode as to catch such failures earlier in the future. |
Good man @JoostK !! |
@JoostK sounds good! I'm gonna remove |
e8a2878
to
3ff6b7b
Compare
Oh no! We don't currently have a Windows CI as Codefresh configuration was recently removed. I deliberately did not rebase my branch hoping that Codefresh would still run on the branch, but that doesn't appear to be the case :-( @petebacondarwin I did add commit 3fdb4af which should resolve the discrepancy between emulated and native Windows mode. But unfortunately I can't test on native Windows now that Codefresh is gone... |
@gkalpak is sometimes able to run things on his Windows setup... |
// (see `MockFileSystemWindows`) so that the behavior is identical between native Windows and | ||
// emulated Windows mode. | ||
if (isWindows) { | ||
path = path.replace(/^[\/\\]/i, 'C:/') as T; |
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.
Nit: The i
flag is redundant (as is escaping /
inside [...]
😁).
As discussed "offline": I ran Running
The difference being that the actual error ends with
...to something like...
...makes all tests pass. Interestingly, hard-coding I am not sure what is the best way to solve this (e.g. normalize newlines in ts.formatDiagnostics() or fix the assertions, etc.). but normalizing newlines to |
3ff6b7b
to
78fdacc
Compare
Is this still blocked? |
I just rerun the tests on Windows and they passed 👍 |
The Angular compiler has an emulation system for various kinds of filesystems and runs its testcases for all those filesystems. This allows to verify that the compiler behaves correctly in all of the supported platforms, without needing to run the tests on the actual platforms. Previously, the emulated Windows mode would normalize rooted paths to always include a drive letter, whereas the native mode did not perform this normalization. The consequence of this discrepancy was that running the tests in native Windows was behaving differently compared to how emulated Windows mode behaves, potentially resulting in test failures in native Windows that would succeed for emulated Windows. This commit adds logic to ensure that paths are normalized equally for emulated Windows and native Windows mode, therefore resolving the discrepancy.
Previously, any diagnostics reported during the compilation of an entry-point would not be shown to the user, but either be ignored or cause a hard crash in case of a `FatalDiagnosticError`. This is unfortunate, as such error instances contain information on which code was responsible for producing the error, whereas only its error message would not. Therefore, it was quite hard to determine where the error originates from. This commit introduces behavior to deal with error diagnostics in a more graceful way. Such diagnostics will still cause the compilation to fail, however the error message now contains formatted diagnostics. Closes angular#31977 Resolves FW-1374
78fdacc
to
504f500
Compare
merge-assistance: job "legacy-unit-tests-saucelabs" is consistently timing out, unrelated to these changes. |
Previously, any diagnostics reported during the compilation of an entry-point would not be shown to the user, but either be ignored or cause a hard crash in case of a `FatalDiagnosticError`. This is unfortunate, as such error instances contain information on which code was responsible for producing the error, whereas only its error message would not. Therefore, it was quite hard to determine where the error originates from. This commit introduces behavior to deal with error diagnostics in a more graceful way. Such diagnostics will still cause the compilation to fail, however the error message now contains formatted diagnostics. Closes #31977 Resolves FW-1374 PR Close #31996
angular#31996) The Angular compiler has an emulation system for various kinds of filesystems and runs its testcases for all those filesystems. This allows to verify that the compiler behaves correctly in all of the supported platforms, without needing to run the tests on the actual platforms. Previously, the emulated Windows mode would normalize rooted paths to always include a drive letter, whereas the native mode did not perform this normalization. The consequence of this discrepancy was that running the tests in native Windows was behaving differently compared to how emulated Windows mode behaves, potentially resulting in test failures in native Windows that would succeed for emulated Windows. This commit adds logic to ensure that paths are normalized equally for emulated Windows and native Windows mode, therefore resolving the discrepancy. PR Close angular#31996
Previously, any diagnostics reported during the compilation of an entry-point would not be shown to the user, but either be ignored or cause a hard crash in case of a `FatalDiagnosticError`. This is unfortunate, as such error instances contain information on which code was responsible for producing the error, whereas only its error message would not. Therefore, it was quite hard to determine where the error originates from. This commit introduces behavior to deal with error diagnostics in a more graceful way. Such diagnostics will still cause the compilation to fail, however the error message now contains formatted diagnostics. Closes angular#31977 Resolves FW-1374 PR Close angular#31996
angular#31996) The Angular compiler has an emulation system for various kinds of filesystems and runs its testcases for all those filesystems. This allows to verify that the compiler behaves correctly in all of the supported platforms, without needing to run the tests on the actual platforms. Previously, the emulated Windows mode would normalize rooted paths to always include a drive letter, whereas the native mode did not perform this normalization. The consequence of this discrepancy was that running the tests in native Windows was behaving differently compared to how emulated Windows mode behaves, potentially resulting in test failures in native Windows that would succeed for emulated Windows. This commit adds logic to ensure that paths are normalized equally for emulated Windows and native Windows mode, therefore resolving the discrepancy. PR Close angular#31996
Previously, any diagnostics reported during the compilation of an entry-point would not be shown to the user, but either be ignored or cause a hard crash in case of a `FatalDiagnosticError`. This is unfortunate, as such error instances contain information on which code was responsible for producing the error, whereas only its error message would not. Therefore, it was quite hard to determine where the error originates from. This commit introduces behavior to deal with error diagnostics in a more graceful way. Such diagnostics will still cause the compilation to fail, however the error message now contains formatted diagnostics. Closes angular#31977 Resolves FW-1374 PR Close angular#31996
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. |
Previously, any diagnostics reported during the compilation of an
entry-point would not be shown to the user, but either be ignored or
cause a hard crash in case of a
FatalDiagnosticError
. This isunfortunate, as such error instances contain information on which code
was responsible for producing the error, whereas only its error message
would not. Therefore, it was quite hard to determine where the error
originates from.
This commit introduces behavior to deal with error diagnostics in a more
graceful way. Such diagnostics will still cause the compilation to fail,
however the error message now contains formatted diagnostics.
Closes #31977
Resolves FW-1374