Browse Source

mac build: use a virtualenv instead of global python packages

This helps to avoid older versions of pip-installed dependencies interfering with the build.
patch-4
SomberNight 4 years ago
parent
commit
7ac968b406
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 17
      contrib/osx/make_osx

17
contrib/osx/make_osx

@ -73,8 +73,15 @@ PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install -s $PYTHON_VERSION && \
pyenv global $PYTHON_VERSION || \ pyenv global $PYTHON_VERSION || \
fail "Unable to use Python $PYTHON_VERSION" fail "Unable to use Python $PYTHON_VERSION"
# create a fresh virtualenv
# This helps to avoid older versions of pip-installed dependencies interfering with the build.
VENV_DIR="$CONTRIB_OSX/build-venv"
rm -rf "$VENV_DIR"
python3 -m venv $VENV_DIR
source $VENV_DIR/bin/activate
info "Installing build dependencies" info "Installing build dependencies"
python3 -m pip install --no-dependencies -Ir ./contrib/deterministic-build/requirements-build-mac.txt --user \ python3 -m pip install --no-dependencies --no-warn-script-location -Ir ./contrib/deterministic-build/requirements-build-mac.txt \
|| fail "Could not install build dependencies" || fail "Could not install build dependencies"
info "Using these versions for building $PACKAGE:" info "Using these versions for building $PACKAGE:"
@ -128,19 +135,19 @@ DoCodeSignMaybe "CalinsQRReader.app" "${d}/build/Release/CalinsQRReader.app"
info "Installing requirements..." info "Installing requirements..."
python3 -m pip install --no-dependencies -Ir ./contrib/deterministic-build/requirements.txt --user \ python3 -m pip install --no-dependencies --no-warn-script-location -Ir ./contrib/deterministic-build/requirements.txt \
|| fail "Could not install requirements" || fail "Could not install requirements"
info "Installing hardware wallet requirements..." info "Installing hardware wallet requirements..."
python3 -m pip install --no-dependencies -Ir ./contrib/deterministic-build/requirements-hw.txt --user \ python3 -m pip install --no-dependencies --no-warn-script-location -Ir ./contrib/deterministic-build/requirements-hw.txt \
|| fail "Could not install hardware wallet requirements" || fail "Could not install hardware wallet requirements"
info "Installing dependencies specific to binaries..." info "Installing dependencies specific to binaries..."
python3 -m pip install --no-dependencies -Ir ./contrib/deterministic-build/requirements-binaries-mac.txt --user \ python3 -m pip install --no-dependencies --no-warn-script-location -Ir ./contrib/deterministic-build/requirements-binaries-mac.txt \
|| fail "Could not install dependencies specific to binaries" || fail "Could not install dependencies specific to binaries"
info "Building $PACKAGE..." info "Building $PACKAGE..."
python3 -m pip install --no-dependencies --user . > /dev/null || fail "Could not build $PACKAGE" python3 -m pip install --no-dependencies --no-warn-script-location . > /dev/null || fail "Could not build $PACKAGE"
info "Faking timestamps..." info "Faking timestamps..."
for d in ~/Library/Python/ ~/.pyenv .; do for d in ~/Library/Python/ ~/.pyenv .; do

Loading…
Cancel
Save