Skip to content

Commit 765b2a3

Browse files
authored
bpo-45886: Fix OOT build when srcdir has frozen module headers (GH-29793)
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.
1 parent 8caceb7 commit 765b2a3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ Lib/distutils/command/*.pdb
6060
Lib/lib2to3/*.pickle
6161
Lib/test/data/*
6262
!Lib/test/data/README
63-
/_bootstrap_python
6463
/Makefile
6564
/Makefile.pre
6665
Mac/Makefile

Makefile.pre.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,10 @@ build_all: check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \
587587

588588
# Check that the source is clean when building out of source.
589589
check-clean-src:
590-
@if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \
590+
@if test -n "$(VPATH)" -a \( \
591+
-f "$(srcdir)/Programs/python.o" \
592+
-o -f "$(srcdir)\Python/frozen_modules/importlib._bootstrap.h" \
593+
\); then \
591594
echo "Error: The source directory ($(srcdir)) is not clean" ; \
592595
echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
593596
echo "Try to run: make -C \"$(srcdir)\" clean" ; \
@@ -2293,6 +2296,8 @@ clean-retain-profile: pycremoval
22932296
-rm -f Lib/lib2to3/*Grammar*.pickle
22942297
-rm -f Programs/_testembed Programs/_freeze_module
22952298
-rm -f Python/deepfreeze/*.[co]
2299+
-rm -f Python/frozen_modules/*.h
2300+
-rm -f Python/frozen_modules/MANIFEST
22962301
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
22972302
-rm -f Include/pydtrace_probes.h
22982303
-rm -f profile-gen-stamp
@@ -2330,8 +2335,6 @@ distclean: clobber
23302335
Modules/Setup.stdlib Modules/ld_so_aix Modules/python.exp Misc/python.pc \
23312336
Misc/python-embed.pc Misc/python-config.sh
23322337
-rm -f python*-gdb.py
2333-
-rm -f Python/frozen_modules/*.h
2334-
-rm -f Python/frozen_modules/MANIFEST
23352338
# Issue #28258: set LC_ALL to avoid issues with Estonian locale.
23362339
# Expansion is performed here by shell (spawned by make) itself before
23372340
# arguments are passed to find. So LC_ALL=C must be set as a separate

0 commit comments

Comments
 (0)