-
Notifications
You must be signed in to change notification settings - Fork 331
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
Can't build KissXML/libxml_module in Xcode 8 #65
Comments
Ohhhhh yes. I'm definitely not happy about how Apple left developers to create their own modulemaps for libxml, CommonCrypto, sqlite, etc. We are also missing modulemaps for a bunch of other platforms like watch and tv. SQLite.swift has a number of them here: https://github.com/stephencelis/SQLite.swift/blob/master/SQLite.swift.podspec#L35 I'm not sure how we could support both easily in the same podspec, but perhaps in the readme we could point people to a Xcode-beta branch? Oh yeah another issue is people running 10.12 and not Xcode-beta, and Xcode-beta and 10.11... :( |
What I'm a little confused about is why the The flag is property included in the |
I'm wondering if a better route would be to remove all references to libxml from the public headers. It seems easy to fix in DDXMLNode without breaking backwards compatibility but NSString+DDXML might be trickier because the public API exposes xmlChar directly. Even though xmlChar is just a typedef for unsigned char, I don't see a great way to fix it without introducing tons of warnings into people's projects, or breaking things entirely. |
Is there any way it's pulling in two modulemaps for both beta and non-beta? I guess if the ifdef isn't working it's not pulling in anything though.. |
I started tinkering with having a nested beta subspec under
and then
Still a WIP to see if I can get it working. I'm still wrapping my head around the modulemap stuff, so I don't even know if having a second file named something other than module.modulemap even works... |
I thiiink it needs to be named module.modulemap, so perhaps put it in a different folder. You also need to make sure that the modulemap folder path is included in the header search paths: https://github.com/robbiehanson/KissXML/blob/master/KissXML.podspec#L34 |
Ya, you're right. I pulled that and just tried changing the paths in module.modulemap to point to Xcode-beta.app and it's still causing issues. Seems like a lot of the issues are just due to the Gonna need to keep digging... |
Maybe Swift 3 changed how they expect preprocessor defines on the command line? Hopefully it's not deprecated... |
I ran the converter and am using Swift 2.3, same issues. Definitely seems I just noticed in the release notes that there’s a new build setting for “Active Compilation Conditions” is a new build setting for passing conditional compilation flags to the Swift compiler. Each element of the value of this setting passes to swiftc prefixed with "-D", in the same way the elements of “Preprocessor Macros” pass to clang with the same prefix. (22457329) |
Aha! That changelog entry is most likely the cause and possibly an Apple or CocoaPods bug. There is definitely funky stuff that happens when Swift imports Objective-C modules, and I bet that the flags aren't being passed around properly from Swift->ObjC. I bet it works fine when imported into an Obj-C project (with modules). |
😢 No joy... I'm trying to just build the KissXML framework directly now at it's still failing. Ugh... I'm sure it's gonna end up being one flag that is new or needs flipping to get this working... |
There's some discussion possibly related to this here: http://stackoverflow.com/questions/24003291/ifdef-replacement-in-swift-language Try It seems that you also can't set it =1 so we might have to change the obj-c ifdef to be ifdef instead of if. |
So... in order to get rid of the issues with the The new compiler must have changed how SWIFT/OTHER_CFLAGS work. |
I had KissXML setup as a local development pod, and the search paths don't pick up the module.modulemap in this config. I think I have a handle on this now. Gonna play around a bit and get this working tonight. |
You may be interested in my new branch that removes libxml from the public headers entirely: https://github.com/robbiehanson/KissXML/tree/private_libxml Seems like a nice way to work around the problem and hopefully doesn't break anything for people. :) |
Added a small fix to the podspec to fix this issue in PR #68. Tested a clean Thanks a ton for all the help @chrisballinger! I owe you a beer. 😄 |
Ya no problem! :) Btw I used to use |
Awesome! Ya, that project died pretty quick after Deliver came out, and rightly so. Deliver is amazing! |
Compiling a brand new project with the following Podfile seems to ignore the DDXML_LIBXML_MODULE_ENABLED flag and tries to run
#import <libxml/tree.h>
instead of the modules. This setup works as expected in Xcode 7. Presumably it has something to do with thelibxml.modulemap
, it the paths inside point to/Applications/Xcode.app
, notXcode-beta.app
...The text was updated successfully, but these errors were encountered: