-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update wheel builder script for static linking on linux #3811
Conversation
We don't need to do an LD_LIBRARY_PATH when calling auditwheel because we're now statically linking OpenSSL.
@reaperhulk, thanks for your PR! By analyzing the history of the files in this pull request, we identified @alex to be a potential reviewer. |
Can you please explain how this PR works? Shouldn't we have to use |
I honestly don't understand how static linking works on Linux. I actually used the documentation @Lukasa wrote up in our docs to do this and then confirmed that _openssl.so wasn't linked against libssl or libcrypto via |
What's SUPPRESS_LIBRARY_FLAGS? |
Some gibberish we invented: https://github.com/pyca/cryptography/blob/master/src/_cffi_src/build_openssl.py#L15-L36 |
I think you want to not set SUPPRESS_LIBRARY_FLAGS on Linux. Right now you're eventually passing ... It does randomly occur to me that you might want to double check that your static openssl is being built with -fPIC, but that's unrelated. |
On macOS the easiest way we found to get static linking was just to pass absolute paths to the .a files themselves.
We are building with fpic (https://ci.cryptography.io/blue/rest/organizations/jenkins/pipelines/pyca/pipelines/infra/branches/master/runs/131/nodes/51/steps/553/log/?start=0)
… On Jul 25, 2017, at 3:33 PM, Nathaniel J. Smith ***@***.***> wrote:
I think you want to not set SUPPRESS_LIBRARY_FLAGS on Linux. Right now you're eventually passing -lcrypto -lssl to the linker, and so it's looking for libcrypto.so.X or libcrypto.a, finding the latter, and linking it on. Likewise for libssl. You could stop passing those, but then you'd need to have some other way to get the information to the linker that you want to link to openssl. Which is possible and I guess must be what you're doing on Darwin for some sensible reason that I don't know about, but why jump through those hoops?
... It does randomly occur to me that you might want to double check that your static openssl is being built with -fPIC, but that's unrelated.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I did not realize that |
You can do that too. I believe that the only difference is that |
We don't need to do an LD_LIBRARY_PATH when calling auditwheel because we're now statically linking OpenSSL.
Cryptography is shipping with wheels [1], and recent bugs for dynamic linking in wheel building [2] should be fixed now. We should therefore use the wheels. [1]: https://pypi.org/project/cryptography/#files [2]: pyca/cryptography#3811 Change-Id: I1b7e1ee1e127569b488d7202ae601ee17701d3f0
We don't need to do an LD_LIBRARY_PATH when calling auditwheel because we're now statically linking OpenSSL.
This is blocked on:
We should consider doing a 2.0.1 for this probably.