Skip to content

Apply patch to fix double-build issue. #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python-interpreter-builder/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ENV LANG C.UTF-8

# Add build scripts
ADD scripts /scripts
ADD patches /patches

# Build the Python interpreters
RUN /scripts/build-python-3.5.sh
Expand Down
96 changes: 96 additions & 0 deletions python-interpreter-builder/patches/3.5/double-build.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Source is https://github.com/python/cpython/pull/1478

Index: Python-3.5.3/Makefile.pre.in
===================================================================
--- Python-3.5.3.orig/Makefile.pre.in
+++ Python-3.5.3/Makefile.pre.in
@@ -982,7 +982,7 @@ TESTTIMEOUT= 3600

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

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

# Run the test suite for both architectures in a Universal build on OSX.
# Must be run on an Intel box.
-testuniversal: all platform
+testuniversal: @DEF_MAKE_RULE@ platform
if [ `arch` != 'i386' ];then \
echo "This can only be used on OSX/i386" ;\
exit 1 ;\
@@ -1024,7 +1024,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subpr
test_multiprocessing_forkserver \
test_mailbox test_socket test_poll \
test_select test_zipfile test_concurrent_futures
-quicktest: all platform
+quicktest: @DEF_MAKE_RULE@ platform
$(TESTRUNNER) $(QUICKTESTOPTS)


@@ -1376,7 +1376,7 @@ LIBPL= @LIBPL@
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig

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

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

@@ -1673,7 +1673,7 @@ funny:
-o -print

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

# Dependencies
Index: Python-3.5.3/Misc/ACKS
===================================================================
--- Python-3.5.3.orig/Misc/ACKS
+++ Python-3.5.3/Misc/ACKS
@@ -1092,6 +1092,7 @@ Jason Orendorff
Douglas Orr
William Orr
Michele Orrù
+Tomáš Orsava
Oleg Oshmyan
Denis S. Otkidach
Peter Otten
Index: Python-3.5.3/Misc/NEWS
===================================================================
--- Python-3.5.3.orig/Misc/NEWS
+++ Python-3.5.3/Misc/NEWS
@@ -634,6 +634,10 @@ Windows
Build
-----

+- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
+ ``make install`` and some other make targets when configured with
+ ``--enable-optimizations``.
+
- Issue #29080: Removes hard dependency on hg.exe from PCBuild/build.bat

- Issue #23903: Added missed names to PC/python3.def.
1 change: 1 addition & 0 deletions python-interpreter-builder/patches/3.5/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
double-build.diff
96 changes: 96 additions & 0 deletions python-interpreter-builder/patches/3.6/double-build.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Source is https://github.com/python/cpython/pull/1478

Index: Python-3.6.1/Makefile.pre.in
===================================================================
--- Python-3.6.1.orig/Makefile.pre.in
+++ Python-3.6.1/Makefile.pre.in
@@ -1000,7 +1000,7 @@ TESTTIMEOUT= 1200

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

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

# Run the test suite for both architectures in a Universal build on OSX.
# Must be run on an Intel box.
-testuniversal: all platform
+testuniversal: @DEF_MAKE_RULE@ platform
if [ `arch` != 'i386' ];then \
echo "This can only be used on OSX/i386" ;\
exit 1 ;\
@@ -1042,7 +1042,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subpr
test_multiprocessing_forkserver \
test_mailbox test_socket test_poll \
test_select test_zipfile test_concurrent_futures
-quicktest: all platform
+quicktest: @DEF_MAKE_RULE@ platform
$(TESTRUNNER) $(QUICKTESTOPTS)


@@ -1379,7 +1379,7 @@ LIBPL= @LIBPL@
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig

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

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

@@ -1676,7 +1676,7 @@ funny:
-o -print

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

# Dependencies
Index: Python-3.6.1/Misc/ACKS
===================================================================
--- Python-3.6.1.orig/Misc/ACKS
+++ Python-3.6.1/Misc/ACKS
@@ -1111,6 +1111,7 @@ Jason Orendorff
Douglas Orr
William Orr
Michele Orrù
+Tomáš Orsava
Oleg Oshmyan
Denis S. Otkidach
Peter Otten
Index: Python-3.6.1/Misc/NEWS
===================================================================
--- Python-3.6.1.orig/Misc/NEWS
+++ Python-3.6.1/Misc/NEWS
@@ -306,6 +306,10 @@ Tests
Build
-----

+- bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
+ ``make install`` and some other make targets when configured with
+ ``--enable-optimizations``.
+
- bpo-27593: sys.version and the platform module python_build(),
python_branch(), and python_revision() functions now use
git information rather than hg when building from a repo.
1 change: 1 addition & 0 deletions python-interpreter-builder/patches/3.6/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
double-build.diff
7 changes: 2 additions & 5 deletions python-interpreter-builder/scripts/build-python-3.5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ d8890b84d773cd7059e597dbefa510340de8336ec9b9e9032bf030f19291565a Python-3.5.3.t
EOF
tar xzf Python-3.5.3.tgz

# Build
# Apply patches
cd Python-3.5.3
QUILT_PATCHES=/patches/3.5 quilt push -a

# Explanation of flags:
#
Expand Down Expand Up @@ -115,10 +116,6 @@ cd build-static
LDFLAGS="-Wl,-z,relro" \
RANLIB="x86_64-linux-gnu-gcc-ranlib" \

# Due to https://bugs.python.org/issue29243, "make altinstall"
# rebuilds everything from scratch, twice. This is a workaround.
sed -i 's/^all:.*$/all: build_all/' Makefile

make profile-opt
make altinstall

Expand Down
7 changes: 2 additions & 5 deletions python-interpreter-builder/scripts/build-python-3.6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ aa50b0143df7c89ce91be020fe41382613a817354b33acdc6641b44f8ced3828 Python-3.6.1.t
EOF
tar xzf Python-3.6.1.tgz

# Build
# Apply patches
cd Python-3.6.1
QUILT_PATCHES=/patches/3.6 quilt push -a

# Explanation of flags:
#
Expand Down Expand Up @@ -115,10 +116,6 @@ cd build-static
LDFLAGS="-Wl,-z,relro" \
RANLIB="x86_64-linux-gnu-gcc-ranlib" \

# Due to https://bugs.python.org/issue29243, "make altinstall"
# rebuilds everything from scratch, twice. This is a workaround.
sed -i 's/^all:.*$/all: build_all/' Makefile

make profile-opt
make altinstall

Expand Down