|
|
|
#!/bin/bash
|
|
|
|
# Run this after a new release to update dependencies
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
venv_dir=~/.electrum-venv
|
|
|
|
contrib=$(dirname "$0")
|
|
|
|
|
|
|
|
# note: we should not use a higher version of python than what the binaries bundle
|
|
|
|
if [[ ! "$SYSTEM_PYTHON" ]] ; then
|
|
|
|
SYSTEM_PYTHON=$(which python3.6) || printf ""
|
|
|
|
else
|
|
|
|
SYSTEM_PYTHON=$(which $SYSTEM_PYTHON) || printf ""
|
|
|
|
fi
|
|
|
|
if [[ ! "$SYSTEM_PYTHON" ]] ; then
|
|
|
|
echo "Please specify which python to use in \$SYSTEM_PYTHON" && exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
which virtualenv > /dev/null 2>&1 || { echo "Please install virtualenv" && exit 1; }
|
|
|
|
|
|
|
|
${SYSTEM_PYTHON} -m hashin -h > /dev/null 2>&1 || { ${SYSTEM_PYTHON} -m pip install hashin; }
|
|
|
|
|
build: android reprod: "pip install" needs "--no-build-isolation"
maybe fixes https://github.com/spesmilo/electrum/issues/7640
Looks like by default pip is ignoring the locally available setuptools and wheel,
and downloading the latest ones from the internet at build time...
https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/?highlight=no-build-isolation#disabling-build-isolation
https://stackoverflow.com/a/62889268
> When making build requirements available, pip does so in an isolated environment. That is, pip does not install those requirements into the user’s site-packages, but rather installs them in a temporary directory which it adds to the user’s sys.path for the duration of the build. This ensures that build requirements are handled independently of the user’s runtime environment. For example, a project that needs a recent version of setuptools to build can still be installed, even if the user has an older version installed (and without silently replacing that version).
>
> In certain cases, projects (or redistributors) may have workflows that explicitly manage the build environment. For such workflows, build isolation can be problematic. If this is the case, pip provides a --no-build-isolation flag to disable build isolation. Users supplying this flag are responsible for ensuring the build environment is managed appropriately (including ensuring that all required build dependencies are installed).
If only it were that easy!
If we add the "--no-build-isolation" flag, it becomes our responsibility to install *all* build time deps,
hence we now have "requirements-build-makepackages.txt".
3 years ago
|
|
|
for i in '' '-hw' '-binaries' '-binaries-mac' '-build-wine' '-build-mac' '-build-makepackages' '-build-appimage' '-build-android'; do
|
|
|
|
rm -rf "$venv_dir"
|
|
|
|
virtualenv -p ${SYSTEM_PYTHON} $venv_dir
|
|
|
|
|
|
|
|
source $venv_dir/bin/activate
|
|
|
|
|
|
|
|
echo "Installing dependencies... (requirements${i}.txt)"
|
|
|
|
|
|
|
|
# We pin all python packaging tools (pip and friends). Some of our dependencies might
|
|
|
|
# pull some of them in (e.g. protobuf->setuptools), and all transitive dependencies
|
|
|
|
# must be pinned, so we might as well pin all packaging tools. This however means
|
|
|
|
# that we should explicitly install them now, so that we pin latest versions if possible.
|
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
|
|
|
|
|
|
python -m pip install -r "$contrib/requirements/requirements${i}.txt" --upgrade
|
|
|
|
|
|
|
|
echo "OK."
|
|
|
|
|
|
|
|
requirements=$(pip freeze --all)
|
|
|
|
restricted=$(echo $requirements | ${SYSTEM_PYTHON} $contrib/deterministic-build/find_restricted_dependencies.py)
|
|
|
|
requirements="$requirements $restricted"
|
|
|
|
|
|
|
|
echo "Generating package hashes... (requirements${i}.txt)"
|
|
|
|
rm "$contrib/deterministic-build/requirements${i}.txt"
|
|
|
|
touch "$contrib/deterministic-build/requirements${i}.txt"
|
|
|
|
|
|
|
|
for requirement in $requirements; do
|
|
|
|
echo -e "\r Hashing $requirement..."
|
|
|
|
${SYSTEM_PYTHON} -m hashin -r "$contrib/deterministic-build/requirements${i}.txt" "${requirement}"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "OK."
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Done. Updated requirements"
|