Skip to content

[5.4] Prevent manifest load errors from causing SwiftPM to display "fatalError" in CLI #3261

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

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

abertelrud
Copy link
Contributor

@abertelrud abertelrud commented Feb 12, 2021

Looks like Diagnostics.fatalError is used to throw errors when appropriate diagnostics have already been emitted and the only goal is to quickly return to the caller. This is documented in TSCUtility.

Future cleanup should avoid this special behavior.

Motivation:

This prevents an ugly extra line of output

Changes:

It prevents Diagnostics.fatalError from being added to the diagnostics engine, in a way that's similar to how it is done in some other places.

rdar://74263826

…ror" in CLI

Looks like `Diagnostics.fatalError` is used to throw errors when appropriate diagnostics have already been emitted and the only goal is to quickly return to the caller.  This is documented in TSCUtility.

Future cleanup should avoid this special behavior.

rdar://74263826
@abertelrud
Copy link
Contributor Author

@swift-ci please test

@abertelrud abertelrud self-assigned this Feb 12, 2021
@abertelrud abertelrud added the 5.4 label Feb 12, 2021
@abertelrud
Copy link
Contributor Author

I have been looking for how to add a better unit test for this that than a test fixture. So far I have not been able to trigger it from tests.

@tomerd tomerd changed the title Prevent manifest load errors from causing SwiftPM to display "fatalError" in CLI [5.4] Prevent manifest load errors from causing SwiftPM to display "fatalError" in CLI Feb 12, 2021
@tomerd tomerd merged commit 70f81bb into swiftlang:release/5.4 Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants