请在 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
测试: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 报告)
...