Merge ~cjwatson/launchpad:fix-clean-build-harder into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 85dd7290efd330e1326b1f0a524b5571ed7edfce
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-clean-build-harder
Merge into: launchpad:master
Diff against target: 78 lines (+11/-16)
3 files modified
Makefile (+10/-13)
constraints.txt (+1/-1)
utilities/relocate-virtualenv (+0/-2)
Reviewer Review Type Date Requested Status
Thiago F. Pappacena (community) Approve
Review via email: mp+378716@code.launchpad.net

Commit message

Fix clean build without cached wheels (again)

Description of the change

(qa)staging still had problems even after my previous fix (https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/378670): it was trying to make outgoing connections because --no-index wasn't passed through to pip processes run by setuptools, and the setuptools-scm wheel failed to build. I reproduced these by doing "ufw reject out http; ufw reject out https; ufw enable" in a container, and tested these fixes in that environment.

Using environment variables here is a simplification overall, I think.

Dependencies MP: https://code.launchpad.net/~cjwatson/lp-source-dependencies/+git/lp-source-dependencies/+merge/378713

To post a comment you must log in.
Revision history for this message
Thiago F. Pappacena (pappacena) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/Makefile b/Makefile
index 828765b..85911fc 100644
--- a/Makefile
+++ b/Makefile
@@ -9,20 +9,21 @@ PYTHONPATH:=$(WD)/lib:${PYTHONPATH}
9VERBOSITY=-vv9VERBOSITY=-vv
1010
11# virtualenv and pip fail if setlocale fails, so force a valid locale.11# virtualenv and pip fail if setlocale fails, so force a valid locale.
12VIRTUALENV := LC_ALL=C.UTF-8 virtualenv12PIP_ENV := LC_ALL=C.UTF-8
13PIP := PYTHONPATH= LC_ALL=C.UTF-8 env/bin/pip
14# Run with "make PIP_NO_INDEX=" if you want pip to find software13# Run with "make PIP_NO_INDEX=" if you want pip to find software
15# dependencies *other* than those in our download-cache. Once you have the14# dependencies *other* than those in our download-cache. Once you have the
16# desired software, commit it to lp:lp-source-dependencies if it is going to15# desired software, commit it to lp:lp-source-dependencies if it is going to
17# be reviewed/merged/deployed.16# be reviewed/merged/deployed.
17PIP_NO_INDEX := 1
18PIP_ENV += PIP_NO_INDEX=$(PIP_NO_INDEX)
18# Although --ignore-installed is slower, we need it to avoid confusion with19# Although --ignore-installed is slower, we need it to avoid confusion with
19# system-installed Python packages. If we ever manage to remove the need20# system-installed Python packages. If we ever manage to remove the need
20# for virtualenv --system-site-packages, then we can remove this too.21# for virtualenv --system-site-packages, then we can remove this too.
21PIP_NO_INDEX := --no-index22PIP_ENV += PIP_IGNORE_INSTALLED=1
22PIP_INSTALL_ARGS := \23PIP_ENV += PIP_FIND_LINKS=file://$(WD)/download-cache/dist/
23 $(PIP_NO_INDEX) \24
24 --ignore-installed \25VIRTUALENV := $(PIP_ENV) virtualenv
25 --find-links=file://$(WD)/download-cache/dist/ \26PIP := PYTHONPATH= $(PIP_ENV) env/bin/pip
2627
27TESTFLAGS=-p $(VERBOSITY)28TESTFLAGS=-p $(VERBOSITY)
28TESTOPTS=29TESTOPTS=
@@ -244,19 +245,15 @@ build_eggs: build_wheels
244$(PY): download-cache constraints.txt setup.py245$(PY): download-cache constraints.txt setup.py
245 rm -rf env246 rm -rf env
246 mkdir -p env247 mkdir -p env
247 (echo '[easy_install]'; \
248 echo 'find_links = file://$(WD)/download-cache/dist/') \
249 >env/.pydistutils.cfg
250 $(VIRTUALENV) \248 $(VIRTUALENV) \
251 --python=$(PYTHON) --system-site-packages --never-download \249 --python=$(PYTHON) --system-site-packages --never-download \
252 --extra-search-dir=$(WD)/download-cache/dist/ \250 --extra-search-dir=$(WD)/download-cache/dist/ \
253 env251 env
254 ln -sfn env/bin bin252 ln -sfn env/bin bin
255 $(SHHH) $(PIP) install $(PIP_INSTALL_ARGS) \253 $(SHHH) $(PIP) install -r setup-requirements.txt
256 -r setup-requirements.txt
257 $(SHHH) LPCONFIG=$(LPCONFIG) $(PIP) \254 $(SHHH) LPCONFIG=$(LPCONFIG) $(PIP) \
258 --cache-dir=$(WD)/download-cache/ \255 --cache-dir=$(WD)/download-cache/ \
259 install $(PIP_INSTALL_ARGS) \256 install \
260 -c setup-requirements.txt -c constraints.txt -e . \257 -c setup-requirements.txt -c constraints.txt -e . \
261 || { code=$$?; rm -f $@; exit $$code; }258 || { code=$$?; rm -f $@; exit $$code; }
262 touch $@259 touch $@
diff --git a/constraints.txt b/constraints.txt
index 33b8872..0d551cf 100644
--- a/constraints.txt
+++ b/constraints.txt
@@ -289,7 +289,7 @@ scandir==1.7
289service-identity==18.1.0289service-identity==18.1.0
290setproctitle==1.1.7290setproctitle==1.1.7
291setuptools-git==1.2291setuptools-git==1.2
292setuptools-scm==1.15.7292setuptools-scm==3.4.3
293simplejson==3.8.2293simplejson==3.8.2
294SimpleTAL==4.3294SimpleTAL==4.3
295soupmatchers==0.4295soupmatchers==0.4
diff --git a/utilities/relocate-virtualenv b/utilities/relocate-virtualenv
index 9d4d7bf..d3cf2ab 100755
--- a/utilities/relocate-virtualenv
+++ b/utilities/relocate-virtualenv
@@ -21,5 +21,3 @@ top="$(readlink -f "$(dirname "$0")/..")"
21for path in "$1"/lib/*/site-packages/lp.egg-link; do21for path in "$1"/lib/*/site-packages/lp.egg-link; do
22 printf '%s/lib\n../' "$top" >"$path"22 printf '%s/lib\n../' "$top" >"$path"
23done23done
24sed -i "s#^find_links = .*#find_links = file://$top/download-cache/dist/#" \
25 "$1"/.pydistutils.cfg

Subscribers

People subscribed via source and target branches

to status/vote changes: