18874: Update setuptools/pip requirements.
[arvados.git] / lib / install / deps.go
index 263f0180976c4e55d05f1f6f992cb84d4d556d41..89b078e3471ab02f561894f28eebcc1a4ee7bbe2 100644 (file)
@@ -231,7 +231,7 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read
        }
 
        if dev || test {
-               if havedockerversion, err := exec.Command("docker", "--version").CombinedOutput(); err == nil {
+               if havedockerversion, err2 := exec.Command("docker", "--version").CombinedOutput(); err2 == nil {
                        logger.Printf("%s installed, assuming that version is ok", bytes.TrimSuffix(havedockerversion, []byte("\n")))
                } else if osv.Debian {
                        var codename string
@@ -240,6 +240,8 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read
                                codename = "buster"
                        case 11:
                                codename = "bullseye"
+                       case 12:
+                               codename = "bookworm"
                        default:
                                err = fmt.Errorf("don't know how to install docker-ce for debian %d", osv.Major)
                                return 1
@@ -261,13 +263,17 @@ DEBIAN_FRONTEND=noninteractive apt-get --yes --no-install-recommends install doc
                }
 
                err = inst.runBash(`
-add="fs.inotify.max_user_watches=524288"
-if ! grep -F -- "$add" /etc/sysctl.conf; then
-    echo "$add" | tee -a /etc/sysctl.conf
+key=fs.inotify.max_user_watches
+min=524288
+if [[ "$(sysctl --values "${key}")" -lt "${min}" ]]; then
+    sysctl "${key}=${min}"
+    # writing sysctl worked, so we should make it permanent
+    echo "${key}=${min}" | tee -a /etc/sysctl.conf
     sysctl -p
 fi
 `, stdout, stderr)
                if err != nil {
+                       err = fmt.Errorf("couldn't set fs.inotify.max_user_watches value. (Is this a docker container? Fix this on the docker host by adding fs.inotify.max_user_watches=524288 to /etc/sysctl.conf and running `sysctl -p`)")
                        return 1
                }
        }
@@ -551,7 +557,13 @@ ln -sfv /var/lib/arvados/node-`+nodejsversion+`-linux-x64/bin/{yarn,yarnpkg} /us
                        "cmd/arvados-server",
                } {
                        fmt.Fprintf(stderr, "building %s...\n", srcdir)
-                       cmd := exec.Command("go", "install", "-ldflags", "-X git.arvados.org/arvados.git/lib/cmd.version="+inst.PackageVersion+" -X main.version="+inst.PackageVersion+" -s -w")
+                       // -buildvcs=false here avoids a fatal "error
+                       // obtaining VCS status" when git refuses to
+                       // run (for example) as root in a docker
+                       // container using a non-root-owned git tree
+                       // mounted from the host -- as in
+                       // "arvados-package build".
+                       cmd := exec.Command("go", "install", "-buildvcs=false", "-ldflags", "-X git.arvados.org/arvados.git/lib/cmd.version="+inst.PackageVersion+" -X main.version="+inst.PackageVersion+" -s -w")
                        cmd.Env = append(cmd.Env, os.Environ()...)
                        cmd.Env = append(cmd.Env, "GOBIN=/var/lib/arvados/bin")
                        cmd.Dir = filepath.Join(inst.SourcePath, srcdir)
@@ -586,7 +598,7 @@ v=/var/lib/arvados/lib/python
 tmp=/var/lib/arvados/tmp/python
 python3 -m venv "$v"
 . "$v/bin/activate"
-pip3 install --no-cache-dir 'setuptools>=18.5' 'pip>=7'
+pip3 install --no-cache-dir 'setuptools>=68' 'pip>=20'
 export ARVADOS_BUILDING_VERSION="`+inst.PackageVersion+`"
 for src in "`+inst.SourcePath+`/sdk/python" "`+inst.SourcePath+`/services/fuse"; do
   rsync -a --delete-after "$src/" "$tmp/"