windows build: cache pip downloads
This commit is contained in:
@@ -9,6 +9,7 @@ DISTDIR="$PROJECT_ROOT/dist"
|
|||||||
BUILDDIR="$CONTRIB_APPIMAGE/build/appimage"
|
BUILDDIR="$CONTRIB_APPIMAGE/build/appimage"
|
||||||
APPDIR="$BUILDDIR/electrum.AppDir"
|
APPDIR="$BUILDDIR/electrum.AppDir"
|
||||||
CACHEDIR="$CONTRIB_APPIMAGE/.cache/appimage"
|
CACHEDIR="$CONTRIB_APPIMAGE/.cache/appimage"
|
||||||
|
PIP_CACHE_DIR="$CACHEDIR/pip_cache"
|
||||||
|
|
||||||
export GCC_STRIP_BINARIES="1"
|
export GCC_STRIP_BINARIES="1"
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ APPIMAGE="$DISTDIR/electrum-$VERSION-x86_64.AppImage"
|
|||||||
. "$CONTRIB"/build_tools_util.sh
|
. "$CONTRIB"/build_tools_util.sh
|
||||||
|
|
||||||
rm -rf "$BUILDDIR"
|
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
|
# potential leftover from setuptools that might make pip put garbage in binary
|
||||||
rm -rf "$PROJECT_ROOT/build"
|
rm -rf "$PROJECT_ROOT/build"
|
||||||
@@ -118,9 +119,8 @@ info "preparing electrum-locale."
|
|||||||
|
|
||||||
|
|
||||||
info "Installing build dependencies."
|
info "Installing build dependencies."
|
||||||
mkdir -p "$CACHEDIR/pip_cache"
|
|
||||||
"$python" -m pip install --no-dependencies --no-binary :all: --no-warn-script-location \
|
"$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."
|
info "installing electrum and its dependencies."
|
||||||
# note: we prefer compiling C extensions ourselves, instead of using binary wheels,
|
# note: we prefer compiling C extensions ourselves, instead of using binary wheels,
|
||||||
@@ -128,14 +128,14 @@ info "installing electrum and its dependencies."
|
|||||||
# - PyQt5, as it's harder to build from source
|
# - PyQt5, as it's harder to build from source
|
||||||
# - cryptography, as building it would need openssl 1.1, not available on ubuntu 16.04
|
# - 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 \
|
"$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 \
|
"$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 \
|
"$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 \
|
"$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
|
# was only needed during build time, not runtime
|
||||||
"$python" -m pip uninstall -y Cython
|
"$python" -m pip uninstall -y Cython
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export WINEPREFIX=/opt/wine64
|
|||||||
export WINEDEBUG=-all
|
export WINEDEBUG=-all
|
||||||
export PYTHONDONTWRITEBYTECODE=1
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
|
|
||||||
PYHOME=c:/python3
|
PYHOME="c:/python3"
|
||||||
PYTHON="wine $PYHOME/python.exe -OO -B"
|
PYTHON="wine $PYHOME/python.exe -OO -B"
|
||||||
|
|
||||||
|
|
||||||
@@ -42,9 +42,14 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
# Install frozen dependencies
|
# 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
|
pushd $WINEPREFIX/drive_c/electrum
|
||||||
# see https://github.com/pypa/pip/issues/2195 -- pip makes a copy of the entire directory
|
# see https://github.com/pypa/pip/issues/2195 -- pip makes a copy of the entire directory
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ export GCC_STRIP_BINARIES="1"
|
|||||||
export CONTRIB="$here/.."
|
export CONTRIB="$here/.."
|
||||||
export PROJECT_ROOT="$CONTRIB/.."
|
export PROJECT_ROOT="$CONTRIB/.."
|
||||||
export CACHEDIR="$here/.cache/$WIN_ARCH"
|
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"
|
export DLL_TARGET_DIR="$CACHEDIR/dlls"
|
||||||
|
|
||||||
. "$CONTRIB"/build_tools_util.sh
|
. "$CONTRIB"/build_tools_util.sh
|
||||||
|
|||||||
@@ -63,10 +63,8 @@ done
|
|||||||
break_legacy_easy_install
|
break_legacy_easy_install
|
||||||
|
|
||||||
info "Installing build dependencies."
|
info "Installing build dependencies."
|
||||||
$PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"/deterministic-build/requirements-build-wine.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 dependencies specific to binaries."
|
|
||||||
$PYTHON -m pip install --no-dependencies --no-warn-script-location -r "$CONTRIB"/deterministic-build/requirements-binaries.txt
|
|
||||||
|
|
||||||
info "Installing NSIS."
|
info "Installing NSIS."
|
||||||
download_if_not_exist "$CACHEDIR/$NSIS_FILENAME" "$NSIS_URL"
|
download_if_not_exist "$CACHEDIR/$NSIS_FILENAME" "$NSIS_URL"
|
||||||
|
|||||||
Reference in New Issue
Block a user