[CDRIVER-691] Update Podspec to 1.1.6 and enable SSL Created: 31/May/15 Updated: 03/May/17 Resolved: 13/Jul/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | packaging |
| Affects Version/s: | None |
| Fix Version/s: | TBD |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Marius Soutier | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
(Not sure who the maintainer of mongo-c cocoa pod is, but author is listed as MongoDB) Please update Podspecs for mongo-c-driver and libbson to 1.1.6, and also enable SSL. |
| Comments |
| Comment by Dan Appel [X] [ 26/Oct/15 ] | ||
|
Ping? | ||
| Comment by Dan Appel [X] [ 20/Oct/15 ] | ||
|
Well... I tried to figure out how all of this works but frankly its pretty ridiculous. I created module maps and attempted to test everything but it doesn't seem like cocoapods likes my changes. After a few hours of fighting with it I gave up, but I think I got somewhere. I made some changes to libbson here https://github.com/Danappelxx/libbson (don't mind the messy repo - I'm not planning to merge it). I added a module map and changed the headers as you recommended. The headers seemed to actually work, which is good. I tested my fork with `pod lib lint` on the libbson, which didn't fail, and even adding it to a podfile (with `use_frameworks!`) and running `pod install` worked. However, when I tried to import it in my Swift code I got errors stating that the headers referenced in the module map were not found (meaning that the module map is not correct), and when I put it in the framework header, I got the old errors again which stated that you cannot have a non-modular framework in a framework target or something like that - I assume (hope) that this will be fixed with the module map. The fact that the library built at all when it had a module map is also great news because that means that foundation was not automatically imported (which was breaking everything beforehand). So it seems that the only thing we need to fix is the module map, and everything should line up into position afterwards. I'm not confident at all in my ability to create one, however. If you're curious, here's the module map I ended up making (You can look through the file history - none of the other version I tried worked, either) https://github.com/Danappelxx/libbson/blob/podspec-1.1.11/src/module.modulemap. Also I would like to note that so far all of these changes are made towards libbson, since libbson is the simpler of the two. I assume, however, that if we can get it to work, then the steps getting mongoc to work as well will be very similar. Back to you paulmelnikow? Edit: Tested a new module map in an OS X application and it worked (with use_frameworks! in the Podfile)! I'm testing it in a framework project right now, hopefully it works. Edit 2: Got the good old 'could not build objective-c module {project name}(not libbson) in the framework target when I added it to the framework header. Just `import libbson/bson` didn't work in swift code. If you want to test it, add the following lines to the podfile:
Not sure where to go from here. | ||
| Comment by Paul Melnikow [ 19/Oct/15 ] | ||
|
~Danappelxx do you want to give that a shot? I can try to do it, though I'm not sure how soon I'll have time. | ||
| Comment by A. Jesse Jiryu Davis [ 19/Oct/15 ] | ||
|
Sorry, would you like to try it out and see if the build works with the Autotools and CMake if you make that change? If it works I'd consider a pull request. Thanks. | ||
| Comment by Dan Appel [X] [ 18/Oct/15 ] | ||
|
Bump? jesse paulmelnikow | ||
| Comment by Paul Melnikow [ 09/Oct/15 ] | ||
|
@jesse Thoughts? | ||
| Comment by Dan Appel [X] [ 07/Oct/15 ] | ||
Any updates? | ||
| Comment by Paul Melnikow [ 05/Oct/15 ] | ||
|
I hear ya. Would definitely be nice to get the Swift support working! Feel free to play with what I have in your project, and let me know if you make any headway: | ||
| Comment by Dan Appel [X] [ 05/Oct/15 ] | ||
|
@paulmelnikow: Nice! Unfortunately no framework supports means no Swift support - which is an issue (at least for me By the way, I'm really glad somebody is looking into this - I've been struggling to use MongoC in a project (Swift MongoDB driver) for a while now. | ||
| Comment by Paul Melnikow [ 05/Oct/15 ] | ||
|
Re #3, what CocoaPods actually wants is <bson/bson.h> and <bson/bcon.h> in place of <bson.h> and <bcon.h>. Would that be a feasible change? This is explained here: https://github.com/segmentio/analytics-ios/issues/417 https://github.com/CocoaPods/CocoaPods/issues/3913#issuecomment-128028170 | ||
| Comment by Paul Melnikow [ 05/Oct/15 ] | ||
|
mongo-c-driver is updated: https://cocoapods.org/pods/mongo-c-driver Unfortunately I encountered a number of problems with the new frameworks support in CocoaPods. This was added to support Swift: http://blog.cocoapods.org/Pod-Authors-Guide-to-CocoaPods-Frameworks/ By way of background: there are now two ways to integrate pods into an application: as static libraries, and as frameworks. Until this Swift support arrived, the only supported way was static libraries. So, for now, the pod will work, but only when it's integrated as a static library, not as a framework. Once these issues are resolved I can push a new version:
| ||
| Comment by Paul Melnikow [ 04/Oct/15 ] | ||
|
Fixed the warning with help from CocoaPods. https://github.com/CocoaPods/CocoaPods/issues/4309 libbson is now updated: https://cocoapods.org/pods/libbson Working through some errors with mongo-c-driver now. | ||
| Comment by A. Jesse Jiryu Davis [ 04/Oct/15 ] | ||
|
Thanks so much for the info Paul, and the offer to update the podspecs. Please let us know what we can do to help with the "use of private header" error if it turns out to be an issue with libbson or libmongoc. Regarding SSL: Right, we're very aware of this issue. Right now the roadmap is: 1.2 will be out in a couple weeks with big performance and reliability wins for connecting to replica sets and mongoses. 1.3 will be out in a couple months with features to support MongoDB 3.2. 1.4 will be out early next year: its top priority is to support for native TLS on Mac and Windows, building on the work contributed to us so far. | ||
| Comment by Paul Melnikow [ 04/Oct/15 ] | ||
|
Sure, I'm happy to work on that. I'm running into a build error that's keeping the updated pod from passing lint, which I'm researching further, "use of private header from outside its module." I'm getting the same issue on an earlier version of the libbson pod. That makes me think it's a CocoaPods issue. Regarding SSL: it's deliberately turned off in the pod. OpenSSL is deprecated on OS X. AFAIK it doesn't get security updates. OpenSSL is not available at all on iOS. For those reasons I wouldn't recommend using the SSL support on OS X or iOS. There are some pods that ship repackaged versions of OpenSSL, but I do not know whether they are widely used or supported, and they certainly don't get OS-level security updates. | ||
| Comment by A. Jesse Jiryu Davis [ 29/Sep/15 ] | ||
|
It's paulmelnikow. Hi Paul, would you like to update our libbson and mongo-c-driver podspecs to the latest release, 1.1.11, and see about enabling SSL? | ||
| Comment by Dan Appel [X] [ 28/Sep/15 ] | ||
|
Well, I've made Swift/Objective-C pods before but I have no experience with C pods, so I'm not sure how much help I would be. Who made them in the first place (for mongoc)? Also, I'm pretty sure if you approach the nice folks over at github.com/Cocoapods/Specs and ask them for help (or flat out do it for you), they'll be happy to help. | ||
| Comment by A. Jesse Jiryu Davis [ 28/Sep/15 ] | ||
|
Hi, none of us knows how to maintain podspecs so we've deprioritized it. If you know how to maintain podspecs and would like to help us, please let us know! | ||
| Comment by Dan Appel [X] [ 28/Sep/15 ] | ||
|
Any update? It's difficult to use mongoc and bson in an Xcode project without cocoapods, much less have it as a dependency (which is my issue right now). | ||
| Comment by A. Jesse Jiryu Davis [ 13/Jul/15 ] | ||
|
The C Driver team is not familiar with podspecs. | ||
| Comment by A. Jesse Jiryu Davis [ 05/Jun/15 ] | ||
|
Not sure who maintains these or how. No one currently at MongoDB knows much about CocoaPods, so I'm deprioritizing for now, sorry. | ||
| Comment by A. Jesse Jiryu Davis [ 31/May/15 ] | ||
|
Thanks for the report, I'll get these updated. |