Fixed missing -lcurl when building with -static-stdlib and FoundationNetworking#206
Open
grigorye wants to merge 1 commit intoswiftlang:mainfrom
Open
Fixed missing -lcurl when building with -static-stdlib and FoundationNetworking#206grigorye wants to merge 1 commit intoswiftlang:mainfrom
grigorye wants to merge 1 commit intoswiftlang:mainfrom
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
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.
swift:nightlynow allows building standalone/statically linked executables with something likeHowever, if you import FoundationNetworking in your sources, that makes you add more libraries explicitly for linking to resolve the missing symbols:
and yet that is not enough, because it can not resolve
-lcurlthat is probably originating from https://github.com/apple/swift-corelibs-foundation/blob/76068b8caf54f250a7be5336a7c6bb97f55469f8/CoreFoundation/URL.subproj/static/module.mapIt manifests as something like below (I quote just a part of long list of missing
curl_family of functions):This PR solves it by adding dev package for libcurl (libcurl4-openssl-dev, containing static variant of the library) into the image.
I'm not sure about the flavor though given that there're three variants for Ubuntu:
P.S. You can take a look at the sample reproducing the problem here: https://github.com/grigorye/SwiftDockerLCURLSample
To reproduce the problem, clone the repo and do
docker build .: