tools-deps

2025-04-08T11:15:49.253059Z

I tried to upgrade tools.build from 0.10.7 to 0.10.8 and ran into this issue when running clj -T:build uber:

Compiling Clojure...
Execution error (FileNotFoundException) at clojure.tools.build.tasks.process/eval2110$loading (process.clj:9).
Could not locate clojure/java/process__init.class, clojure/java/process.clj or clojure/java/process.cljc on classpath.
It is caused by https://github.com/clojure/tools.build/commit/55a79ee245f15c0ba04a735673255415c50cef92 which adds a require to clojure.java.process My setup is inspired by the tools.build Guide at https://clojure.org/guides/tools_build, with a tools.deps alias:
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.8"}}
                   :ns-default build}
and a build.clj:
(ns build
  (:require [clojure.tools.build.api :as b]))

(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file "target/uberjar.jar")
(def main-cls "dvp.clj.server")

(defn clean [_]
      (b/delete {:path "target"}))

(defn uber [_]
      (clean nil)
      (b/copy-dir {:src-dirs ["src/clj" "src/cljc" "resources"]
                   :target-dir class-dir})
      (println "Compiling Clojure...")
      (b/compile-clj {:basis basis
                      :src-dirs ["src/clj" "src/cljc"]
                      :class-dir class-dir})
      (println "Making uberjar...")
      (b/uber {:class-dir class-dir
               :uber-file uber-file
               :basis basis
               :main main-cls}))
The problem is easily fixed by adding clojure as a dependency to the build alias:
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.10.8"}
                          org.clojure/clojure {:mvn/version "1.12.0"}}
                   :ns-default build}
My question is if tools.build now should have a dependency to clojure, or if the tools.build Guide should add clojure as a dependency to the alias example. Or am I doing something special that adds this need for clojure as a dependency?

Alex Miller (Clojure team) 2025-04-08T12:22:25.765049Z

What version of the Clojure CLI are you using? clj -version

2025-04-08T12:28:09.451089Z

Good question, haven't upgraded in a while. I'm using 1.11.1.1429 I'll try with a newer version

2025-04-08T12:32:50.651849Z

Works fine with 1.12.0.1530 👍

🙏 1
Alex Miller (Clojure team) 2025-04-08T12:33:17.953739Z

I think if you just update your CLI, this problem will be fixed. There is still an issue here that I understand but I will spare you the details

2025-04-08T12:39:04.733779Z

Thanks! I need to update the version used by our build server as well, but then I'm probably good to go 👍

2025-04-08T13:59:24.302109Z

Should the version in this info message on https://clojure.org/guides/tools_build be bumped to 1.12.x?

Alex Miller (Clojure team) 2025-04-08T14:02:44.906809Z

Probably, I’ll look at it

👍 1