[CDRIVER-941] 'openssl/bio.h' not found on OS X 10.11 Created: 18/Oct/15 Updated: 19/Oct/16 Resolved: 30/Oct/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | Build, libmongoc, tls |
| Affects Version/s: | 1.2.0 |
| Fix Version/s: | 1.2.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Reported here: https://groups.google.com/d/topic/mongodb-user/gQbFAOTLFvo/discussion On a fresh Mac OS X 10.11 El Capitan, install the XCode command line tools (just type "gcc" and it guides you), install Homebrew and follow our Homebrew instructions:
Then ./autoconf.sh:
But "make":
|
| Comments |
| Comment by Githook User [ 04/Nov/15 ] | ||||||||||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Remove redundant install instructions from README and combine all instructions | ||||||||||||||||||||||||
| Comment by Githook User [ 30/Oct/15 ] | ||||||||||||||||||||||||
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Remove redundant install instructions from README and combine all instructions | ||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 22/Oct/15 ] | ||||||||||||||||||||||||
|
To resolve this ticket:
| ||||||||||||||||||||||||
| Comment by A. Jesse Jiryu Davis [ 18/Oct/15 ] | ||||||||||||||||||||||||
|
I don't know if CMake is involved in the Google Groups complaint or not, I'm just debugging the Autotools build for now. After long warning us about its deprecation, Apple stopped shipping OpenSSL headers with OS 10.11:
But homebrew's pkg-config, which we use to set our CFLAGS for OpenSSL, hasn't caught up:
Let's make a fully separate install of OpenSSL:
Following its advice, this builds the C Driver:
Another approach is, after "brew install openssl", to do "brew link openssl --force", which installs headers to /usr/local/include/openssl.
For some reason, Homebrew's own pkg-config knows that OpenSSL is homebrewed only once you run "link openssl --force":
I'm suspicious this may have broader consequences than are intended. Since Mac OS 10.11 does still contain the OpenSSL runtime libraries, the Homebrew developers warn that clang may include Homebrew's openssl headers but link to Apple's distribution of the OpenSSL library: https://github.com/Homebrew/homebrew/issues/41613 I think this isn't a problem for the C Driver specifically because we use pkg-config, if available, to determine the exact location of the headers and runtime libraries. So, once I've run "link openssl --force" and "./autogen.sh", autoconf writes this to config.status and all is well:
It uses Homebrew's pkg-config and therefore writes the full include path and library path for the Homebrew OpenSSL:
So it seems to specifically include the right header and the right library. But to avoid interference with other projects I'd prefer the former approach, specifying CPPFLAGS and LDFLAGS on the "make" line. I am uncertain whether to consider this a Homebrew bug or a C Driver build bug. Either way it will be resolved with |