From aee847a6fb13163b720d9f8e02b252ba95fc7051 Mon Sep 17 00:00:00 2001 From: ohemorange Date: Thu, 24 Jan 2019 10:03:52 -0800 Subject: [PATCH] Add VIRTUALENV_NO_DOWNLOAD=1 to all calls to virtualenv (#6690) This will immediately address the breakage reported in #6682 and tracked at #6685. Virtualenv downloads the latest pip, which causes issues, so tell virtualenv to not download the latest pip. I added the flag preemptively to other files as well, they're in separate commits so it will be easy to revert any spots we don't want. I've confirmed that this fixes the issue on a machine that fails with the version of certbot-auto currently in master: recent version of virtualenv, python 2.7. * Update changelog * Use an environment variable instead of a flag for compatibility with old versions * Run build.py (cherry picked from commit 658b7b9d47cb05fa43383b5bdf3beea0dc99b886) --- CHANGELOG.md | 15 ++++++++++++++- Dockerfile-old | 2 +- certbot-compatibility-test/Dockerfile | 2 +- letsencrypt-auto-source/letsencrypt-auto | 6 ++++-- letsencrypt-auto-source/letsencrypt-auto.template | 6 ++++-- tools/_release.sh | 4 ++-- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 182f6db32..3b05f1127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Certbot change log -Certbot adheres to [Semantic Versioning](http://semver.org/). +Certbot adheres to [Semantic Versioning](https://semver.org/). + +## 0.31.1 - master + +### Fixed + +* Add VIRTUALENV_NO_DOWNLOAD=1 to all calls to virtualenv to address breakages + from venv downloading the latest pip + +Despite us having broken lockstep, we are continuing to release new versions of +all Certbot components during releases for the time being, however, the only +package with changes other than its version number was: + +More details about these changes can be found on our GitHub repo. ## 0.30.0 - 2019-01-02 diff --git a/Dockerfile-old b/Dockerfile-old index da48c7fc8..c52a9937b 100644 --- a/Dockerfile-old +++ b/Dockerfile-old @@ -51,7 +51,7 @@ COPY certbot-apache /opt/certbot/src/certbot-apache/ COPY certbot-nginx /opt/certbot/src/certbot-nginx/ -RUN virtualenv --no-site-packages -p python2 /opt/certbot/venv +RUN VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages -p python2 /opt/certbot/venv # PATH is set now so pipstrap upgrades the correct (v)env ENV PATH /opt/certbot/venv/bin:$PATH diff --git a/certbot-compatibility-test/Dockerfile b/certbot-compatibility-test/Dockerfile index cbbdf7193..1e9e0d727 100644 --- a/certbot-compatibility-test/Dockerfile +++ b/certbot-compatibility-test/Dockerfile @@ -31,7 +31,7 @@ COPY certbot-nginx /opt/certbot/src/certbot-nginx/ COPY certbot-compatibility-test /opt/certbot/src/certbot-compatibility-test/ COPY tools /opt/certbot/src/tools -RUN virtualenv --no-site-packages -p python2 /opt/certbot/venv && \ +RUN VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages -p python2 /opt/certbot/venv && \ /opt/certbot/venv/bin/pip install -U setuptools && \ /opt/certbot/venv/bin/pip install -U pip ENV PATH /opt/certbot/venv/bin:$PATH diff --git a/letsencrypt-auto-source/letsencrypt-auto b/letsencrypt-auto-source/letsencrypt-auto index be2c3679b..d387f1934 100755 --- a/letsencrypt-auto-source/letsencrypt-auto +++ b/letsencrypt-auto-source/letsencrypt-auto @@ -997,10 +997,12 @@ if [ "$1" = "--le-auto-phase2" ]; then DeterminePythonVersion rm -rf "$VENV_PATH" if [ "$PYVER" -le 27 ]; then + # Use an environment variable instead of a flag for compatibility with old versions if [ "$VERBOSE" = 1 ]; then - virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" + VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" else - virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" > /dev/null + VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" \ + > /dev/null fi else if [ "$VERBOSE" = 1 ]; then diff --git a/letsencrypt-auto-source/letsencrypt-auto.template b/letsencrypt-auto-source/letsencrypt-auto.template index f431e32e4..2cd3f4336 100755 --- a/letsencrypt-auto-source/letsencrypt-auto.template +++ b/letsencrypt-auto-source/letsencrypt-auto.template @@ -537,10 +537,12 @@ if [ "$1" = "--le-auto-phase2" ]; then DeterminePythonVersion rm -rf "$VENV_PATH" if [ "$PYVER" -le 27 ]; then + # Use an environment variable instead of a flag for compatibility with old versions if [ "$VERBOSE" = 1 ]; then - virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" + VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" else - virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" > /dev/null + VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages --python "$LE_PYTHON" "$VENV_PATH" \ + > /dev/null fi else if [ "$VERBOSE" = 1 ]; then diff --git a/tools/_release.sh b/tools/_release.sh index ec2deda22..d75a0f487 100755 --- a/tools/_release.sh +++ b/tools/_release.sh @@ -42,7 +42,7 @@ mv "dist.$version" "dist.$version.$(date +%s).bak" || true git tag --delete "$tag" || true tmpvenv=$(mktemp -d) -virtualenv --no-site-packages -p python2 $tmpvenv +VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages -p python2 $tmpvenv . $tmpvenv/bin/activate # update setuptools/pip just like in other places in the repo pip install -U setuptools @@ -135,7 +135,7 @@ cd "dist.$version" python -m SimpleHTTPServer $PORT & # cd .. is NOT done on purpose: we make sure that all subpackages are # installed from local PyPI rather than current directory (repo root) -virtualenv --no-site-packages ../venv +VIRTUALENV_NO_DOWNLOAD=1 virtualenv --no-site-packages ../venv . ../venv/bin/activate pip install -U setuptools pip install -U pip