-
Notifications
You must be signed in to change notification settings - Fork 16
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
generator/linux: Use swiftResourcesPath
to find framework headers
#139
generator/linux: Use swiftResourcesPath
to find framework headers
#139
Conversation
Building with a Swift 6.0 SDK fails because the new `_FoundationCShims` framework headers can't be found: <unknown>:0: error: missing required module '_FoundationCShims' The necessary files are present in `$PLATFORM.sdk/usr/lib/swift`, but are not part of the list which is copied to `$PLATFORM.sdk/usr/include`. The Static Linux SDK and WASM SDK generator don't copy these files into /usr/include; instead they set the `swiftResourcesPath` and `swiftStaticResourcesPath` fields in `swift-sdk.json`, which causes the build system to look in those paths for framework headers. We can do the same for Linux SDKs, however we must stop copying the files to `/usr/include`, otherwise the build will fail because the framework header definitions are duplicated: error: redefinition of module 'DispatchIntrospection' 6 | } 7 | 8 | module DispatchIntrospection [system] [extern_c] { | `- error: redefinition of module 'DispatchIntrospection' 9 | header "introspection.h" 10 | export *
@swift-ci 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.
Great find, thanks!
How hard would it be to add a test for this to our test suite?
The EndToEnd test would already catch it if it was run with Swift 6.0, but we currently only run tests in CI on macOS: ...but the EndToEnd tests are skipped on macOS 😞:
|
I see, I'll try look into running tests on Linux then at some point. |
I have another PR in progress to fix an |
I think this would need a matrix job to set |
Building with a Swift 6.0 SDK fails because the new
_FoundationCShims
framework headers can't be found:The necessary files are present in
$PLATFORM.sdk/usr/lib/swift
, but are not part of the list which is copied to$PLATFORM.sdk/usr/include
. The Static Linux SDK and WASM SDK generator don't copy these files into /usr/include; instead they set theswiftResourcesPath
andswiftStaticResourcesPath
fields inswift-sdk.json
, which causes the build system to look in those paths for framework headers.We can do the same for Linux SDKs, however we must stop copying the files to
/usr/include
, otherwise the build will fail because the framework header definitions are duplicated:Partial fix for #138