Skip to content

[ModuleInterface] Update wording of the "failed to build module" error #35590

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
Jan 27, 2021

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jan 25, 2021

The error shown when the compiler fails to build a module from its textual interface has been creating some confusion. This is a proposal to make it more useful to the programmer not working in the SDK, insist on looking at the previous errors first, put less emphasis on possible compiler bugs, and always show alternatives to the incompatible compilers issue as this is the most common case now.

Copy link
Contributor

@beccadax beccadax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an improvement, but I wonder if we could go further. For instance:

  • Would people be more likely to look at the specific failures if they came after this message instead of before it?
  • Would it be better to emit this diagnostic as a note attached to each error diagnosed from the module interface? (We'd also need a fallback in case building somehow failed without emitting any errors.)
  • Would it make sense to split some parts of this diagnostic, like the various hypothetical explanations, into separate notes attached to the top-level error?

@xymus xymus force-pushed the reword-module-build-error branch from 248906c to fc962a5 Compare January 26, 2021 19:40
@xymus
Copy link
Contributor Author

xymus commented Jan 26, 2021

@beccadax I'm hesitant on how to reach a good middle ground that would display well in both Xcode and the build logs. A notable problem with these diagnostics in the build logs are the prefix that has the full path to the swiftinterface files in the SDK. Moving the hypothetical explanations to notes would work well for direct imports for example but would become more verbose when displayed for an indirect import.

@xymus
Copy link
Contributor Author

xymus commented Jan 26, 2021

@swift-ci Please smoke test

@xymus xymus changed the title [WIP][ModuleInterface] Update wording of the "failed to build module" error [ModuleInterface] Update wording of the "failed to build module" error Jan 26, 2021
The error shown when the compiler fails to build a module from its
textual interface has been creating some confusion. This is a proposal
to make it more useful to the programmer not working in the SDK, insist
on looking at the previous errors first, put less emphasis on possible
compiler bugs, and always show alternatives to the incompatible
compilers issue as this is the most common case now.
@xymus xymus force-pushed the reword-module-build-error branch from fc962a5 to b79c7b6 Compare January 26, 2021 23:37
@xymus
Copy link
Contributor Author

xymus commented Jan 26, 2021

@swift-ci Please smoke test

@xymus xymus merged commit fe4d46c into swiftlang:main Jan 27, 2021
@xymus xymus deleted the reword-module-build-error branch January 27, 2021 02:52
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