This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: OPENSSL_* flags not propagated to extensions during build
Type: Stage: resolved
Components: Extension Modules, macOS, SSL Versions: Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: Björn Pollex, christian.heimes, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2019-10-24 08:20 by Björn Pollex, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg355299 - (view) Author: Björn Pollex (Björn Pollex) Date: 2019-10-24 08:20
When building Python 3.7.2 using pyenv on MacOS, it will use `--with-openssl` to configure OpenSSL. With that option, the compiler options for OpenSSL will be passed via `OPENSSL_*` variables, rather than normal compiler flags (e.g. `OPENSSL_LDFLAGS` vs. `LDFLAGS`). When compiling an extension, these flags will not be propagated by `distutils`, and so an extension that depends on OpenSSL fails to compile.

I'm not sure what the expected behavior here is. Should the package handle this by querying `sysconfig` directly in `setup.py`? Or should this be handled automatically by `distutils`?

Specifically, I ran into this issue when trying to install `mysqlclient-python` (https://github.com/PyMySQL/mysqlclient-python).
msg355313 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-10-24 09:35
'--with-openssl' purpose is to override the OpenSSL location for Python's internal _ssl and _hashlib module. It is not designed to interfere with 3rd party extensions that are built with distutils or setuptools.

It is the decision of a 3rd party package how it wants to handle these extra flags -- or if it is able to use them at all. In case of PyMySQL you must use the same shared libraries as libmysqlclient. You cannot use a  different OpenSSL ABIs, APIs, or shared libraries for PyMySQL and libmysqlclient.
msg355314 - (view) Author: Björn Pollex (Björn Pollex) Date: 2019-10-24 09:37
Thanks for the response, that clarifies it! In that case this issue is invalid.
History
Date User Action Args
2022-04-11 14:59:22adminsetgithub: 82758
2019-10-24 09:37:19Björn Pollexsetstatus: open -> closed
resolution: not a bug
messages: + msg355314

stage: resolved
2019-10-24 09:35:46christian.heimessetmessages: + msg355313
2019-10-24 08:25:25Björn Pollexsetassignee: christian.heimes

components: + Extension Modules, macOS, SSL
nosy: + christian.heimes, ronaldoussoren, ned.deily
2019-10-24 08:20:16Björn Pollexcreate