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: python finds test modules from the wrong directory during PGO build
Type: behavior Stage: resolved
Components: Build Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, kal.sze, willingc
Priority: normal Keywords:

Created on 2018-10-15 02:43 by kal.sze, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg327725 - (view) Author: Kal Sze (kal.sze) Date: 2018-10-15 02:43
OS: Ubuntu Desktop 18.04.1 x86-64
Python 3.7.0

When trying to build Python 3.7 from source, with the `--enable-shared --enable-optimizations --with-lto` configure options, python needs to run the test suite in order to generate PGO data. However, it turns out that it would find test modules from the wrong directory, if there is already another version of Python 3 installed system-wide (Ubuntu 18.04 comes with Python 3.6 pre-installed).

I found out because Ubuntu's automatic crash reporter caught a core dump during `python -m tests.regrtest` and I could see that python found the tests.regrtest module at `/usr/lib/python3.6/test/regrtest.py`.

In the end, the build is reported as "successful", I guess it's because the Makefile expects it the crash anyway. In any case, it still seems wrong because it means the wrong test suite is run.

I have uploaded Ubuntu's crash report in raw format here, for anybody who knows how to read it (it's in plain text anyway): https://www.dropbox.com/s/6ihxoouoqe1k98f/_usr_lib_python3.6_test_regrtest.py.1000.crash?dl=0
msg327797 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-10-15 22:09
I think there might be more going on here as the build target as it uses the built Python which has special logic to notice it is being built in a checkout. Did you launch the build from a directory other than the git checkout? Or were you trying to do a build for a different platform?
msg349401 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2019-08-11 17:24
When building from the gzipped source of 3.8.0b3, I am seeing similar crashes on Ubuntu 18.04.

Running ``make clean`` prior to ``configure`` and ``make`` seems to have resolved the issue. After this the regrtest was being found in the 3.8.0b3 directory. I am no longer seeing core dumps.

I'm going to close this issue.
History
Date User Action Args
2022-04-11 14:59:07adminsetgithub: 79166
2019-08-11 17:24:37willingcsetstatus: open -> closed

versions: + Python 3.8
nosy: + willingc

messages: + msg349401
resolution: not a bug
stage: resolved
2018-10-15 22:09:49brett.cannonsetnosy: + brett.cannon
messages: + msg327797
2018-10-15 02:43:34kal.szecreate