]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45886: Fix OOT build when srcdir has frozen module headers (GH-29793)
authorChristian Heimes <christian@python.org>
Fri, 26 Nov 2021 16:05:16 +0000 (18:05 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Nov 2021 16:05:16 +0000 (17:05 +0100)
The presence of frozen module headers in srcdir interfers with OOT
build. Make considers headers in srcdir up to date, but later builds do
not use VPATH to locate files. make clean now removes the headers, too.

Also remove stale ``_bootstrap_python`` from .gitignore.

.gitignore
Makefile.pre.in

index cfd3163cd1818dd4adc22de12a8ce94b1ad42f85..0363244bdaf637bd4a0ba315a632d023cef3c419 100644 (file)
@@ -60,7 +60,6 @@ Lib/distutils/command/*.pdb
 Lib/lib2to3/*.pickle
 Lib/test/data/*
 !Lib/test/data/README
-/_bootstrap_python
 /Makefile
 /Makefile.pre
 Mac/Makefile
index 75d3bce946f42e3125a9f729e2bf2ab6b0ce2d2d..fc8ab99babcdbb5c4e5a0a530ad1bf321dd9022e 100644 (file)
@@ -587,7 +587,10 @@ build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \
 
 # Check that the source is clean when building out of source.
 check-clean-src:
-       @if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \
+       @if test -n "$(VPATH)" -a \( \
+           -f "$(srcdir)/Programs/python.o" \
+           -o -f "$(srcdir)\Python/frozen_modules/importlib._bootstrap.h" \
+       \); then \
                echo "Error: The source directory ($(srcdir)) is not clean" ; \
                echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
                echo "Try to run: make -C \"$(srcdir)\" clean" ; \
@@ -2293,6 +2296,8 @@ clean-retain-profile: pycremoval
        -rm -f Lib/lib2to3/*Grammar*.pickle
        -rm -f Programs/_testembed Programs/_freeze_module
        -rm -f Python/deepfreeze/*.[co]
+       -rm -f Python/frozen_modules/*.h
+       -rm -f Python/frozen_modules/MANIFEST
        -find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
        -rm -f Include/pydtrace_probes.h
        -rm -f profile-gen-stamp
@@ -2330,8 +2335,6 @@ distclean: clobber
                Modules/Setup.stdlib Modules/ld_so_aix Modules/python.exp Misc/python.pc \
                Misc/python-embed.pc Misc/python-config.sh
        -rm -f python*-gdb.py
-       -rm -f Python/frozen_modules/*.h
-       -rm -f Python/frozen_modules/MANIFEST
        # Issue #28258: set LC_ALL to avoid issues with Estonian locale.
        # Expansion is performed here by shell (spawned by make) itself before
        # arguments are passed to find. So LC_ALL=C must be set as a separate