-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Preload standard library in ModuleInterfaceBuilder #36594
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
Conversation
This commit fixes two weird bugs in -verify mode: 1. SourceLocs from the wrong SourceManager could be passed through a ForwardingDiagnosticConsumer into the DiagnosticVerifier. 2. -verify-additional-file did not error out correctly when the file couldn’t be opened. No tests, as we only have basic tests for the diagnostic verifier.
@swift-ci please smoke test |
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.
LGTM! This could also be fixed by explicit module build.
Previously, when the standard library module interface was broken, Swift would try to rebuild it repeatedly during -compile-module-from-interface jobs because `ASTContext::getStdlibModule()` would try to load the standard library again each time it was called. This led to extremely slow compilations that repeatedly emitted the same errors. To avoid this, we make ModuleInterfaceBuilder try to load the standard library right away and bail out if it can’t. Fixes rdar://75669548.
8a59fd8
to
02c7476
Compare
@swift-ci please smoke test |
(Test needed to be tweaked for Windows.) |
@swift-ci please smoke test macOS platform |
@swift-ci please smoke test Linux platform |
This swift-driver error should have been cleared by swiftlang/swift-driver#571... @swift-ci please clean smoke test Linux platform |
@swift-ci please clean smoke test Linux platform |
@swift-ci please smoke test windows platform |
@swift-ci please smoke test |
I'm going to end up disabling the test on Windows, but I want to have information about the failure to file a bug. @swift-ci please smoke test windows platform |
@swift-ci please smoke test |
swiftlang#36928 changed the error message while swiftlang#36594 added a test case looking for the old error message. Update the test to look for the non-dynamic substring of the new error message.
Previously, when the standard library module interface was broken, Swift would try to rebuild it repeatedly during
-compile-module-from-interface
jobs becauseASTContext::getStdlibModule()
would try to load the standard library again each time it was called. This led to extremely slow compilations that repeatedly emitted the same errors, and sometimes to crashes in non-asserts compilers when they expected a standard library but couldn't find one.To avoid this, we make
ModuleInterfaceBuilder
try to load the standard library right away and bail out if it can’t.This PR also includes a couple of fixes for issues that occur when trying to use
-verify
mode with module interfaces. One of these (the SourceLoc translation issue) is implicitly exercised by the new test; the other is a simple command-line flag validation bug.Fixes rdar://75669548.