Skip to content

Commit ec95815

Browse files
author
Doug Greiman
committed
Apply patch to fix double-build issue.
Source is python/cpython#1478, backported to 3.5 and 3.6.
1 parent 473fa38 commit ec95815

File tree

7 files changed

+195
-10
lines changed

7 files changed

+195
-10
lines changed

python-interpreter-builder/Dockerfile.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ ENV LANG C.UTF-8
4444

4545
# Add build scripts
4646
ADD scripts /scripts
47+
ADD patches /patches
4748

4849
# Build the Python interpreters
4950
RUN /scripts/build-python-3.5.sh
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Index: Python-3.5.3/Makefile.pre.in
2+
===================================================================
3+
--- Python-3.5.3.orig/Makefile.pre.in
4+
+++ Python-3.5.3/Makefile.pre.in
5+
@@ -982,7 +982,7 @@ TESTTIMEOUT= 3600
6+
7+
# Run a basic set of regression tests.
8+
# This excludes some tests that are particularly resource-intensive.
9+
-test: all platform
10+
+test: @DEF_MAKE_RULE@ platform
11+
$(TESTRUNNER) $(TESTOPTS)
12+
13+
# Run the full test suite twice - once without .pyc files, and once with.
14+
@@ -992,7 +992,7 @@ test: all platform
15+
# the bytecode read from a .pyc file had the bug, sometimes the directly
16+
# generated bytecode. This is sometimes a very shy bug needing a lot of
17+
# sample data.
18+
-testall: all platform
19+
+testall: @DEF_MAKE_RULE@ platform
20+
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
21+
$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
22+
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
23+
@@ -1001,7 +1001,7 @@ testall: all platform
24+
25+
# Run the test suite for both architectures in a Universal build on OSX.
26+
# Must be run on an Intel box.
27+
-testuniversal: all platform
28+
+testuniversal: @DEF_MAKE_RULE@ platform
29+
if [ `arch` != 'i386' ];then \
30+
echo "This can only be used on OSX/i386" ;\
31+
exit 1 ;\
32+
@@ -1024,7 +1024,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subpr
33+
test_multiprocessing_forkserver \
34+
test_mailbox test_socket test_poll \
35+
test_select test_zipfile test_concurrent_futures
36+
-quicktest: all platform
37+
+quicktest: @DEF_MAKE_RULE@ platform
38+
$(TESTRUNNER) $(QUICKTESTOPTS)
39+
40+
41+
@@ -1376,7 +1376,7 @@ LIBPL= @LIBPL@
42+
# pkgconfig directory
43+
LIBPC= $(LIBDIR)/pkgconfig
44+
45+
-libainstall: all python-config
46+
+libainstall: @DEF_MAKE_RULE@ python-config
47+
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
48+
do \
49+
if test ! -d $(DESTDIR)$$i; then \
50+
@@ -1635,7 +1635,7 @@ distclean: clobber
51+
-exec rm -f {} ';'
52+
53+
# Check for smelly exported symbols (not starting with Py/_Py)
54+
-smelly: all
55+
+smelly: @DEF_MAKE_RULE@
56+
nm -p $(LIBRARY) | \
57+
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
58+
59+
@@ -1673,7 +1673,7 @@ funny:
60+
-o -print
61+
62+
# Perform some verification checks on any modified files.
63+
-patchcheck: all
64+
+patchcheck: @DEF_MAKE_RULE@
65+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
66+
67+
# Dependencies
68+
Index: Python-3.5.3/Misc/ACKS
69+
===================================================================
70+
--- Python-3.5.3.orig/Misc/ACKS
71+
+++ Python-3.5.3/Misc/ACKS
72+
@@ -1092,6 +1092,7 @@ Jason Orendorff
73+
Douglas Orr
74+
William Orr
75+
Michele Orrù
76+
+Tomáš Orsava
77+
Oleg Oshmyan
78+
Denis S. Otkidach
79+
Peter Otten
80+
Index: Python-3.5.3/Misc/NEWS
81+
===================================================================
82+
--- Python-3.5.3.orig/Misc/NEWS
83+
+++ Python-3.5.3/Misc/NEWS
84+
@@ -634,6 +634,10 @@ Windows
85+
Build
86+
-----
87+
88+
+- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
89+
+ ``make install`` and some other make targets when configured with
90+
+ ``--enable-optimizations``.
91+
+
92+
- Issue #29080: Removes hard dependency on hg.exe from PCBuild/build.bat
93+
94+
- Issue #23903: Added missed names to PC/python3.def.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
double-build.diff
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Index: Python-3.6.1/Makefile.pre.in
2+
===================================================================
3+
--- Python-3.6.1.orig/Makefile.pre.in
4+
+++ Python-3.6.1/Makefile.pre.in
5+
@@ -1000,7 +1000,7 @@ TESTTIMEOUT= 1200
6+
7+
# Run a basic set of regression tests.
8+
# This excludes some tests that are particularly resource-intensive.
9+
-test: all platform
10+
+test: @DEF_MAKE_RULE@ platform
11+
$(TESTRUNNER) $(TESTOPTS)
12+
13+
# Run the full test suite twice - once without .pyc files, and once with.
14+
@@ -1010,7 +1010,7 @@ test: all platform
15+
# the bytecode read from a .pyc file had the bug, sometimes the directly
16+
# generated bytecode. This is sometimes a very shy bug needing a lot of
17+
# sample data.
18+
-testall: all platform
19+
+testall: @DEF_MAKE_RULE@ platform
20+
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
21+
$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
22+
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
23+
@@ -1019,7 +1019,7 @@ testall: all platform
24+
25+
# Run the test suite for both architectures in a Universal build on OSX.
26+
# Must be run on an Intel box.
27+
-testuniversal: all platform
28+
+testuniversal: @DEF_MAKE_RULE@ platform
29+
if [ `arch` != 'i386' ];then \
30+
echo "This can only be used on OSX/i386" ;\
31+
exit 1 ;\
32+
@@ -1042,7 +1042,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subpr
33+
test_multiprocessing_forkserver \
34+
test_mailbox test_socket test_poll \
35+
test_select test_zipfile test_concurrent_futures
36+
-quicktest: all platform
37+
+quicktest: @DEF_MAKE_RULE@ platform
38+
$(TESTRUNNER) $(QUICKTESTOPTS)
39+
40+
41+
@@ -1379,7 +1379,7 @@ LIBPL= @LIBPL@
42+
# pkgconfig directory
43+
LIBPC= $(LIBDIR)/pkgconfig
44+
45+
-libainstall: all python-config
46+
+libainstall: @DEF_MAKE_RULE@ python-config
47+
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
48+
do \
49+
if test ! -d $(DESTDIR)$$i; then \
50+
@@ -1639,7 +1639,7 @@ distclean: clobber
51+
-exec rm -f {} ';'
52+
53+
# Check for smelly exported symbols (not starting with Py/_Py)
54+
-smelly: all
55+
+smelly: @DEF_MAKE_RULE@
56+
nm -p $(LIBRARY) | \
57+
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
58+
59+
@@ -1676,7 +1676,7 @@ funny:
60+
-o -print
61+
62+
# Perform some verification checks on any modified files.
63+
-patchcheck: all
64+
+patchcheck: @DEF_MAKE_RULE@
65+
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
66+
67+
# Dependencies
68+
Index: Python-3.6.1/Misc/ACKS
69+
===================================================================
70+
--- Python-3.6.1.orig/Misc/ACKS
71+
+++ Python-3.6.1/Misc/ACKS
72+
@@ -1111,6 +1111,7 @@ Jason Orendorff
73+
Douglas Orr
74+
William Orr
75+
Michele Orrù
76+
+Tomáš Orsava
77+
Oleg Oshmyan
78+
Denis S. Otkidach
79+
Peter Otten
80+
Index: Python-3.6.1/Misc/NEWS
81+
===================================================================
82+
--- Python-3.6.1.orig/Misc/NEWS
83+
+++ Python-3.6.1/Misc/NEWS
84+
@@ -306,6 +306,10 @@ Tests
85+
Build
86+
-----
87+
88+
+- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
89+
+ ``make install`` and some other make targets when configured with
90+
+ ``--enable-optimizations``.
91+
+
92+
- bpo-27593: sys.version and the platform module python_build(),
93+
python_branch(), and python_revision() functions now use
94+
git information rather than hg when building from a repo.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
double-build.diff

python-interpreter-builder/scripts/build-python-3.5.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ d8890b84d773cd7059e597dbefa510340de8336ec9b9e9032bf030f19291565a Python-3.5.3.t
1313
EOF
1414
tar xzf Python-3.5.3.tgz
1515

16-
# Build
16+
# Apply patches
1717
cd Python-3.5.3
18+
QUILT_PATCHES=/patches/3.5 quilt push -a
1819

1920
# Explanation of flags:
2021
#
@@ -115,10 +116,6 @@ cd build-static
115116
LDFLAGS="-Wl,-z,relro" \
116117
RANLIB="x86_64-linux-gnu-gcc-ranlib" \
117118

118-
# Due to https://bugs.python.org/issue29243, "make altinstall"
119-
# rebuilds everything from scratch, twice. This is a workaround.
120-
sed -i 's/^all:.*$/all: build_all/' Makefile
121-
122119
make profile-opt
123120
make altinstall
124121

python-interpreter-builder/scripts/build-python-3.6.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ aa50b0143df7c89ce91be020fe41382613a817354b33acdc6641b44f8ced3828 Python-3.6.1.t
1313
EOF
1414
tar xzf Python-3.6.1.tgz
1515

16-
# Build
16+
# Apply patches
1717
cd Python-3.6.1
18+
QUILT_PATCHES=/patches/3.6 quilt push -a
1819

1920
# Explanation of flags:
2021
#
@@ -115,10 +116,6 @@ cd build-static
115116
LDFLAGS="-Wl,-z,relro" \
116117
RANLIB="x86_64-linux-gnu-gcc-ranlib" \
117118

118-
# Due to https://bugs.python.org/issue29243, "make altinstall"
119-
# rebuilds everything from scratch, twice. This is a workaround.
120-
sed -i 's/^all:.*$/all: build_all/' Makefile
121-
122119
make profile-opt
123120
make altinstall
124121

0 commit comments

Comments
 (0)