20846: Update setuptools, accommodate debian12 needs.
authorTom Clegg <tom@curii.com>
Tue, 21 Nov 2023 15:17:57 +0000 (10:17 -0500)
committerTom Clegg <tom@curii.com>
Tue, 21 Nov 2023 15:17:57 +0000 (10:17 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

build/package-build-dockerfiles/debian12/Dockerfile
build/run-library.sh

index 65e76303b4bf2b733fb29d407c2ebe0f9ddd2fe9..86d038b80b16d308efbedd0360c5e009deda91ed 100644 (file)
@@ -40,7 +40,7 @@ ENV DEBIAN_FRONTEND noninteractive
 
 SHELL ["/bin/bash", "-c"]
 # Install dependencies.
-RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y python3 python3-setuptools python3-pip libcurl4-gnutls-dev curl git procps libattr1-dev libfuse-dev libgnutls28-dev libpq-dev unzip python3-venv python3-dev libpam-dev equivs
+RUN /usr/bin/apt-get update && /usr/bin/apt-get install -q -y python3 python3-setuptools python3-pip libcurl4-gnutls-dev curl git procps libattr1-dev libfuse-dev libgnutls28-dev libpq-dev unzip python3-venv python3-virtualenv python3-dev libpam-dev equivs
 
 # Install RVM
 ADD generated/mpapis.asc /tmp/
index e3c0e251bfa324c9d63f1d4d6d9afd8bc4ad3625..448f652c279811012d67e03d36a323f458c0f6dc 100755 (executable)
@@ -784,10 +784,17 @@ fpm_build_virtualenv_worker () {
 
   rm -rf dist/*
 
-  # Get the latest setuptools
-  if ! $pip install $DASHQ_UNLESS_DEBUG $CACHE_FLAG -U 'setuptools<45'; then
+  # Get the latest setuptools.
+  #
+  # Note "pip3 install setuptools" fails on debian12 ("error:
+  # externally-managed-environment") even if that requirement is
+  # already satisfied, so we parse "pip3 list" output instead to check
+  # whether we need to do anything.
+  if [[ "$($pip list | grep -P -o '^setuptools\s+\K[0-9]+')" -ge 66 ]]; then
+    : # OK, already installed
+  elif ! $pip install $DASHQ_UNLESS_DEBUG $CACHE_FLAG -U 'setuptools>=66'; then
     echo "Error, unable to upgrade setuptools with"
-    echo "  $pip install $DASHQ_UNLESS_DEBUG $CACHE_FLAG -U 'setuptools<45'"
+    echo "  $pip install $DASHQ_UNLESS_DEBUG $CACHE_FLAG -U 'setuptools>=66'"
     exit 1
   fi
   # filter a useless warning (when building the cwltest package) from the stderr output