[2.7] bpo-29854: Fix segfault in call_readline() by nirs · Pull Request #2637 · python/cpython (original) (raw)
The issue is this check in setup.py:
if host_platform == 'darwin': os_release = int(os.uname()[2].split('.')[0]) dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') if (dep_target and (tuple(int(n) for n in dep_target.split('.')[0:2]) < (10, 5) ) ): os_release = 8 if os_release < 9: # MacOSX 10.4 has a broken readline. Don't try to build # the readline module unless the user has installed a fixed # readline package if find_file('readline/rlconf.h', inc_dirs, []) is None: do_readline = False```
When configuring 2.7, we MACOSX_DEPLOYMENT_TARGET is "10.4", and readline is
disabled. When configuring master/3.6/3.5, we get "10.11", so readline is not disabled.
MACOSX_DEPLOYMENT_TARGET Identifies the earliest OS X version the product is to
run on. So with 2.7 we try to build a version that runs on any OS X version down to 10.4,
and in master/3.x we build only for the current version. I did not find why this happens.
This is also reproducible on travis OS X build, see:
https://travis-ci.org/python/cpython/jobs/251594769
Python build finished, but the necessary bits to build these modules were not found:
_bsddb dl imageop
linuxaudiodev ossaudiodev readline
spwd sunaudiodev
I think we need to open a separate issue for this, this is not related to this fix, since readline
is not built by default on OS X.