-
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
URLSession not usable when compiled with Static Linux SDK #5092
Comments
cc @al45tair |
We have the same problem. We have also tried many variants.
Unfortunately, none of this worked. I also tried several Linux Static SDK versions, unfortunately always the same behavior. The really strange thing is also that when we compile the source code with Docker. This means that we create a builder container in which the source code is compiled and then transferred to a productive container. We are referring here to the Dockerfile from Vapor. |
For comparison, do you get the same results with https://github.com/swift-server/async-http-client if you have a chance to try that out? |
@MaxDesiatov Nope, async-http-client works. I've actually switched the project that I found this bug initially over to async-http-client and now it works. |
FWIW, I'd started trying to look at this, but got stuck because of another problem; hopefully that issue will have worked its way through now and I'll be able to get back to looking at this. |
Using the following
Package.swift
:With the following
Sources/main.swift
:Which is then built using the Swift Static Linux SDK (
swift build -c release --swift-sdk "x86_64-swift-linux-musl"
), leads to the following error when run (on e.g. an Ubuntu 24.04 machine):Note the
NSURLErrorDomain Code=-1
which isNSURLErrorUnknown
.It doesn't matter which url is used, the result is always the same.
Tested using Swift 6.0.1 and Swift Static Linux SDK 0.0.1.
It's also irrelevant whether the executable is built on macOS or Linux.
The text was updated successfully, but these errors were encountered: