Merge pull request #7918 from SomberNight/202208_build_tighten1
mac/win build: `pip install --no-binary :all:` in more places
This commit is contained in:
@@ -108,16 +108,20 @@ info "preparing electrum-locale."
|
||||
|
||||
|
||||
info "Installing build dependencies."
|
||||
# note: re pip installing from PyPI,
|
||||
# we prefer compiling C extensions ourselves, instead of using binary wheels,
|
||||
# hence "--no-binary :all:" flags. However, we specifically allow
|
||||
# - PyQt5, as it's harder to build from source
|
||||
# - cryptography, as it's harder to build from source
|
||||
# - the whole of "requirements-build-base.txt", which includes pip and friends, as it also includes "wheel",
|
||||
# and I am not quite sure how to break the circular dependence there (I guess we could introduce
|
||||
# "requirements-build-base-base.txt" with just wheel in it...)
|
||||
"$python" -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements-build-base.txt"
|
||||
"$python" -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
|
||||
--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,
|
||||
# hence "--no-binary :all:" flags. However, we specifically allow
|
||||
# - 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-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
|
||||
--cache-dir "$PIP_CACHE_DIR" -r "$CONTRIB/deterministic-build/requirements.txt"
|
||||
"$python" -m pip install --no-build-isolation --no-dependencies --no-binary :all: --only-binary PyQt5,PyQt5-Qt5,cryptography --no-warn-script-location \
|
||||
|
||||
@@ -35,13 +35,21 @@ find -exec touch -h -d '2000-11-11T11:11:11+00:00' {} +
|
||||
popd
|
||||
|
||||
|
||||
# Install frozen dependencies
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements.txt
|
||||
# opt out of compiling C extensions
|
||||
export AIOHTTP_NO_EXTENSIONS=1
|
||||
export YARL_NO_EXTENSIONS=1
|
||||
export MULTIDICT_NO_EXTENSIONS=1
|
||||
export FROZENLIST_NO_EXTENSIONS=1
|
||||
|
||||
info "Installing requirements..."
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
|
||||
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements.txt
|
||||
info "Installing dependencies specific to binaries..."
|
||||
# TODO use "--no-binary :all:" (but we don't have a C compiler...)
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-binaries.txt
|
||||
|
||||
info "Installing hardware wallet requirements..."
|
||||
# TODO use "--no-binary :all:" (but we don't have a C compiler...)
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-hw.txt
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ break_legacy_easy_install
|
||||
info "Installing build dependencies."
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-build-base.txt
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
$WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
|
||||
--cache-dir "$WINE_PIP_CACHE_DIR" -r "$CONTRIB"/deterministic-build/requirements-build-wine.txt
|
||||
|
||||
info "Installing NSIS."
|
||||
|
||||
@@ -4,6 +4,7 @@ set -e
|
||||
|
||||
# Parameterize
|
||||
PYTHON_VERSION=3.9.11
|
||||
PY_VER_MAJOR="3.9" # as it appears in fs paths
|
||||
BUILDDIR=/tmp/electrum-build
|
||||
PACKAGE=Electrum
|
||||
GIT_REPO=https://github.com/spesmilo/electrum
|
||||
@@ -94,13 +95,23 @@ source $VENV_DIR/bin/activate
|
||||
|
||||
# don't add debug info to compiled C files (e.g. when pip calls setuptools/wheel calls gcc)
|
||||
# see https://github.com/pypa/pip/issues/6505#issuecomment-526613584
|
||||
# note: this does not seem sufficient when cython is involved (although it is on linux, just not on mac... weird.)
|
||||
# see additional "strip" pass on built files later in the file.
|
||||
export CFLAGS="-g0"
|
||||
|
||||
info "Installing build dependencies"
|
||||
# note: re pip installing from PyPI,
|
||||
# we prefer compiling C extensions ourselves, instead of using binary wheels,
|
||||
# hence "--no-binary :all:" flags. However, we specifically allow
|
||||
# - PyQt5, as it's harder to build from source
|
||||
# - cryptography, as it's harder to build from source
|
||||
# - the whole of "requirements-build-base.txt", which includes pip and friends, as it also includes "wheel",
|
||||
# and I am not quite sure how to break the circular dependence there (I guess we could introduce
|
||||
# "requirements-build-base-base.txt" with just wheel in it...)
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
-Ir ./contrib/deterministic-build/requirements-build-base.txt \
|
||||
|| fail "Could not install build dependencies (base)"
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location \
|
||||
-Ir ./contrib/deterministic-build/requirements-build-mac.txt \
|
||||
|| fail "Could not install build dependencies (mac)"
|
||||
|
||||
@@ -201,17 +212,20 @@ cp "$PROJECT_ROOT"/electrum/libusb-1.0.dylib "$CONTRIB"/osx
|
||||
|
||||
|
||||
info "Installing requirements..."
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all: \
|
||||
--no-warn-script-location \
|
||||
-Ir ./contrib/deterministic-build/requirements.txt \
|
||||
|| fail "Could not install requirements"
|
||||
|
||||
info "Installing hardware wallet requirements..."
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all: --only-binary cryptography \
|
||||
--no-warn-script-location \
|
||||
-Ir ./contrib/deterministic-build/requirements-hw.txt \
|
||||
|| fail "Could not install hardware wallet requirements"
|
||||
|
||||
info "Installing dependencies specific to binaries..."
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location \
|
||||
python3 -m pip install --no-build-isolation --no-dependencies --no-binary :all: --only-binary PyQt5,PyQt5-Qt5,cryptography \
|
||||
--no-warn-script-location \
|
||||
-Ir ./contrib/deterministic-build/requirements-binaries-mac.txt \
|
||||
|| fail "Could not install dependencies specific to binaries"
|
||||
|
||||
@@ -219,6 +233,11 @@ info "Building $PACKAGE..."
|
||||
python3 -m pip install --no-build-isolation --no-dependencies \
|
||||
--no-warn-script-location . > /dev/null || fail "Could not build $PACKAGE"
|
||||
|
||||
# strip debug symbols of some compiled libs
|
||||
# - hidapi (hid.cpython-39-darwin.so) in particular is not reproducible without this
|
||||
find "$VENV_DIR/lib/python$PY_VER_MAJOR/site-packages/" -type f -name '*.so' -print0 \
|
||||
| xargs -0 -t strip -x
|
||||
|
||||
info "Faking timestamps..."
|
||||
find . -exec touch -t '200101220000' {} + || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user