Title: Could not build the ssl module! | macOS with `CPPFLAGS` and `LDFLAGS` set
Type: Stage: resolved
Components: Build Versions: Python 3.10
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: samuelmarks
Priority: normal Keywords:

Created on 2021-02-27 11:43 by samuelmarks, last changed 2021-02-27 11:59 by samuelmarks. This issue is now closed.

Messages (2)
msg387777 - (view) Author: Samuel Marks (samuelmarks) * Date: 2021-02-27 11:43
I was on 3.10a4 on macOS 11.1 for ages, finally decided to upgrade to a5, building from source. With latest `brew install openssl zlib`.
$ export LDFLAGS='-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/zlib/lib'
$ export CPPFLAGS='-I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/zlib/include'
$ ./configure --enable-optimizations --prefix /opt/python3.10

I suppose I could set this which I forgot, but I doubt it's the problem, unless pkg_config is how the CPython build system find OpenSSL?
export PKG_CONFIG_PATH='/usr/local/opt/openssl@1.1/lib/pkgconfig'

Python build finished successfully!
The necessary bits to build these optional modules were not found:
_hashlib              _ssl                  ossaudiodev        
To find the necessary bits, look in in detect_modules() for the module's name.

The following modules found by detect_modules() in, have been
built by the Makefile instead, as configured by the Setup files:
_abc                  pwd                   time               

Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs,

Happy to test alternative configurations
msg387778 - (view) Author: Samuel Marks (samuelmarks) * Date: 2021-02-27 11:59
Nevermind it actually was that missing `PKG_CONFIG_PATH` lineā€¦
Date User Action Args
2021-02-27 11:59:13samuelmarkssetstatus: open -> closed
resolution: not a bug
messages: + msg387778

stage: resolved
2021-02-27 11:43:37samuelmarkscreate