Skip to content
This repository has been archived by the owner. It is now read-only.

link python with homebrew openssl ? #14497

Closed
Carreau opened this issue Aug 28, 2012 · 16 comments
Closed

link python with homebrew openssl ? #14497

Carreau opened this issue Aug 28, 2012 · 16 comments
Labels

Comments

@Carreau
Copy link

@Carreau Carreau commented Aug 28, 2012

Hi,

I was wondering if there is an option to use the open ssl version install with homebrew ?
I did install it, and rebuild python but it still says

>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 0.9.8r 8 Feb 2011'

Or maybe there is a way to ask python to switch at run time ?

Thanks !

@adamv
Copy link
Contributor

@adamv adamv commented Aug 28, 2012

I'm OK with making a newer OpenSSL an opt-in dependency to Python, but want other maintainers to tell me what the downsides to this are.

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Sep 4, 2012

I have no objections. @adamv how would you call the option to use homebrew's openssl over systems? Just plain --openssl or --with-openssl (or is the "with" added automatically).

I am testing this right now (noticing that openssl fails with superenv on Xcode-only 10.8). ping @mxcl.

@adamv
Copy link
Contributor

@adamv adamv commented Sep 4, 2012

depends_on 'openssl' => :optional if build.include? 'with-openssl'

That will make it future-proof for the new optional/recommended support.

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Sep 4, 2012

Thanks. Just tested it locally and it works.

@Carreau
Copy link
Author

@Carreau Carreau commented Sep 13, 2012

By curiosity, how could I do it myself before this is merge into homebrew.
I looked at branches of @samueljohn , but did not find anything with patched formulae for python.

Thanks.

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Sep 13, 2012

@Carreau You didn't find it because I don't have it in my "master" but in "python-openssl" branch. If you want it now, do:
brew install https://raw.github.com/samueljohn/homebrew/python-openssl/Library/Formula/python.rb --use-openssl

@adamv Hmmm not sure. Python always uses openssl, so I tend to call it "--use-brewed-openssl" or something. For now, I just call it "use-openssl" in my branch.

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Sep 13, 2012

Note, that currently you should install openssl via brew install openssl --env=std if you only have Xcode (but not the Command Line Tools) - as I have. (#14853)

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Sep 13, 2012

If linked successfully with homebrew's openssl you should see something like:

xcrun otool -L Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so
Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so:
    /homebrew/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /homebrew/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

(This is my test homebrew installation in /homebrew)

@Carreau
Copy link
Author

@Carreau Carreau commented Sep 13, 2012

@samueljohn thanks, I might have missed it. I looked a the diff with master and github told me that your python python-openssl branch was up to date with master... now it is different.

I'll try asap.

@mxcl
Copy link
Member

@mxcl mxcl commented Sep 13, 2012

--with-openssl is not clear. It builds with that anyway.

We simply must have another prefix in there. Perhaps: --with-brewed-openssl. I'm not too fussed about what is picked as long as it is not ambiguous.

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Sep 30, 2012

Please brew update, brew rm python and brew install python --with-brewed-openssl to get what you asked for and report if you have any issues left. Thanks!

For now, I think we can close this (ping @adamv)

@jacknagel jacknagel closed this Sep 30, 2012
@Carreau
Copy link
Author

@Carreau Carreau commented Oct 1, 2012

Hi !
compiles great !

>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1c 10 May 2012'

yeah !

but... any ideas where the [ xxxx refs] came from ?

>>> import ssl
[47449 refs]
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.1c 10 May 2012'
[47451 refs]
>>> 1
1
>>> print 'hi!'
hi!
[47468 refs]

Thank you very much !

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Oct 1, 2012

Yep, I know what that was and the very recent update should have fixed that. I accidentally put a --py-debug in there (for other reasons). See 2a09cbe.

@Carreau
Copy link
Author

@Carreau Carreau commented Oct 1, 2012

hum... I'll re-check that tomorrow then.

Thanks.

@Carreau
Copy link
Author

@Carreau Carreau commented Oct 2, 2012

brew re-updated and pyton reinstalled, seem to work like a charm !

Thanks again !

@samueljohn
Copy link
Contributor

@samueljohn samueljohn commented Oct 2, 2012

🆒

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.