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
1diff --git a/Makefile b/Makefile
2index 828765b..85911fc 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -9,20 +9,21 @@ PYTHONPATH:=$(WD)/lib:${PYTHONPATH}
6 VERBOSITY=-vv
7
8 # virtualenv and pip fail if setlocale fails, so force a valid locale.
9-VIRTUALENV := LC_ALL=C.UTF-8 virtualenv
10-PIP := PYTHONPATH= LC_ALL=C.UTF-8 env/bin/pip
11+PIP_ENV := LC_ALL=C.UTF-8
12 # Run with "make PIP_NO_INDEX=" if you want pip to find software
13 # dependencies *other* than those in our download-cache. Once you have the
14 # desired software, commit it to lp:lp-source-dependencies if it is going to
15 # be reviewed/merged/deployed.
16+PIP_NO_INDEX := 1
17+PIP_ENV += PIP_NO_INDEX=$(PIP_NO_INDEX)
18 # Although --ignore-installed is slower, we need it to avoid confusion with
19 # 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-PIP_NO_INDEX := --no-index
22-PIP_INSTALL_ARGS := \
23- $(PIP_NO_INDEX) \
24- --ignore-installed \
25- --find-links=file://$(WD)/download-cache/dist/ \
26+PIP_ENV += PIP_IGNORE_INSTALLED=1
27+PIP_ENV += PIP_FIND_LINKS=file://$(WD)/download-cache/dist/
28+
29+VIRTUALENV := $(PIP_ENV) virtualenv
30+PIP := PYTHONPATH= $(PIP_ENV) env/bin/pip
31
32 TESTFLAGS=-p $(VERBOSITY)
33 TESTOPTS=
34@@ -244,19 +245,15 @@ build_eggs: build_wheels
35 $(PY): download-cache constraints.txt setup.py
36 rm -rf env
37 mkdir -p env
38- (echo '[easy_install]'; \
39- echo 'find_links = file://$(WD)/download-cache/dist/') \
40- >env/.pydistutils.cfg
41 $(VIRTUALENV) \
42 --python=$(PYTHON) --system-site-packages --never-download \
43 --extra-search-dir=$(WD)/download-cache/dist/ \
44 env
45 ln -sfn env/bin bin
46- $(SHHH) $(PIP) install $(PIP_INSTALL_ARGS) \
47- -r setup-requirements.txt
48+ $(SHHH) $(PIP) install -r setup-requirements.txt
49 $(SHHH) LPCONFIG=$(LPCONFIG) $(PIP) \
50 --cache-dir=$(WD)/download-cache/ \
51- install $(PIP_INSTALL_ARGS) \
52+ install \
53 -c setup-requirements.txt -c constraints.txt -e . \
54 || { code=$$?; rm -f $@; exit $$code; }
55 touch $@
56diff --git a/constraints.txt b/constraints.txt
57index 33b8872..0d551cf 100644
58--- a/constraints.txt
59+++ b/constraints.txt
60@@ -289,7 +289,7 @@ scandir==1.7
61 service-identity==18.1.0
62 setproctitle==1.1.7
63 setuptools-git==1.2
64-setuptools-scm==1.15.7
65+setuptools-scm==3.4.3
66 simplejson==3.8.2
67 SimpleTAL==4.3
68 soupmatchers==0.4
69diff --git a/utilities/relocate-virtualenv b/utilities/relocate-virtualenv
70index 9d4d7bf..d3cf2ab 100755
71--- a/utilities/relocate-virtualenv
72+++ b/utilities/relocate-virtualenv
73@@ -21,5 +21,3 @@ top="$(readlink -f "$(dirname "$0")/..")"
74 for path in "$1"/lib/*/site-packages/lp.egg-link; do
75 printf '%s/lib\n../' "$top" >"$path"
76 done
77-sed -i "s#^find_links = .*#find_links = file://$top/download-cache/dist/#" \
78- "$1"/.pydistutils.cfg

Subscribers

People subscribed via source and target branches

to status/vote changes: