-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[SR-11427] Swift Package cannot depend on libxml2 from SDK reliably #4666
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
Comments
This is really an Xcode issue rather than a SwiftPM issue, since the same customization is necessary to use libxml2 from an Xcode project. Can you file a Feedback with Apple as well? (It may get marked as a duplicate, admittedly, but including your use case can sometimes help prioritize bugs.) |
Comment by Mickaël Rémond (JIRA) Xcode has some bug and I already filled a bug report for it to Apple but the issue is different. Xcode can build the project by just opening the Package.swift file and builds it without customization. |
I'm having a similar issue attempting to leverage libxml2 in an Xcode + SPM situation. I've tried both Mikaël's approach and a modulemap approach. To no avail. Have filed feedback with sample project: FB7229118. |
Comment by Mickaël Rémond (JIRA) I upgrade my setup to Xcode 11.0 GM: At least now, we have a consistent behaviour: Both Xcode or SwiftPM build cannot properly find the libxml2 headers. So, it is unclear now how to properly set this up. Was the fact that Xcode was building fine the project a bug and what would be the preferred way to build a code depending on libxml2 ? |
Environment
XCode 11.0 beta 6 (11M392r) on Mac.
Swift version 5.0.2 (swift-5.0.2-RELEASE) on Linux.
Additional Detail from JIRA
md5: 2f9c0246a74459b446772053d0c4d921
Issue Description:
I have a library (Swift package) depending on libxml2.
The project builds properly under Xcode 11 beta, but cannot be build with SwiftPM without manually passing the include dir of the libxml2 headers.
If I issue just swift build it fails with the following error:
I have to use the following commands to build the project from command-line:
On MacOs:
On Linux:
The project is public and available here: https://github.com/FluuxIO/XMPP
I expect that given the fact that I defined libxml2 as a dependency in the target, with linkerSettings, SwiftPM would know how to find one of its system library (from the SDK).
Here is the Package.swift that I used: https://github.com/FluuxIO/XMPP/blob/master/Package.swift
The text was updated successfully, but these errors were encountered: