diff --git a/CHANGELOG.md b/CHANGELOG.md index 16503827..062d4d7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ A preview of the next release can be installed from [Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting +## Unreleased + +- #1660: add `:deps-root` as part of hash to avoid caching issue with `deps.clj` + ## 1.3.188 (2023-01-12) - [#1658](https://github.com/babashka/babashka/issues/1658): fix command line parsing for scripts that parse `--version` or `version` etc diff --git a/src/babashka/impl/deps.clj b/src/babashka/impl/deps.clj index f2db3e65..7d737376 100644 --- a/src/babashka/impl/deps.clj +++ b/src/babashka/impl/deps.clj @@ -76,7 +76,14 @@ ;; paths are added manually above ;; extra-paths are added as :paths in tasks :paths :tasks :raw :file :deps-root - :min-bb-version)] + :min-bb-version) + ;; associate deps-root to avoid cache conflict between different + ;; bb.edns with relative local/roots by the same name NOTE: + ;; deps-root is nil when bb.edn isn't used, so clashes may still + ;; happen with dynamic add-deps, but at least we don't invoke + ;; clojure CLI's java process each time we call a script from a + ;; different directory. + deps-map (assoc deps-map :deps-root (str deps-root))] (binding [*print-namespace-maps* false] (let [deps-map (assoc-in deps-map [:aliases :org.babashka/defaults] {:replace-paths [] ;; babashka sets paths manually