-
Notifications
You must be signed in to change notification settings - Fork 18
generator/linux: Use swiftResourcesPath to find framework headers #155
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci test |
a6aa907
to
77671c9
Compare
@swift-ci test |
MaxDesiatov
reviewed
Nov 27, 2024
MaxDesiatov
approved these changes
Nov 27, 2024
77671c9
to
7841011
Compare
@swift-ci test |
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 * This change fixes issue swiftlang#152. Compared to swiftlang#153, the end-to-end tests now pass for all supported Swift versions, distributions and architectures. | SDK | Hello World | Foundation | | ----------------------------------------- | ----------- | ---------- | | ubuntu_aarch64_5.9.2-RELEASE | ok | ok | | ubuntu_aarch64_5.9.2-RELEASE_with-docker | ok | ok | | ubuntu_aarch64_5.10.1-RELEASE | ok | ok | | ubuntu_aarch64_5.10.1-RELEASE_with-docker | ok | ok | | ubuntu_aarch64_6.0.2-RELEASE | ok | ok | | ubuntu_aarch64_6.0.2-RELEASE_with-docker | ok | ok | | | | | | ubuntu_x86_64_5.9.2-RELEASE | ok | ok | | ubuntu_x86_64_5.9.2-RELEASE_with-docker | ok | ok | | ubuntu_x86_64_5.10.1-RELEASE | ok | ok | | ubuntu_x86_64_5.10.1-RELEASE_with-docker | ok | ok | | ubuntu_x86_64_6.0.2-RELEASE | ok | ok | | ubuntu_x86_64_6.0.2-RELEASE_with-docker | ok | ok | | | | | | rhel_aarch64_5.9.2-RELEASE_with-docker | ok | ok | | rhel_aarch64_5.10.1-RELEASE_with-docker | ok | ok | | rhel_aarch64_6.0.2-RELEASE_with-docker | ok | ok | | | | | | rhel_x86_64_5.9.2-RELEASE_with-docker | ok | ok | | rhel_x86_64_5.10.1-RELEASE_with-docker | ok | ok | | rhel_x86_64_6.0.2-RELEASE_with-docker | ok | ok | FAIL1: cannot find /lib/ld-linux-aarch64.so.1 (swiftlang#147) FAIL2: missing required module '_FoundationCShims' (swiftlang#152) Fixes: swiftlang#152 Depends on: swiftlang#153, swiftlang#154
7841011
to
8e3f228
Compare
@swift-ci test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 SDKgenerator don't copy these files into /usr/include; instead they
set the
swiftResourcesPath
andswiftStaticResourcesPath
fieldsin
swift-sdk.json
, which causes the build system to look in thosepaths 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 theframework header definitions are duplicated:
This change fixes issue #152. Compared to #153, the end-to-end
tests now pass for all supported Swift versions, distributions and
architectures.
FAIL1: cannot find /lib/ld-linux-aarch64.so.1 (#147)
FAIL2: missing required module '_FoundationCShims' (#152)
Fixes: #152
Depends on: #153, #154