Comments (21)
Added a small fix to the podspec to fix this issue in PR #68. Tested a clean pod install
in Xcode 8 with the private_libxml branch with the podspec changes and everything compiles!
Thanks a ton for all the help @chrisballinger! I owe you a beer.
from kissxml.
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
https://github.com/stephencelis/SQLite.swift/tree/master/CocoaPods
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...
:(
from kissxml.
What I'm a little confused about is why the #if DDXML_LIBXML_MODULE_ENABLED
check is ignored. I can hack the modulemap to point to Xcode-beta.app, but this check always seems to return false, which forces the #import <libxml/tree.h>
to run instead of importing the appropriate module.
The flag is property included in the OTHER_SWIFT_FLAGS
and OTHER_CFLAGS
.
from kissxml.
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.
from kissxml.
Might be worth just keeping an eye on as Xcode betas keep coming out. I just installed beta 2, and it introduced more errors that weren't present before.
from kissxml.
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..
from kissxml.
I started tinkering with having a nested beta subspec under libxml_module
, that references a second .modulemap that points to Xcode-beta.app.
s.subspec 'libxml_module' do |ss|
ss.subspec 'beta' do |beta|
beta.preserve_path = 'libxml/module-beta.modulemap'
end
...
and then
pod "KissXML/libxml_module/beta"
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...
from kissxml.
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
from kissxml.
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 DDXML_LIBXML_MODULE_ENABLED
being ignored.
Gonna need to keep digging...
from kissxml.
Maybe Swift 3 changed how they expect preprocessor defines on the command line? Hopefully it's not deprecated...
from kissxml.
I ran the converter and am using Swift 2.3, same issues. Definitely seems
like something changed with preprocessor defines in Xcode 8…
I just noticed in the release notes that there’s a new build setting for
Swift. Doesn’t fix the issue, but something to be aware of, at any rate.
“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)
from kissxml.
So, it definitely seems like the preprocessor define isn't being handled.
In DDXMLNode.h, I added the following at the top, just to see if the flag was defined, and sure enough, it's not.
#ifndef DDXML_LIBXML_MODULE_ENABLED
#error "UNDEFINED"
#endif
from kissxml.
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).
from kissxml.
from kissxml.
There's some discussion possibly related to this here: http://stackoverflow.com/questions/24003291/ifdef-replacement-in-swift-language
Try -D DDXML_LIBXML_MODULE_ENABLED
instead of -DDDXML_LIBXML_MODULE_ENABLED
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.
from kissxml.
So... in order to get rid of the issues with the #if DDXML_LIBXML_MODULE_ENABLED
check failing, in Xcode 8 I needed to add DDXML_LIBXML_MODULE_ENABLED=1 to the list of Preprocessor Macros, not the OTHER_CFLAGS.
The new compiler must have changed how SWIFT/OTHER_CFLAGS work.
from kissxml.
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.
from kissxml.
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. :)
from kissxml.
With DDXMLPrivate.h
importing <libxml/tree.h>
, it's throwing the same error as above in Xcode 8. Xcode 7 is still working as expected.
Update: I think I have a workaround. Please hold...
from kissxml.
Ya no problem! :)
Btw I used to use itunes_transporter_generator
before I switched to Deliver. Even made an issue 3 years ago: https://github.com/colinhumber/issues/19
from kissxml.
Awesome! Ya, that project died pretty quick after Deliver came out, and rightly so. Deliver is amazing!
from kissxml.
Related Issues (20)
- 'DDXMLPrivate.h' file not found HOT 4
- Support for security header in request
- Need help in parsing child node HOT 1
- DDXMLNode crash (compactXMLString -> XMLStringWithOptions) HOT 2
- \N is getting removed from DDXMLNode
- @import Foundation;
- Huge input lookup error
- linphone Help
- Parse failed if node has "&#x" or "&#" string
- DDXMLNode XMLStringWithOptions crash. HOT 4
- 'namespace' is a keyword in Objective-C++
- Add support for Swift Package Manager
- Tag new version for Swift Package Manager users?
- Deployment target for Xcode12
- about xmlFreeDoc(doc); error HOT 1
- swift project build for distribution support
- Yy
- Commit tagged 5.2.2 is not on master branch HOT 1
- Warnings and errors have appeared in Xcode 9.3. HOT 3
- Is there a plan to support swift static library? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kissxml.