New submission from Brian Sidebotham :
I am getting the following error when trying to compile Python 2.7.14 (and
previous 2.7 versions) on CentOS and RHEL7.
The main problem is that CONFIG_ARGS does not exist. I've included the build.
This RPATH is correct - it has to go through the RPM SPEC file so needs
escaping like this to work.
Python 3.6.2 builds find like this, but Python 2.7 is failing to build. Have I
missed something?
LDFLAGS='-Wl,-rpath=$\\$$ORIGIN/../lib' \
./configure --prefix=/opt/wsl \
--enable-shared \
--with-system-ffi \
--with-ensurepip=yes \
--enable-optimizations
...
ranlib libpython2.7.a
Modules/posixmodule.o: In function `posix_tmpnam':
/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14/./Modules/posixmodule.c:7642:
warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
Modules/posixmodule.o: In function `posix_tempnam':
/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14/./Modules/posixmodule.c:7589:
warning: the use of `tempnam' is dangerous, better use `mkstemp'
gcc -pthread -Wl,-rpath=RIGIN/../lib -fprofile-generate -Xlinker
-export-dynamic -o python \
Modules/python.o \
-L. -lpython2.7 -lpthread -ldl -lutil -lm
LD_LIBRARY_PATH=/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Traceback (most recent call last):
File "./setup.py", line 33, in
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in
sysconfig.get_config_var("CONFIG_ARGS"))
TypeError: argument of type 'NoneType' is not iterable
make[2]: *** [sharedmods] Error 1
make[2]: Leaving directory
`/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14'
make[1]: *** [build_all_generate_profile] Error 2
make[1]: Leaving directory
`/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14'
make: *** [profile-opt] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.sFvDid (%build)
-bash-4.2# cd build/lib.linux-x86_64-2.7/
-bash-4.2# ls
_sysconfigdata.py _sysconfigdata.pyc
-bash-4.2# cat _sysconfigdata.py
# system configuration generated and used by the sysconfig module
build_time_vars = {'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'AR': 'ar',
'ARFLAGS': 'rc',
'ATHEOS_THREADS': 0,
'BASECFLAGS': '-fno-strict-aliasing',
'BASEMODLIBS': '',
'BEOS_THREADS': 0,
'BINDIR': '/opt/wsl/bin',
'BINLIBDEST': '/opt/wsl/lib/python2.7',
'BLDLIBRARY': '-L. -lpython2.7',
'BLDSHARED': 'gcc -pthread -shared -Wl,-rpath=RIGIN/../lib -fprofile-generate',
'BUILDEXE': '',
'BUILDPYTHON': 'python',
'CC': 'gcc -pthread',
'CCSHARED': '-fPIC',
'CFLAGS': '-fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes',
'CFLAGSFORSHARED': '-fPIC',
'CONFIGFILES': 'configure configure.ac acconfig.h pyconfig.h.in
Makefile.pre.in',
'CONFINCLUDEDIR': '/opt/wsl/include',
'CONFINCLUDEPY': '/opt/wsl/include/python2.7',
'COREPYTHONPATH': ':plat-linux2:lib-tk:lib-old',
'COVERAGE_INFO':
'/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14/coverage.info',
'COVERAGE_REPORT':
'/opt/jenkins/workspace/Build_WSL_Python2_on_RHEL7/BUILD/Python-2.7.14/lcov-report',
'COVERAGE_REPORT_OPTIONS': '--no-branch-coverage --title "CPython lcov
report"',
'CPPFLAGS': '-I. -IInclude -I./Include',
'CXX': 'g++ -pthread',
'C_THREADS': 0,
'DESTDIRS': '/opt/wsl /opt/wsl/lib /opt/wsl/lib/python2.7
/opt/wsl/lib/python2.7/lib-dynload',
'DESTLIB': '/opt/wsl/lib/python2.7',
'DESTPATH': '',
'DESTSHARED': '/opt/wsl/lib/python2.7/lib-dynload',
'DIRMODE': 755,
'DIST': 'README ChangeLog configure configure.ac acconfig.h pyconfig.h.in
Makefile.pre.in Include Lib Misc Demo Ext-dummy',
'DISTDIRS': 'Include Lib Misc Demo Ext-dummy',
'DISTFILES': 'README ChangeLog configure configure.ac acconfig.h pyconfig.h.in
Makefile.pre.in',
'DLINCLDIR': '.',
'DLLLIBRARY': '',
'DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754': 0,
'D