Skip to content

Commit 88e089c

Browse files
[3.12] gh-112305: Fix check-clean-src to detect frozen_modules .h files. (GH-113344) (#113346)
gh-112305: Fix check-clean-src to detect frozen_modules .h files. (GH-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. (cherry picked from commit 103c4ea) Co-authored-by: Gregory P. Smith <[email protected]>
1 parent 1927118 commit 88e089c

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
@@ -625,11 +625,13 @@ check-clean-src:
625625
@if test -n "$(VPATH)" -a \( \
626626
-f "$(srcdir)/$(BUILDPYTHON)" \
627627
-o -f "$(srcdir)/Programs/python.o" \
628-
-o -f "$(srcdir)\Python/frozen_modules/importlib._bootstrap.h" \
628+
-o -f "$(srcdir)/Python/frozen_modules/importlib._bootstrap.h" \
629629
\); then \
630630
echo "Error: The source directory ($(srcdir)) is not clean" ; \
631631
echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
632-
echo "Try to run: make -C \"$(srcdir)\" clean" ; \
632+
echo "Build artifacts such as .o files, executables, and Python/frozen_modules/*.h must not exist within $(srcdir)." ; \
633+
echo "Try to run:" ; \
634+
echo " (cd \"$(srcdir)\" && make clean || git clean -fdx -e Doc/venv)" ; \
633635
exit 1; \
634636
fi
635637

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)