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: source install [3.7.1] on debian jessie
Type: compile error Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: 3.7.0 build error with --enable-optimizations
View: 34112
Assigned To: Nosy List: foxleoly, xtreak
Priority: normal Keywords:

Created on 2018-10-26 06:57 by foxleoly, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg328516 - (view) Author: Leo Li (foxleoly) * Date: 2018-10-26 06:57
Hi Team,
I met the issue consistently on 3.7 and 3.7.1.

The configure is well, but when the make will output error messges:

step1: [ok]
sudo ./configure --prefix=/opt/python3.71 --enable-optimizations

step2: make [fail]

if test $? -ne 0 ; then \
	echo "generate-posix-vars failed" ; \
	rm -f ./pybuilddir.txt ; \
	exit 1 ; \
fi
Could not import runpy module
Traceback (most recent call last):
  File "/opt/Python-3.7.1/Lib/runpy.py", line 15, in <module>
    import importlib.util
  File "/opt/Python-3.7.1/Lib/importlib/util.py", line 14, in <module>
    from contextlib import contextmanager
  File "/opt/Python-3.7.1/Lib/contextlib.py", line 4, in <module>
    import _collections_abc
SystemError: <built-in function compile> returned NULL without setting an error
generate-posix-vars failed
Makefile:595: recipe for target 'pybuilddir.txt' failed
make[1]: *** [pybuilddir.txt] Error 1
make[1]: Leaving directory '/opt/Python-3.7.1'
Makefile:523: recipe for target 'profile-opt' failed
make: *** [profile-opt] Error 2


(venv36) myhost ➜  Python-3.7.1 gcc --version
gcc (Debian 4.9.2-10+deb8u1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(venv36) myhost ➜  Python-3.7.1 uname -a
Linux docker 3.16.0-6-amd64 #1 SMP Debian 3.16.57-2 (2018-07-14) x86_64 GNU/Linux

Any questions pls mail me.
msg328540 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-10-26 11:50
Thanks for the report. Is this related using older version of GCC? Searching the bug tracker tells me a related issue (https://bugs.python.org/issue34112) where --enable-optimizations caused build error on 3.7.0 for older compiler toolchain like GCC 4 with a very similar traceback. 

* Can you please upgrading GCC and try? 
* Does the build also fails without --enable-optimizations flag with your current version of GCC?
msg328637 - (view) Author: Leo Li (foxleoly) * Date: 2018-10-27 05:12
I've tested 2 way to solve this:
1. disable --enable-optimizations option. the software can be compile and install successful.
2. upgrade gcc version to 8.2.0. 

docker ➜  bin gcc --version
gcc (Debian 8.2.0-8) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
msg328640 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-10-27 05:25
Thanks, I guess then it's the same as issue34112 with --enable-optimizations being incompatible with older compiler toolchains like GCC 4 in this case. Feel free to close this if it resolves the issue.
msg328645 - (view) Author: Leo Li (foxleoly) * Date: 2018-10-27 06:13
Sure! Yes, Pls close it.
msg328646 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-10-27 06:16
Sure, I am closing it with duplicate as resolution adding the related ticket issue34112 as superseder. Thanks for the report!
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79255
2018-10-27 06:16:56xtreaksetstatus: open -> closed
superseder: 3.7.0 build error with --enable-optimizations
messages: + msg328646

resolution: duplicate
stage: resolved
2018-10-27 06:13:45foxleolysetmessages: + msg328645
2018-10-27 05:25:58xtreaksetmessages: + msg328640
2018-10-27 05:12:01foxleolysetmessages: + msg328637
2018-10-26 11:50:39xtreaksetnosy: + xtreak
messages: + msg328540
2018-10-26 06:57:55foxleolycreate