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

Comments

Projects
None yet
5 participants
@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

This comment has been minimized.

Show comment
Hide comment
@adamv

adamv Aug 28, 2012

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Sep 4, 2012

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@adamv

adamv Sep 4, 2012

Contributor

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

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Sep 4, 2012

Contributor

Thanks. Just tested it locally and it works.

Contributor

samueljohn commented Sep 4, 2012

Thanks. Just tested it locally and it works.

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau 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.

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Sep 13, 2012

Contributor

@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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Sep 13, 2012

Contributor

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)

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Sep 13, 2012

Contributor

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)

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau 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.

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

This comment has been minimized.

Show comment
Hide comment
@mxcl

mxcl Sep 13, 2012

Member

--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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Sep 30, 2012

Contributor

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)

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau 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 !

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

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Oct 1, 2012

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Oct 1, 2012

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

Thanks.

Carreau commented Oct 1, 2012

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

Thanks.

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Oct 2, 2012

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

Thanks again !

Carreau commented Oct 2, 2012

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

Thanks again !

@samueljohn

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Oct 2, 2012

Contributor

🆒

Contributor

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.