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?What version of the Clojure CLI are you using? clj -version
Good question, haven't upgraded in a while. I'm using 1.11.1.1429 I'll try with a newer version
Works fine with 1.12.0.1530 👍
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
Thanks! I need to update the version used by our build server as well, but then I'm probably good to go 👍
Should the version in this info message on https://clojure.org/guides/tools_build be bumped to 1.12.x?
Probably, I’ll look at it