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: ERROR: test_sundry (test.test_tools.test_sundry.TestSundryScripts): SystemExit: ERROR: missing _freeze_module
Type: Stage: resolved
Components: Tests Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hroncok, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2021-10-07 10:05 by hroncok, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28786 merged vstinner, 2021-10-07 11:46
Messages (7)
msg403377 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-10-07 10:05
When we build Python 3.10.0a1 (from the git tag) in Fedora, we see:

======================================================================
ERROR: test_sundry (test.test_tools.test_sundry.TestSundryScripts)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.11.0a1/Lib/test/test_tools/test_sundry.py", line 43, in test_sundry
    import_tool(name)
    ^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.11.0a1/Lib/test/test_tools/__init__.py", line 35, in import_tool
    return importlib.import_module(toolname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.11.0a1/Lib/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1072, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1044, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1015, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 689, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 894, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/builddir/build/BUILD/Python-3.11.0a1/Tools/scripts/freeze_modules.py", line 37, in <module>
    sys.exit("ERROR: missing _freeze_module")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SystemExit: ERROR: missing _freeze_module

----------------------------------------------------------------------
Ran 3 tests in 0.209s


I see in the build log we use Programs/_freeze_module regularly in the build process, so no idea why this fails. I'll try to come up with a reporducer.
msg403382 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-10-07 10:47
I can reproduce this from git main branch:

$ git clean -fdx
$ mkdir -p build/debug
$ cd build/debug
$ ../../configure --with-platlibdir=lib64 --enable-shared --without-ensurepip --with-pydebug
$ make
$ cd ../..
$ LD_LIBRARY_PATH=$PWD/build/debug build/debug/python -m test -v test_tools
msg403384 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-10-07 10:54
I can also reproduce this without the additional configure flags:

[cpython]$ git clean -fdx
[cpython]$ mkdir -p build/debug
[cpython]$ cd build/debug
[debug]$ ../../configure --with-pydebug
[debug]$ make
[debug]$ cd ../..
[cpython]$ build/debug/python -m test -v test_tools
...
SystemExit: ERROR: missing _freeze_module

As well as from the build dir:

[cpython]$ cd build/debug
[debug]$ ./python -m test -v test_tools
...
SystemExit: ERROR: missing _freeze_module

But when I build from the source directory directly:

[cpython]$ git clean -fdx
[cpython]$ ./configure --with-pydebug
[cpython]$ make
[cpython]$ ./python -m test -v test_tools
...
Tests result: SUCCESS

Hence, I assume the culprit is in building from a subdirectory.
msg403392 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 11:41
My fix for bpo-45020 no longer works, I'm not sure why:

commit 41551ee7e24fb6c58846836d3655dbb212281206
Author: Victor Stinner <vstinner@python.org>
Date:   Fri Sep 17 20:20:43 2021 +0200

    bpo-45020: Fix build out of source tree (GH-28410)
    
    * Makefile.pre.in: Add $(srcdir) when needed, remove it when it was
      used by mistake.
    * freeze_modules.py tool uses ./Programs/_freeze_module if the
      executable doesn't exist in the source tree.

I'm working on a new fix.
msg403435 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 19:19
New changeset ff8859d965815e8b5af346bd90299cfa5568c855 by Victor Stinner in branch 'main':
bpo-45402: Fix test_tools.test_sundry() (GH-28786)
https://github.com/python/cpython/commit/ff8859d965815e8b5af346bd90299cfa5568c855
msg403436 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-10-07 19:19
Thanks Miro for the bug report, it's now fixed.
msg406767 - (view) Author: Miro Hrončok (hroncok) * Date: 2021-11-22 12:36
There seem to be a regression in this fix, see https://bugs.python.org/issue45866
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89565
2021-11-22 12:36:40hroncoksetmessages: + msg406767
2021-10-07 19:19:53vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg403436

stage: patch review -> resolved
2021-10-07 19:19:20vstinnersetmessages: + msg403435
2021-10-07 11:46:39vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request27121
2021-10-07 11:41:55vstinnersetmessages: + msg403392
2021-10-07 10:54:07hroncoksetmessages: + msg403384
2021-10-07 10:47:31hroncoksetmessages: + msg403382
2021-10-07 10:05:28hroncokcreate