Browse Source

Merge "Fix broken symlinks from virtualenv 16.4.0 update"

changes/63/637963/1
Zuul 4 months ago
parent
commit
64de1b3869
1 changed files with 22 additions and 6 deletions
  1. 22
    6
      scripts/setup_pip.sh

+ 22
- 6
scripts/setup_pip.sh View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 set -ex
4 4
 
5
+
5 6
 if [[ "${PYTHON3}" == "no" ]]; then
6 7
     TMP_VIRTUALENV="virtualenv"
7 8
 else
@@ -13,12 +14,27 @@ fi
13 14
 if (( $(${TMP_VIRTUALENV} --version | cut -d. -f1) >= 14 )); then
14 15
     SETUPTOOLS="--no-setuptools"
15 16
 fi
16
-${TMP_VIRTUALENV} --extra-search-dir=/tmp/wheels ${SETUPTOOLS} /tmp/venv
17
-source /tmp/venv/bin/activate
18 17
 
19
-# TODO: Remove virtualenv version pinning once a suitable fix is found
20
-# to this issue:
21
-# http://lists.openstack.org/pipermail/openstack-discuss/2019-February/002592.html
22
-pip install --upgrade ${PIP_ARGS} virtualenv==16.3.0
18
+# virtualenv 16.4.0 fixed symlink handling. The interaction of the new
19
+# corrected behavior with legacy bugs in packaged virtualenv releases in
20
+# distributions means we need to hold on to the pip bootstrap installation
21
+# chain to preserve symlinks. As distributions upgrade their default
22
+# installations we may not need this workaround in the future
23
+PIPBOOTSTRAP=/var/lib/pipbootstrap
24
+
25
+# Create the boostrap environment so we can get pip from virtualenv
26
+${TMP_VIRTUALENV} --extra-search-dir=/tmp/wheels ${SETUPTOOLS} ${PIPBOOTSTRAP}
27
+source ${PIPBOOTSTRAP}/bin/activate
28
+
29
+# Upgrade to the latest version of virtualenv
30
+pip install --upgrade ${PIP_ARGS} virtualenv
31
+
32
+# Forget the cached locations of python binaries
23 33
 hash -r
34
+
35
+# Create the virtualenv with the updated toolchain for openstack service
24 36
 virtualenv --extra-search-dir=/tmp/wheels /var/lib/openstack
37
+
38
+# Deactivate the old bootstrap virtualenv and switch to the new one
39
+deactivate
40
+source /var/lib/openstack/bin/activate

Loading…
Cancel
Save