Fork me on GitHub
#tools-deps
<
2018-07-12
>
cfleming04:07:08

I’m working on some tools.deps testing, and I can’t figure this out. I’m calling resolve-deps like this:

(resolve-deps
    {:deps {'local {:local/root "/Users/colin/dev/tools-deps-test/library"}}}
    nil)

cfleming04:07:47

That deps.edn looks like this:

~/d/cursive (deps)> cat /Users/colin/dev/tools-deps-test/library/deps.edn
{:deps {org.clojure/tools.gitlibs {:git/url ""
                                   :sha     "cab6abf0122cffb9e6b947c838458c69a0992031"}}}

cfleming04:07:17

What I’m getting back in my lib map includes this:

local {:local/root "/Users/colin/dev/tools-deps-test/library",
        :deps/manifest :deps,
        :deps/root "/Users/colin/dev/tools-deps-test/library",
        :paths []},

cfleming04:07:31

I can’t figure out why the :paths vector is empty here.

cfleming04:07:58

/Users/colin/dev/tools-deps-test/library/src exists.

cfleming04:07:42

Ugh, never mind me, I’m not merging in my config maps.

cfleming04:07:57

This works:

(let [deps (reader/merge-deps [(reader/slurp-deps "/usr/local/Cellar/clojure/1.9.0.381/deps.edn")
                               (reader/slurp-deps "/Users/colin/.clojure/deps.edn")
                               (-> {:deps {'local {:local/root    "/Users/colin/dev/tools-deps-test/library"
                                                   :deps/manifest :deps}}}
                                   (#'reader/canonicalize-all-syms))])]
  (resolve-deps deps nil))

kenny15:07:46

It seems tools-deps suffixes all Git deps with each path in my :paths vector. If I have ["src" "foo1" "foo2"] for my :paths, the output of clj -Spath will suffix each Git dependency with each path. i.e. /Users/kenny/.gitlibs/libs/lib1/lib1/f31e19ffe371a60f0474759451dba9b88bf7ef04/src:/Users/kenny/.gitlibs/libs/lib1/lib1/f31e19ffe371a60f0474759451dba9b88bf7ef04/foo1:/Users/kenny/.gitlibs/libs/lib1/lib1/f31e19ffe371a60f0474759451dba9b88bf7ef04/foo2. Is this intentional?

kenny15:07:27

Is there an issue?

dominicm15:07:03

There is, although I'm not sure of the ref for it

avi19:07:16

I got bit by that yesterday, working with a local lib. My app has main test-runner etc under src but the lib doesn’t have main so none of the clj files could be found by require/load

avi19:07:04

Ah no, my problem was slightly different

avi19:07:08

Almost the inverse

avi19:07:20

(Just read the issue more closely)

avi19:07:35

I’ll try to check whether an issue for my experience already exists.