From e993baf3bf006fa7ba434ce3524a42f2cb3a571e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 10:08:48 +0300 Subject: [PATCH 01/14] Build on xcode9 Homebrew doesn't support 10.12 any more, so build the dependencies without homebrew. --- .travis.yml | 23 ++++++----------------- ci/osx-deps | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 17 deletions(-) create mode 100755 ci/osx-deps diff --git a/.travis.yml b/.travis.yml index 76582fadd68b..7e7359e9e7ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,8 +87,9 @@ matrix: env: - PRE=--pre - os: osx + osx_image: xcode9 language: generic # https://github.com/travis-ci/travis-ci/issues/2312 - only: master + #only: master cache: # As for now travis caches only "$HOME/.cache/pip" # https://docs.travis-ci.com/user/caching/#pip-cache @@ -101,26 +102,14 @@ matrix: allow_failures: - python: "nightly" -before_install: | +before_install: +- | case "$TRAVIS_OS_NAME" in linux) export PATH=/usr/lib/ccache:$PATH ;; osx) - set -e - ci/silence brew update - brew uninstall numpy gdal postgis - brew unlink python@2 - brew install python || brew upgrade python - brew install ffmpeg imagemagick mplayer ccache - hash -r - which python - python --version - set +e - # We could install ghostscript and inkscape here to test svg and pdf - # but this makes the test time really long. - # brew install ghostscript inkscape - export PATH=/usr/local/opt/python/libexec/bin:/usr/local/opt/ccache/libexec:$PATH + ci/osx-deps ;; esac @@ -169,7 +158,7 @@ install: export CPPFLAGS=--coverage fi - | - python -mpip install -ve . # Install Matplotlib. + python -mpip install -e . # Install Matplotlib. - | if [[ $TRAVIS_OS_NAME != 'osx' ]]; then unset CPPFLAGS diff --git a/ci/osx-deps b/ci/osx-deps new file mode 100755 index 000000000000..0e8b1befc42a --- /dev/null +++ b/ci/osx-deps @@ -0,0 +1,51 @@ +#!/bin/bash + +set -euo pipefail + +echo travis_fold:start:Python +curl -O https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg +sudo installer -package python-3.8.5-macosx10.9.pkg -target / +sudo ln -s /usr/local/bin/python3 /usr/local/bin/python +hash -r +echo travis_fold:end:Python + +echo travis_fold:start:ccache +curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz +tar xf ccache-3.7.11.tar.xz +pushd ccache-3.7.11 +./configure --prefix=/usr/local +make +make install +popd +for compiler in clang clang++ cc gcc c++ g++; do + ln -sf ccache /usr/local/bin/$compiler +done +echo travis_fold:end:ccache + +echo travis_fold:start:pkg-config +curl -O -L https://dl.bintray.com/homebrew/mirror/pkg-config-0.29.2.tar.gz +tar xf pkg-config-0.29.2.tar.gz +pushd pkg-config-0.29.2 +./configure --disable-debug --prefix=/usr/local --disable-host-tool \ + --with-internal-glib --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/local/pkgconfig \ + --with-system-include-path=/usr/include +make +make install +popd +echo travis_fold:end:pkg-config + +echo travis_fold:start:libpng +curl -O -L https://downloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz +tar xf libpng-1.6.37.tar.xz +pushd libpng-1.6.37 +./configure --disable-dependency-tracking --disable-silent-rules --prefix=/usr/local +make +make install +popd +echo travis_fold:end:libpng + +echo travis_fold:start:freetype +curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz +mkdir -p build +tar -x -C build -f freetype-2.6.1.tar.gz +echo travis_fold:end:freetype From ae28d9dcbb9b0ba2c497114a4afea27f408befe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 16:13:58 +0300 Subject: [PATCH 02/14] Try to install Qt 4.8 --- ci/osx-deps | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci/osx-deps b/ci/osx-deps index 0e8b1befc42a..7246ae8ab5b8 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -9,6 +9,15 @@ sudo ln -s /usr/local/bin/python3 /usr/local/bin/python hash -r echo travis_fold:end:Python +echo travis_fold:start:Qt4.8 +curl -O https://download.qt.io/archive/qt/4.8/4.8.7/qt-opensource-mac-4.8.7.dmg +hdiutil attach qt-opensource-mac-4.8.7.dmg +sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_headers.pkg' -target / +sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_imports.pkg' -target / +sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_libraries.pkg' -target / +hdiutil detach '/Volumes/Qt 4.8.7' +echo travis_fold:end:Qt4.8 + echo travis_fold:start:ccache curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz tar xf ccache-3.7.11.tar.xz From 92a3b539aeb101a29f105d4119e5dd51a4dd9eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 16:52:37 +0300 Subject: [PATCH 03/14] Add some decorative titles in the travis output --- ci/osx-deps | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/ci/osx-deps b/ci/osx-deps index 7246ae8ab5b8..ebf58d2428c5 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -2,23 +2,26 @@ set -euo pipefail -echo travis_fold:start:Python +echo -e "travis_fold:start:Python\e[2K" +echo "Install Python 3.8 from python.org" curl -O https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg sudo installer -package python-3.8.5-macosx10.9.pkg -target / sudo ln -s /usr/local/bin/python3 /usr/local/bin/python hash -r -echo travis_fold:end:Python +echo -e "travis_fold:end:Python\e[2K" -echo travis_fold:start:Qt4.8 +echo -e "travis_fold:start:Qt4.8\e[2K" +echo "Install Qt 4.8 from qt.io" curl -O https://download.qt.io/archive/qt/4.8/4.8.7/qt-opensource-mac-4.8.7.dmg hdiutil attach qt-opensource-mac-4.8.7.dmg sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_headers.pkg' -target / sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_imports.pkg' -target / sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_libraries.pkg' -target / hdiutil detach '/Volumes/Qt 4.8.7' -echo travis_fold:end:Qt4.8 +echo -e "travis_fold:end:Qt4.8\e[2K" -echo travis_fold:start:ccache +echo -e "travis_fold:start:ccache\e[2K" +echo 'Install ccache (compile it ourselves)' curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz tar xf ccache-3.7.11.tar.xz pushd ccache-3.7.11 @@ -29,9 +32,10 @@ popd for compiler in clang clang++ cc gcc c++ g++; do ln -sf ccache /usr/local/bin/$compiler done -echo travis_fold:end:ccache +echo -e "travis_fold:end:ccache\e[2K" -echo travis_fold:start:pkg-config +echo -e "travis_fold:start:pkg-config\e[2K" +echo 'Install pkg-config (compile it ourselves)' curl -O -L https://dl.bintray.com/homebrew/mirror/pkg-config-0.29.2.tar.gz tar xf pkg-config-0.29.2.tar.gz pushd pkg-config-0.29.2 @@ -41,9 +45,10 @@ pushd pkg-config-0.29.2 make make install popd -echo travis_fold:end:pkg-config +echo -e "travis_fold:end:pkg-config\e[2K" -echo travis_fold:start:libpng +echo -e "travis_fold:start:libpng\e[2K" +echo 'Install libpng (compile it ourselves)' curl -O -L https://downloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz tar xf libpng-1.6.37.tar.xz pushd libpng-1.6.37 @@ -51,10 +56,11 @@ pushd libpng-1.6.37 make make install popd -echo travis_fold:end:libpng +echo -e "travis_fold:end:libpng\e[2K" -echo travis_fold:start:freetype +echo -e "travis_fold:start:freetype\e[2K" +echo 'Install libpng (just unpack into the build directory)' curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz mkdir -p build tar -x -C build -f freetype-2.6.1.tar.gz -echo travis_fold:end:freetype +echo -e "travis_fold:end:freetype\e[2K" From 4cfaa9e75069c82fbd59c9756c086a465ec6e7c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 16:53:08 +0300 Subject: [PATCH 04/14] Skip the tests requiring Qt5 --- lib/matplotlib/tests/test_backend_qt.py | 6 ++++++ lib/matplotlib/tests/test_backends_interactive.py | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/matplotlib/tests/test_backend_qt.py b/lib/matplotlib/tests/test_backend_qt.py index 564192d6ec1d..3aee9331ce45 100644 --- a/lib/matplotlib/tests/test_backend_qt.py +++ b/lib/matplotlib/tests/test_backend_qt.py @@ -9,6 +9,12 @@ import pytest +try: + from matplotlib.backends.qt_compat import QtGui +except ImportError: + pytestmark = pytest.mark.skip('No usable Qt5 bindings') + + @pytest.fixture def qt_core(request): backend, = request.node.get_closest_marker('backend').args diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index a14530c2cd75..0a50abd9fa19 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -18,6 +18,12 @@ # versions so we don't fail on missing backends. def _get_testable_interactive_backends(): + try: + from matplotlib.backends.qt_compat import QtGui + have_qt5 = True + except ImportError: + have_qt5 = False + backends = [] for deps, backend in [ (["cairo", "gi"], "gtk3agg"), @@ -39,6 +45,8 @@ def _get_testable_interactive_backends(): reason = "{} cannot be imported".format(", ".join(missing)) elif backend == 'macosx' and os.environ.get('TF_BUILD'): reason = "macosx backend fails on Azure" + elif 'qt5' in backend and not have_qt5: + reason = "no usable Qt5 bindings" if reason: backend = pytest.param( backend, From a43518f028a350c1d42076af0d5b7e1f7c1709ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 17:27:51 +0300 Subject: [PATCH 05/14] See if we can add timings to the titles --- .travis.yml | 1 + ci/osx-deps | 47 +++++++++++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e7359e9e7ce..f60e4ccbb4fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,6 +104,7 @@ matrix: before_install: - | + # Install libraries and set up ccache case "$TRAVIS_OS_NAME" in linux) export PATH=/usr/lib/ccache:$PATH diff --git a/ci/osx-deps b/ci/osx-deps index ebf58d2428c5..ea377709a152 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -2,26 +2,40 @@ set -euo pipefail -echo -e "travis_fold:start:Python\e[2K" -echo "Install Python 3.8 from python.org" +fold_start() { + key=$1 + title=$2 + echo -e "travis_fold:start:$key\e[2K" + echo -e "travis_time:start:$key\e[2K" + tick="$(date +%s)" + echo "$title" +} + +fold_end() { + key=$1 + tock="$(date +%s)" + nano=000000000 + echo -e "travis_time:end:$key:start=$tick$nano,finish=$tock$nano,duration=$((tock - tick))$nano\e[2K" + echo -e "travis_fold:end:$key\e[2K" +} + +fold_start Python "Install Python 3.8 from python.org" curl -O https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg sudo installer -package python-3.8.5-macosx10.9.pkg -target / sudo ln -s /usr/local/bin/python3 /usr/local/bin/python hash -r -echo -e "travis_fold:end:Python\e[2K" +fold_end Python -echo -e "travis_fold:start:Qt4.8\e[2K" -echo "Install Qt 4.8 from qt.io" +fold_start Qt4.8 "Install Qt 4.8 from qt.io" curl -O https://download.qt.io/archive/qt/4.8/4.8.7/qt-opensource-mac-4.8.7.dmg hdiutil attach qt-opensource-mac-4.8.7.dmg sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_headers.pkg' -target / sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_imports.pkg' -target / sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_libraries.pkg' -target / hdiutil detach '/Volumes/Qt 4.8.7' -echo -e "travis_fold:end:Qt4.8\e[2K" +fold_end Qt4.8 -echo -e "travis_fold:start:ccache\e[2K" -echo 'Install ccache (compile it ourselves)' +fold_start ccache 'Install ccache (compile it ourselves)' curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz tar xf ccache-3.7.11.tar.xz pushd ccache-3.7.11 @@ -32,10 +46,9 @@ popd for compiler in clang clang++ cc gcc c++ g++; do ln -sf ccache /usr/local/bin/$compiler done -echo -e "travis_fold:end:ccache\e[2K" +fold_end ccache -echo -e "travis_fold:start:pkg-config\e[2K" -echo 'Install pkg-config (compile it ourselves)' +fold_start pkg-config 'Install pkg-config (compile it ourselves)' curl -O -L https://dl.bintray.com/homebrew/mirror/pkg-config-0.29.2.tar.gz tar xf pkg-config-0.29.2.tar.gz pushd pkg-config-0.29.2 @@ -45,10 +58,9 @@ pushd pkg-config-0.29.2 make make install popd -echo -e "travis_fold:end:pkg-config\e[2K" +fold_end pkg-config -echo -e "travis_fold:start:libpng\e[2K" -echo 'Install libpng (compile it ourselves)' +fold_start libpng 'Install libpng (compile it ourselves)' curl -O -L https://downloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz tar xf libpng-1.6.37.tar.xz pushd libpng-1.6.37 @@ -56,11 +68,10 @@ pushd libpng-1.6.37 make make install popd -echo -e "travis_fold:end:libpng\e[2K" +fold_end libpng -echo -e "travis_fold:start:freetype\e[2K" -echo 'Install libpng (just unpack into the build directory)' +fold_start freetype 'Install freetype (just unpack into the build directory)' curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz mkdir -p build tar -x -C build -f freetype-2.6.1.tar.gz -echo -e "travis_fold:end:freetype\e[2K" +fold_end freetype From d7fa78b58747fe46ec6d1cbc6076f5929bf8f526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 18:08:08 +0300 Subject: [PATCH 06/14] Skip warning about unused import --- lib/matplotlib/tests/test_backends_interactive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 0a50abd9fa19..5bd06baa8b26 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -19,7 +19,7 @@ def _get_testable_interactive_backends(): try: - from matplotlib.backends.qt_compat import QtGui + from matplotlib.backends.qt_compat import QtGui # noqa have_qt5 = True except ImportError: have_qt5 = False From 51740ecec6bf6e79320da9cbc1b02e9280a91de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Fri, 31 Jul 2020 19:03:23 +0300 Subject: [PATCH 07/14] uncomment only: master does it actually do anything? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f60e4ccbb4fe..ffcfb42e638d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -89,7 +89,7 @@ matrix: - os: osx osx_image: xcode9 language: generic # https://github.com/travis-ci/travis-ci/issues/2312 - #only: master + only: master cache: # As for now travis caches only "$HOME/.cache/pip" # https://docs.travis-ci.com/user/caching/#pip-cache From 66d9a2162d157e918c9dc2dcc12868cc6b3880cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sat, 1 Aug 2020 05:48:29 +0300 Subject: [PATCH 08/14] Remove Qt4.8 --- ci/osx-deps | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ci/osx-deps b/ci/osx-deps index ea377709a152..3c3823b264e3 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -26,15 +26,6 @@ sudo ln -s /usr/local/bin/python3 /usr/local/bin/python hash -r fold_end Python -fold_start Qt4.8 "Install Qt 4.8 from qt.io" -curl -O https://download.qt.io/archive/qt/4.8/4.8.7/qt-opensource-mac-4.8.7.dmg -hdiutil attach qt-opensource-mac-4.8.7.dmg -sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_headers.pkg' -target / -sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_imports.pkg' -target / -sudo installer -package '/Volumes/Qt 4.8.7/packages/Qt_libraries.pkg' -target / -hdiutil detach '/Volumes/Qt 4.8.7' -fold_end Qt4.8 - fold_start ccache 'Install ccache (compile it ourselves)' curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz tar xf ccache-3.7.11.tar.xz From 9c676763515a15f33a21815397e39ac791f41d4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 2 Aug 2020 09:05:19 +0300 Subject: [PATCH 09/14] Don't install libpng --- ci/osx-deps | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ci/osx-deps b/ci/osx-deps index 3c3823b264e3..d5ba239ce711 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -51,15 +51,6 @@ make install popd fold_end pkg-config -fold_start libpng 'Install libpng (compile it ourselves)' -curl -O -L https://downloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz -tar xf libpng-1.6.37.tar.xz -pushd libpng-1.6.37 -./configure --disable-dependency-tracking --disable-silent-rules --prefix=/usr/local -make -make install -popd -fold_end libpng fold_start freetype 'Install freetype (just unpack into the build directory)' curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz From ea02ac16bde11e602edac3d5f34ea1bde1a98f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 2 Aug 2020 09:16:10 +0300 Subject: [PATCH 10/14] Don't install pkg-config --- ci/osx-deps | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/ci/osx-deps b/ci/osx-deps index d5ba239ce711..838d85e6f98f 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -39,19 +39,6 @@ for compiler in clang clang++ cc gcc c++ g++; do done fold_end ccache -fold_start pkg-config 'Install pkg-config (compile it ourselves)' -curl -O -L https://dl.bintray.com/homebrew/mirror/pkg-config-0.29.2.tar.gz -tar xf pkg-config-0.29.2.tar.gz -pushd pkg-config-0.29.2 -./configure --disable-debug --prefix=/usr/local --disable-host-tool \ - --with-internal-glib --with-pc-path=/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/local/pkgconfig \ - --with-system-include-path=/usr/include -make -make install -popd -fold_end pkg-config - - fold_start freetype 'Install freetype (just unpack into the build directory)' curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz mkdir -p build From 65115e09d60416236ffe7eeabc13fbd58a6bc762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 2 Aug 2020 09:42:19 +0300 Subject: [PATCH 11/14] Put the downloads in ~/Downloads and put that directory in the Travis cache, for perhaps an additional speedup and to reduce the traffic we cause to the download sites --- .travis.yml | 1 + ci/osx-deps | 30 ++++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index ffcfb42e638d..577add257ad3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ cache: directories: - $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853 - $HOME/.cache/matplotlib + - $HOME/Downloads addons: artifacts: diff --git a/ci/osx-deps b/ci/osx-deps index 838d85e6f98f..db6dc5100fc2 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -19,16 +19,32 @@ fold_end() { echo -e "travis_fold:end:$key\e[2K" } +cached_download() { + file=$1 + url=$2 + shasum=$3 + path="$HOME/Downloads/$file" + if [[ ! -f "$path" + || "$(shasum -a 256 "$HOME/Downloads/$file" | awk '{print $1}')" != "$shasum" ]] + then + curl -L -o "$path" "$url" + fi +} + fold_start Python "Install Python 3.8 from python.org" -curl -O https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg -sudo installer -package python-3.8.5-macosx10.9.pkg -target / +cached_download python-3.8.5-macosx10.9.pkg \ + https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg \ + e27c5a510c10f830084fb9c60b9e9aa8719d92e4537a80e6b4252c02396f0d29 +sudo installer -package "$HOME"/Downloads/python-3.8.5-macosx10.9.pkg -target / sudo ln -s /usr/local/bin/python3 /usr/local/bin/python hash -r fold_end Python fold_start ccache 'Install ccache (compile it ourselves)' -curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz -tar xf ccache-3.7.11.tar.xz +cached_download ccache-3.7.11.tar.xz \ + https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz \ + 8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68 +tar xf "$HOME"/Downloads/ccache-3.7.11.tar.xz pushd ccache-3.7.11 ./configure --prefix=/usr/local make @@ -40,7 +56,9 @@ done fold_end ccache fold_start freetype 'Install freetype (just unpack into the build directory)' -curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz +cached_download freetype-2.6.1.tar.gz \ + https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz \ + 0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014 mkdir -p build -tar -x -C build -f freetype-2.6.1.tar.gz +tar -x -C build -f "$HOME"/Downloads/freetype-2.6.1.tar.gz fold_end freetype From d5528166f95b7666dad012b23e5b55379fc80ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 2 Aug 2020 09:53:49 +0300 Subject: [PATCH 12/14] Simplify script and use two processes for ccache compilation --- ci/osx-deps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/osx-deps b/ci/osx-deps index db6dc5100fc2..d70c120495d8 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -25,7 +25,7 @@ cached_download() { shasum=$3 path="$HOME/Downloads/$file" if [[ ! -f "$path" - || "$(shasum -a 256 "$HOME/Downloads/$file" | awk '{print $1}')" != "$shasum" ]] + || "$(shasum -a 256 "$path" | awk '{print $1}')" != "$shasum" ]] then curl -L -o "$path" "$url" fi @@ -47,7 +47,7 @@ cached_download ccache-3.7.11.tar.xz \ tar xf "$HOME"/Downloads/ccache-3.7.11.tar.xz pushd ccache-3.7.11 ./configure --prefix=/usr/local -make +make -j2 make install popd for compiler in clang clang++ cc gcc c++ g++; do From 85b6da95934b2f52fcf5f7159261000fde0977c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 2 Aug 2020 10:07:10 +0300 Subject: [PATCH 13/14] Try caching the downloads elsewhere $HOME/Downloads did not get cached, .cache/matplotlib already is --- .travis.yml | 1 - ci/osx-deps | 9 +++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 577add257ad3..ffcfb42e638d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ cache: directories: - $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853 - $HOME/.cache/matplotlib - - $HOME/Downloads addons: artifacts: diff --git a/ci/osx-deps b/ci/osx-deps index d70c120495d8..2f00bb9ffa67 100755 --- a/ci/osx-deps +++ b/ci/osx-deps @@ -1,6 +1,7 @@ #!/bin/bash set -euo pipefail +cache="$HOME"/.cache/matplotlib fold_start() { key=$1 @@ -23,7 +24,7 @@ cached_download() { file=$1 url=$2 shasum=$3 - path="$HOME/Downloads/$file" + path="$cache/$file" if [[ ! -f "$path" || "$(shasum -a 256 "$path" | awk '{print $1}')" != "$shasum" ]] then @@ -35,7 +36,7 @@ fold_start Python "Install Python 3.8 from python.org" cached_download python-3.8.5-macosx10.9.pkg \ https://www.python.org/ftp/python/3.8.5/python-3.8.5-macosx10.9.pkg \ e27c5a510c10f830084fb9c60b9e9aa8719d92e4537a80e6b4252c02396f0d29 -sudo installer -package "$HOME"/Downloads/python-3.8.5-macosx10.9.pkg -target / +sudo installer -package "$cache"/python-3.8.5-macosx10.9.pkg -target / sudo ln -s /usr/local/bin/python3 /usr/local/bin/python hash -r fold_end Python @@ -44,7 +45,7 @@ fold_start ccache 'Install ccache (compile it ourselves)' cached_download ccache-3.7.11.tar.xz \ https://github.com/ccache/ccache/releases/download/v3.7.11/ccache-3.7.11.tar.xz \ 8d450208099a4d202bd7df87caaec81baee20ce9dd62da91e9ea7b95a9072f68 -tar xf "$HOME"/Downloads/ccache-3.7.11.tar.xz +tar xf "$cache"/ccache-3.7.11.tar.xz pushd ccache-3.7.11 ./configure --prefix=/usr/local make -j2 @@ -60,5 +61,5 @@ cached_download freetype-2.6.1.tar.gz \ https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz \ 0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014 mkdir -p build -tar -x -C build -f "$HOME"/Downloads/freetype-2.6.1.tar.gz +tar -x -C build -f "$cache"/freetype-2.6.1.tar.gz fold_end freetype From 968b06384ef3770f7cae0512a41a4a44aab6f046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jouni=20K=2E=20Sepp=C3=A4nen?= Date: Sun, 2 Aug 2020 10:27:54 +0300 Subject: [PATCH 14/14] Clarify comment --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ffcfb42e638d..613c80c15b9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,7 +104,7 @@ matrix: before_install: - | - # Install libraries and set up ccache + # Install OS dependencies and set up ccache case "$TRAVIS_OS_NAME" in linux) export PATH=/usr/lib/ccache:$PATH