Recovering from a Failed Upgrade After Removing :clojure-version in Clojure 1.12
0 reputation · 27 Nov 2021, 04:31 UTC
When upgrading to Clojure 1.12 the :clojure-version key was dropped from deps.edn, requiring an explicit org.clojure/clojure dependency. If the new default pulls in incompatible transitive dependencies, the application may crash or fail tests, and the tools.deps lockfile may contain conflicting entries that are not automatically updated.
The goal is to return to a known‑working state without corrupting the lockfile or re‑introducing the removed key. Constraints include the fact that tools.deps does not regenerate the lockfile when a dependency is changed, and that the lockfile format may evolve in future releases. Developers must therefore pin versions explicitly and understand how the lockfile is applied during a build.
What is the safest sequence to restore the lockfile to a previously verified state after a failed upgrade? How should a project pin the Clojure version in deps.edn once the :clojure-version key is no longer supported? What command pattern guarantees that the lockfile reflects the pinned dependency without manual edits, ensuring consistent resolution across environments?