Skip to content

Prevent manifest load errors from causing SwiftPM to display "fatalError" in CLI #3262

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

This is the main thread cherry-pick of #3261

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

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.

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@tomerd tomerd merged commit 3158d58 into swiftlang:main 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