Description
Some more complex C/C++ libraries need python3-config to get ldflags, include directories, etc.
On Linux, because each version of Python is in its own container, this works fine.
On macOS, because cibuildwheel relies entirely on virtualenvs and does not put /Library/Frameworks/Python.framework/Versions/{current_version}/bin in PATH, python3-config defaults to the system-wide Python 3.11/3.12 installation. Meaning any non-trivial C/C++ extensions may fail (and not even outright fail to build- wheels produced may fail to import because of missing symbols due to ABI breaks.)
A fix to this would be to prepend /Library/Frameworks/Python.framework/Versions/{current_version}/bin to PATH during builds.
For users currently blocked by this, a possible workaround is adding this in your CIBW_BEFORE_BUILD:
ln -s $(dirname $(readlink -f $(which python3)))/python3-config $(dirname $(which python3))/python3-config
Build log
https://github.com/donn/cibw_clobber/actions/runs/11091306625/job/30814862405
CI config
https://github.com/donn/cibw_clobber/blob/main/.github/workflows/ci.yml
Description
Some more complex C/C++ libraries need
python3-configto get ldflags, include directories, etc.On Linux, because each version of Python is in its own container, this works fine.
On macOS, because
cibuildwheelrelies entirely on virtualenvs and does not put/Library/Frameworks/Python.framework/Versions/{current_version}/binin PATH,python3-configdefaults to the system-wide Python 3.11/3.12 installation. Meaning any non-trivial C/C++ extensions may fail (and not even outright fail to build- wheels produced may fail to import because of missing symbols due to ABI breaks.)A fix to this would be to prepend
/Library/Frameworks/Python.framework/Versions/{current_version}/bintoPATHduring builds.For users currently blocked by this, a possible workaround is adding this in your
CIBW_BEFORE_BUILD:Build log
https://github.com/donn/cibw_clobber/actions/runs/11091306625/job/30814862405
CI config
https://github.com/donn/cibw_clobber/blob/main/.github/workflows/ci.yml