-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add IsSDKRelative field to ModuleInterfaceLayout #77860
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
@swift-ci please test |
@swift-ci please test |
@swift-ci please 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
Do you know why it currently fails or where the compiler is using that path? I can see the cannot open file
error when running the test locally, but I would have expected that path to be used mostly for diagnostics or by the dependency scanner so I'm surprised the frontend tries to open the file.
I believe the test failure is unrelated, i'll give it another rebase to check |
Yeah the failure on However I meant to ask if you know why your test fails before your fix? Why is the compiler opening that file? |
Oh I see. The test fails because the deserialized swiftinterface path for B.swiftmodule is relative, but is not found in the SDK. When deserializing the compiler will construct its path relative to the SDK, and fails with:
This is raised here, while checking the dependencies of the module: swift/lib/Frontend/ModuleInterfaceBuilder.cpp Lines 159 to 163 in 9e7fa1a
|
@swift-ci please test |
Oh ok, we consider the swiftinterface as a dependency of the client swiftmodules to trigger a rebuild on upstream changes. That makes sense, thank you! |
When serializing the module interface path of an interface that is part of the SDK, we serialize relative to the SDK path. During deserialization we need to know if a path was serialized relative to the SDK or not. The existing logic assumes any relative path has been serialized relative to the SDK, which makes it impossible to compile modules from relative swiftinterface paths that are not part of the SDK. Update the swiftmodule file to include an attribute to show if the path was serialized relative to the SDK or not, which is used during deserialization to correctly reconstruct the interface path.
@swift-ci please test |
@swift-ci please smoke test |
@swift-ci please test |
@swift-ci please test |
@swift-ci please smoke test Linux Platform |
@swift-ci please smoke test macOS Platform |
When serializing the module interface path of an interface that is part of the SDK, we serialize relative to the SDK path. During deserialization we need to know if a path was serialized relative to the SDK or not. The existing logic assumes any relative path has been serialized relative to the SDK, which makes it impossible to compile modules from relative swiftinterface paths that are not part of the SDK.
Update the swiftmodule file to include an attribute to show if the path was serialized relative to the SDK or not, which is used during deserialization to correctly reconstruct the interface path.