Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 103c4ea

Browse files
authored
gh-112305: Fix check-clean-src to detect frozen_modules .h files. (#113344)
A typo left this check broken so many of us who do out-of-tree builds were seeing strange failures due to bad `Python/frozen_modules/*.h` files being picked up from the source tree and used at build time from different Python versions leading to errors like: `Fatal Python error: _PyImport_InitCore: failed to initialize importlib` Or similar once our build got to an "invoke the interpreter" bootstrapping step due to incorrect bytecode being embedded.
1 parent a2dd0e7 commit 103c4ea

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Makefile.pre.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,13 @@ check-clean-src:
657657
@if test -n "$(VPATH)" -a \( \
658658
-f "$(srcdir)/$(BUILDPYTHON)" \
659659
-o -f "$(srcdir)/Programs/python.o" \
660-
-o -f "$(srcdir)\Python/frozen_modules/importlib._bootstrap.h" \
660+
-o -f "$(srcdir)/Python/frozen_modules/importlib._bootstrap.h" \
661661
\); then \
662662
echo "Error: The source directory ($(srcdir)) is not clean" ; \
663663
echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
664-
echo "Try to run: make -C \"$(srcdir)\" clean" ; \
664+
echo "Build artifacts such as .o files, executables, and Python/frozen_modules/*.h must not exist within $(srcdir)." ; \
665+
echo "Try to run:" ; \
666+
echo " (cd \"$(srcdir)\" && make clean || git clean -fdx -e Doc/venv)" ; \
665667
exit 1; \
666668
fi
667669

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fixed the ``check-clean-src`` step performed on out of tree builds to detect
2+
errant ``$(srcdir)/Python/frozen_modules/*.h`` files and recommend
3+
appropriate source tree cleanup steps to get a working build again.

0 commit comments

Comments
 (0)