-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Different linker issue: SwiftPM uses swiftc and Xcode use clang #6512
Comments
Is this really specific to plugins or to |
So is this an intended behavior? Then how should we add link symbol framework search path via swiftc? We can use And if the two use/support different argument parameters, how can we diff them in Package.swift file? |
Oh, Yes. I just try to build it directly via So the problem is So the problem has nothing to do with SPM plugin. |
Find the corresponding flag for So we need to use something like the following snippest. This is very strange for me.
Is there a way to make Xcode IDE also using "swiftc" when linking or make SwiftPM using "clang" when linking. (Because I'd like to support both Xcode and CLI SPM to build the package) @neonichu |
I think this has come up before, the solution has to be some sort of conditionality of unsafe flags, as we do not want to allow users to choose the linker. |
Temporary fixed by https://gist.github.com/Kyle-Ye/9e960dad379e0ded065be366b4233a6c |
Description
The normal build for a executableTarget with linkerSettings of ["-iframework", "/System/Library/PrivateFrameworks/"] will call
ld
throughclang
which have no problem identifying "-iframework".However if we start the build via packageManager.build in a CommandPlugin, it will use
.build/release.yaml
file's content to do the linking. And it will callld
throughswiftc
which have problem identifying "-iframework".Expected behavior
Build call success on command plugin.
Actual behavior
Build call fail on command plugin.
Steps to reproduce
791c0018d88a7b1f113fed7444f4781fa9d25a6d
swift package codesign
and enter yes.Swift Package Manager version/commit hash
release/5.8
Swift & OS version (output of
swift --version ; uname -a
)The text was updated successfully, but these errors were encountered: