classification
Title: build from fresh checkout fails
Type: compile error Stage: resolved
Components: Build Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, ncoghlan, pitrou
Priority: normal Keywords:

Created on 2016-05-03 12:20 by pitrou, last changed 2016-05-04 08:07 by pitrou. This issue is now closed.

Messages (6)
msg264717 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2016-05-03 12:20
Building from a fresh checkout with "./configure" followed by "make -j4" fails here:

$ make -j4
[... snip ...]
./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
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'

Current thread 0x00007fa1b6f48700 (most recent call first):
Aborted
generate-posix-vars failed
Makefile:598: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1
msg264718 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2016-05-03 12:21
$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="15.04 (Vivid Vervet)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.04"
VERSION_ID="15.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
msg264741 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2016-05-03 15:33
Note this is a data point of how obscure and hard to debug the current early startup phase is :-)
msg264747 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-05-03 16:09
That exception usually stems from when importlib.h has an error in it.
msg264775 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2016-05-04 03:10
Even updating from remote, and then making a fresh clone in a new directory, I can't reproduce this one - "./configure && make -j4" works for me.

Does strace give any potentially useful hints?

For me:

    $ strace -e trace=file ./python -c "pass"

the apparently relevant part of the strace output looks like:

open("/home/ncoghlan/devel/cpython-pristine/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/ncoghlan/devel/pyvenv.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Modules/Setup", {st_mode=S_IFREG|0664, st_size=15129, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/os.py", {st_mode=S_IFREG|0664, st_size=37715, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/pybuilddir.txt", {st_mode=S_IFREG|0664, st_size=26, ...}) = 0
open("/home/ncoghlan/devel/cpython-pristine/pybuilddir.txt", O_RDONLY) = 3
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
stat("/usr/local/lib/python36.zip", 0x7ffc9a2d15a0) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/usr/local/lib/python36.zip", 0x7ffc9a2d1120) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, st_size=12288, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, st_size=12288, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, st_size=12288, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/", {st_mode=S_IFDIR|0775, st_size=12288, ...}) = 0
open("/home/ncoghlan/devel/cpython-pristine/Lib/", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.cpython-36m-x86_64-linux-gnu.so", 0x7ffc9a2d1320) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.abi3.so", 0x7ffc9a2d1320) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.so", 0x7ffc9a2d1320) = -1 ENOENT (No such file or directory)
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.py", {st_mode=S_IFREG|0664, st_size=5067, ...}) = 0
stat("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__init__.py", {st_mode=S_IFREG|0664, st_size=5067, ...}) = 0
open("/home/ncoghlan/devel/cpython-pristine/Lib/encodings/__pycache__/__init__.cpython-36.pyc", O_RDONLY|O_CLOEXEC) = 3
msg264785 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2016-05-04 07:21
Le 04/05/2016 05:10, Nick Coghlan a écrit :
> 
> Does strace give any potentially useful hints?
> 
> For me:
> 
>     $ strace -e trace=file ./python -c "pass"

Ah, thanks. It seems this was failing due to a pyvenv.cfg in the parent
directory, which I removed.
History
Date User Action Args
2016-05-04 08:07:44pitrousetstatus: open -> closed
resolution: not a bug
stage: resolved
2016-05-04 07:21:15pitrousetmessages: + msg264785
2016-05-04 03:10:18ncoghlansetmessages: + msg264775
2016-05-03 16:09:18brett.cannonsetnosy: + brett.cannon
messages: + msg264747
2016-05-03 15:33:39pitrousetnosy: + ncoghlan
messages: + msg264741
2016-05-03 12:21:05pitrousetmessages: + msg264718
2016-05-03 12:20:34pitroucreate