twindows build: cache pip downloads - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit dded25f39874223b0d5d6c94ca9824542f4f4584 (DIR) parent f1f584c4c43586a265f11291da0ddbb4ab1a2f79 (HTM) Author: SomberNight <somber.night@protonmail.com> Date: Sun, 7 Mar 2021 22:12:26 +0100 windows build: cache pip downloads Diffstat: M contrib/build-linux/appimage/build… | 14 +++++++------- M contrib/build-wine/build-electrum-… | 11 ++++++++--- M contrib/build-wine/build.sh | 3 ++- M contrib/build-wine/prepare-wine.sh | 6 ++---- 4 files changed, 19 insertions(+), 15 deletions(-) --- (DIR) diff --git a/contrib/build-linux/appimage/build.sh b/contrib/build-linux/appimage/build.sh t@@ -9,6 +9,7 @@ DISTDIR="$PROJECT_ROOT/dist" BUILDDIR="$CONTRIB_APPIMAGE/build/appimage" APPDIR="$BUILDDIR/electrum.AppDir" CACHEDIR="$CONTRIB_APPIMAGE/.cache/appimage" +PIP_CACHE_DIR="$CACHEDIR/pip_cache" export GCC_STRIP_BINARIES="1" t@@ -26,7 +27,7 @@ APPIMAGE="$DISTDIR/electrum-$VERSION-x86_64.AppImage" . "$CONTRIB"/build_tools_util.sh rm -rf "$BUILDDIR" -mkdir -p "$APPDIR" "$CACHEDIR" "$DISTDIR" +mkdir -p "$APPDIR" "$CACHEDIR" "$PIP_CACHE_DIR" "$DISTDIR" # potential leftover from setuptools that might make pip put garbage in binary rm -rf "$PROJECT_ROOT/build" t@@ -118,9 +119,8 @@ info "preparing electrum-locale." info "Installing build dependencies." -mkdir -p "$CACHEDIR/pip_cache" "$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \ - --cache-dir "$CACHEDIR/pip_cache" -r "$CONTRIB/deterministic-build/requirements-build-appimage.txt" + --cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-build-appimage.txt" info "installing electrum and its dependencies." # note: we prefer compiling C extensions ourselves, instead of using binary wheels, t@@ -128,14 +128,14 @@ info "installing electrum and its dependencies." # - PyQt5, as it's harder to build from source # - cryptography, as building it would need openssl 1.1, not available on ubuntu 16.04 "$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \ - --cache-dir "$CACHEDIR/pip_cache" -r "$CONTRIB/deterministic-build/requirements.txt" + --cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements.txt" "$python" -m pip install --no-dependencies --no-binary :all: --only-binary pyqt5,cryptography --no-warn-script-location \ - --cache-dir "$CACHEDIR/pip_cache" -r "$CONTRIB/deterministic-build/requirements-binaries.txt" + --cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-binaries.txt" "$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \ - --cache-dir "$CACHEDIR/pip_cache" -r "$CONTRIB/deterministic-build/requirements-hw.txt" + --cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-hw.txt" "$python" -m pip install --no-dependencies --no-warn-script-location \ - --cache-dir "$CACHEDIR/pip_cache" "$PROJECT_ROOT" + --cache-dir "$PIP_CACHE_DIR" "$PROJECT_ROOT" # was only needed during build time, not runtime "$python" -m pip uninstall -y Cython (DIR) diff --git a/contrib/build-wine/build-electrum-git.sh b/contrib/build-wine/build-electrum-git.sh t@@ -7,7 +7,7 @@ export WINEPREFIX=/opt/wine64 export WINEDEBUG=-all export PYTHONDONTWRITEBYTECODE=1 -PYHOME=c:/python3 +PYHOME="c:/python3" PYTHON="wine $PYHOME/python.exe -OO -B" t@@ -42,9 +42,14 @@ popd # Install frozen dependencies -$PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"/deterministic-build/requirements.txt +$PYTHON -m pip install --no-dependencies --no-warn-script-location \ + --cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements.txt -$PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"/deterministic-build/requirements-hw.txt +$PYTHON -m pip install --no-dependencies --no-warn-script-location \ + --cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-binaries.txt + +$PYTHON -m pip install --no-dependencies --no-warn-script-location \ + --cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-hw.txt pushd $WINEPREFIX/drive_c/electrum # see https://github.com/pypa/pip/issues/2195 -- pip makes a copy of the entire directory (DIR) diff --git a/contrib/build-wine/build.sh b/contrib/build-wine/build.sh t@@ -24,7 +24,8 @@ export GCC_STRIP_BINARIES="1" export CONTRIB="$here/.." export PROJECT_ROOT="$CONTRIB/.." export CACHEDIR="$here/.cache/$WIN_ARCH" -export PIP_CACHE_DIR="$CACHEDIR/pip_cache" +export PIP_CACHE_DIR="$CACHEDIR/wine_pip_cache" +export WINE_PIP_CACHE_DIR="c:/electrum/contrib/build-wine/.cache/$WIN_ARCH/wine_pip_cache" export DLL_TARGET_DIR="$CACHEDIR/dlls" . "$CONTRIB"/build_tools_util.sh (DIR) diff --git a/contrib/build-wine/prepare-wine.sh b/contrib/build-wine/prepare-wine.sh t@@ -63,10 +63,8 @@ done break_legacy_easy_install info "Installing build dependencies." -$PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"/deterministic-build/requirements-build-wine.txt - -info "Installing dependencies specific to binaries." -$PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"/deterministic-build/requirements-binaries.txt +$PYTHON -m pip install --no-dependencies --no-warn-script-location \ + --cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-build-wine.txt info "Installing NSIS." download_if_not_exist "$CACHEDIR/$NSIS_FILENAME" "$NSIS_URL"