-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Cannot find 'URLRequest' in scope when building with the Static Linux SDK #5089
Comments
You'll need an |
@jrflat do you know if the |
Indeed, I think these parameters for the Static SDK build: Look like they're missing quite a few flags from the normal build: @etcwilde were these extra flags intentionally omitted? |
Oh ok, I thought that had changed with the new Foundation. |
I think the |
SSL should be available in the musl SDK since it includes BoringSSL, which that copy of curl should be getting compiled against. I don't believe SSL or SSH support are enabled for the copy of curl in the Windows Swift SDKs though either, so we may be able to disable that functionality. @al45tair, ideas on this? |
Having same issue while trying to compile application which uses FoundationNetworking command I'm using to build:
Here's logs: Repo where you can reproduce the issue: https://github.com/IlyaGulya/figma-export |
FYI, I managed to compile by adding some linker flags:
|
Passing linker flag provided by @IlyaGulya in the CLI works only if the package does not use build tool plugins. Otherwise building the build tool plugin fails. linkerSettings: [
.linkedLibrary("crypto"),
.linkedLibrary("icudata"),
.linkedLibrary("icuuc"),
.linkedLibrary("ssl"),
.linkedLibrary("z"),
] With that, you can even limit this to Linux: linkerSettings: [
.linkedLibrary("crypto", .when(platforms: [.linux])),
.linkedLibrary("icudata", .when(platforms: [.linux])),
.linkedLibrary("icuuc", .when(platforms: [.linux])),
.linkedLibrary("ssl", .when(platforms: [.linux])),
.linkedLibrary("z", .when(platforms: [.linux])),
] |
I would have expected these to be pulled in via autolinking, but maybe they aren't being. I note that the |
Looks like some autolink arguments went missing in the Foundation re-core. (I'm just testing a fix and then I'll raise a PR.) |
Still working on this; found another problem while building Foundation. Should have a PR to fix it all fairly soon. |
We don't need ICU for Foundation any more, so remove it and don't link it into the other libraries either. (See swiftlang/swift-corelibs-foundation#5089.)
@al45tair Hi! |
I haven't checked, but it's likely in the nightly builds already, assuming things built successfully. There's another issue (#5092) that I need to look at also, which I plan on looking at later today if I get the time. |
Update: we haven't had a nightly build since the 25th of September. It should be in the next nightly (on main). If you want to try doing a build of it in the meantime, you can grab the swift-docker repo, then look in Addendum: You also need to add (I'm actually doing this myself at the moment so I can look at #5092…) |
…nsChdir. We need a handful more autolink arguments; these were in a previous PR, but seem to have gone missing at some point during the re-core. Additionally, Musl has the `posix_spawn_file_actions_addchdir_np()` function rather than the non-`_np()` version. Fixes swiftlang#5089.
…nsChdir. We need a handful more autolink arguments; these were in a previous PR, but seem to have gone missing at some point during the re-core. Additionally, Musl has the `posix_spawn_file_actions_addchdir_np()` function rather than the non-`_np()` version. Fixes swiftlang#5089.
When building a Swift package executable using the Swift 6.0.1 toolchain and matching Static Linux SDK,
URLRequest
andURLSession
cannot be found.import FoundationNetworking
prevents those errors, but linking fails with errors such asld.lld: error: undefined symbol: SSL_get_peer_cert_chain
System info
OS: macOS 14.7
Xcode: 16.0 public release, 15.4
Swift: Apple Swift version 6.0.1 (swift-6.0.1-RELEASE) Target: arm64-apple-macosx14.0
Static Linux SDK: swift-6.0.1-RELEASE_static-linux-0.0.1
Output
Without FoundationNetworking
With FoundationNetworking
Package
Package.swift
Sources/FoundationTest/FoundationTest.swift
The text was updated successfully, but these errors were encountered: