21601: Ensure pip is new enough to support package building
[arvados.git] / build / run-library.sh
index b15446ec53641f684d0ac6ce7f4c4fc48b0ee77b..6380e1cb19fafe18e2ea5034f88d9fc938abc07c 100755 (executable)
@@ -691,6 +691,12 @@ fpm_build_virtualenv_worker () {
   if ! "$PYTHON3_EXECUTABLE" -m venv "$venv_dir"; then
     printf "Error, unable to run\n  %s -m venv %s\n" "$PYTHON3_EXECUTABLE" "$venv_dir"
     exit 1
+  # We must have the dependency resolver introduced in late 2020 for the rest
+  # of our install process to work.
+  # <https://blog.python.org/2020/11/pip-20-3-release-new-resolver.html>
+  elif ! "$venv_dir/bin/pip" install "pip>=20.3"; then
+    printf "Error, unable to run\n  %s/bin/pip install 'pip>=20.3'\n" "$venv_dir"
+    exit 1
   fi
 
   local pip_wheel="$(ls --sort=time --reverse "$PYTHON_BUILDROOT/wheelhouse/$(echo "$PKG" | sed s/-/_/g)-"*.whl | tail -n1)"