Skip to content

Commit 8489409

Browse files
torsavavstinner
authored andcommitted
[3.5] bpo-29243: Fix Makefile with respect to --enable-optimizations (GH-1478) (#1520)
* bpo-29243: Fix Makefile with respect to --enable-optimizations When using the Profile Guided Optimization (./configure --enable-optimizations) Python is built not only during `make` but rebuilt again during `make test`, `make install` and others. This patch fixes the issue. Note that this fix produces no change at all in the Makefile if configure is run witout --enable-optimizations. * !squash. (cherry picked from commit a1054c3)
1 parent f5f7870 commit 8489409

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

Makefile.pre.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ TESTTIMEOUT= 3600
984984

985985
# Run a basic set of regression tests.
986986
# This excludes some tests that are particularly resource-intensive.
987-
test: all platform
987+
test: @DEF_MAKE_RULE@ platform
988988
$(TESTRUNNER) $(TESTOPTS)
989989

990990
# Run the full test suite twice - once without .pyc files, and once with.
@@ -994,7 +994,7 @@ test: all platform
994994
# the bytecode read from a .pyc file had the bug, sometimes the directly
995995
# generated bytecode. This is sometimes a very shy bug needing a lot of
996996
# sample data.
997-
testall: all platform
997+
testall: @DEF_MAKE_RULE@ platform
998998
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
999999
$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
10001000
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
@@ -1003,7 +1003,7 @@ testall: all platform
10031003

10041004
# Run the test suite for both architectures in a Universal build on OSX.
10051005
# Must be run on an Intel box.
1006-
testuniversal: all platform
1006+
testuniversal: @DEF_MAKE_RULE@ platform
10071007
if [ `arch` != 'i386' ];then \
10081008
echo "This can only be used on OSX/i386" ;\
10091009
exit 1 ;\
@@ -1026,7 +1026,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
10261026
test_multiprocessing_forkserver \
10271027
test_mailbox test_socket test_poll \
10281028
test_select test_zipfile test_concurrent_futures
1029-
quicktest: all platform
1029+
quicktest: @DEF_MAKE_RULE@ platform
10301030
$(TESTRUNNER) $(QUICKTESTOPTS)
10311031

10321032

@@ -1378,7 +1378,7 @@ LIBPL= @LIBPL@
13781378
# pkgconfig directory
13791379
LIBPC= $(LIBDIR)/pkgconfig
13801380

1381-
libainstall: all python-config
1381+
libainstall: @DEF_MAKE_RULE@ python-config
13821382
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
13831383
do \
13841384
if test ! -d $(DESTDIR)$$i; then \
@@ -1639,7 +1639,7 @@ distclean: clobber
16391639
-exec rm -f {} ';'
16401640

16411641
# Check for smelly exported symbols (not starting with Py/_Py)
1642-
smelly: all
1642+
smelly: @DEF_MAKE_RULE@
16431643
nm -p $(LIBRARY) | \
16441644
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
16451645

@@ -1677,7 +1677,7 @@ funny:
16771677
-o -print
16781678

16791679
# Perform some verification checks on any modified files.
1680-
patchcheck: all
1680+
patchcheck: @DEF_MAKE_RULE@
16811681
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
16821682

16831683
# Dependencies

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ Jason Orendorff
10961096
Douglas Orr
10971097
William Orr
10981098
Michele Orrù
1099+
Tomáš Orsava
10991100
Oleg Oshmyan
11001101
Denis S. Otkidach
11011102
Peter Otten

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ Documentation
211211
Build
212212
-----
213213

214+
- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
215+
``make install`` and some other make targets when configured with
216+
``--enable-optimizations``.
217+
214218
- bpo-23404: Don't regenerate generated files based on file modification time
215219
anymore: the action is now explicit. Replace ``make touch`` with
216220
``make regen-all``.

0 commit comments

Comments
 (0)