2024 年 Clojure 状态调查! 中分享您的观点。

欢迎!有关此功能的更多信息,请参阅 关于 页面。

+3 投票
tools.deps
我遇到了一个问题,我认为问题可能是本地依赖项不是传递性的,但似乎是一个缓存问题。


~/d/t/test-project (master)> tree .
.
├── deps.edn
└── sub-project
    ├── deps.edn
    └── sub-sub-project
        └── deps.edn

2 个目录,3 个文件
~/d/t/test-project (master)> cat deps.edn
{:deps {org.clojure/data.json {:git/url "https://github.com/clojure/data.json"
                               :sha "13e9d244678be7b235bb24a10310f9d147ea088d"}}
        test/sub-project {:local/root "sub-project"}}
~/d/t/test-project (master)> cat sub-project/deps.edn
{:deps {org.clojure/data.json {:git/url "https://github.com/clojure/java.data"
                               :sha "0f06ca5eb08726e74b2dab8654923894b7ace6af"}}
        test/sub-sub-project {:local/root "sub-sub-project"}}
~/d/t/test-project (master)> cat sub-project/sub-sub-project/deps.edn
{:deps {}}
~/d/t/test-project (master)> clojure -Spath
错误构建类路径。在查找 test/sub-sub-project 的依赖项期间未检测到清单类型:local{:root "sub-sub-project"}
~/d/t/test-project (master)> clojure -Spath -C:test
test:src:/Users/colin/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/Users/colin/.gitlibs/libs/org.clojure/data.json/13e9d244678be7b235bb24a10310f9d147ea088d/src/main/clojure:/Users/colin/dev/tools.deps.alpha/test-project/sub-project/src:/Users/colin/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/Users/colin/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar


这里没有别名的第一个类路径给出了错误,表明未提供清单。第二个没有给出该错误,但返回了错误的类路径。

我添加了清单


~/d/t/test-project (master)> cat deps.edn
{:deps {org.clojure/data.json {:git/url "https://github.com/clojure/data.json"
                               :sha     "13e9d244678be7b235bb24a10310f9d147ea088d"}
        test/sub-project      {:local/root    "sub-project"
                               :deps/manifest :deps}}}
~/d/t/test-project (master)> cat sub-project/deps.edn
{:deps {org.clojure/data.json {:git/url "https://github.com/clojure/java.data"
                               :sha     "0f06ca5eb08726e74b2dab8654923894b7ace6af"}
        test/sub-sub-project  {:local/root    "sub-sub-project"
                               :deps/manifest :deps}}}


然后都正常工作


~/d/t/test-project (master)> clojure -Spath
src:/Users/colin/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/Users/colin/.gitlibs/libs/org.clojure/data.json/13e9d244678be7b235bb24a10310f9d147ea088d/src/main/clojure:/Users/colin/dev/tools.deps.alpha/test-project/sub-project/src:/Users/colin/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/Users/colin/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar:/Users/colin/dev/tools.deps.alpha/test-project/sub-sub-project/src
~/d/t/test-project (master)> clojure -Spath -C:test
test:src:/Users/colin/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar:/Users/colin/.gitlibs/libs/org.clojure/data.json/13e9d244678be7b235bb24a10310f9d147ea088d/src/main/clojure:/Users/colin/dev/tools.deps.alpha/test-project/sub-project/src:/Users/colin/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar:/Users/colin/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar:/Users/colin/dev/tools.deps.alpha/test-project/sub-sub-project/src


然后如果移除清单,我会遇到两个错误


~/d/t/test-project (master)> cat deps.edn
{:deps {org.clojure/data.json {:git/url "https://github.com/clojure/data.json"
                               :sha     "13e9d244678be7b235bb24a10310f9d147ea088d"}
        test/sub-project      {:local/root    "sub-project"}}}
~/d/t/test-project (master)> cat sub-project/deps.edn
{:deps {org.clojure/data.json {:git/url "https://github.com/clojure/java.data"
                               :sha     "0f06ca5eb08726e74b2dab8654923894b7ace6af"}
        test/sub-sub-project  {:local/root    "sub-sub-project"}}}
~/d/t/test-project (master)> clojure -Spath
错误构建类路径。在查找 test/sub-sub-project 的依赖项期间未检测到清单类型:local{:root "sub-sub-project"}
~/d/t/test-project (master)> clojure -Spath -C:test
错误构建类路径。在查找 test/sub-sub-project 的依赖项期间未检测到清单类型:local{:root "sub-sub-project"}

1 答案

0
参考: https://clojure.atlassian.net/browse/TDEPS-83 (由 colinfleming 提出)
...