Fork me on GitHub
#tools-deps
<
2021-08-12
>
genRaiy08:08:11

question on procurers: is there a DB procurement option eg from code stored in Datomic or similar?

genRaiy08:08:31

If not, how much of the infrastructure is reusable once the code has been procured?

Alex Miller (Clojure team)12:08:03

Nothing like that now. The procurer impl needs to be able to find and download a lib and determine it’s deps.

Alex Miller (Clojure team)12:08:51

Depending how you stored stuff, could reuse lots of existing pieces

genRaiy12:08:02

My thinking was having a project that looked something like {:project "epic" :code {:ns "my.foo" :code "(def bar 42)"}} which could be stored directly in a DB that kept history. Then you pick the latest view of it, serialize the namespaces to files (urgh but OK if we have to) and add the namespaces to the CLASSPATH. Which feels close to what you do with git deps. I would rather avoid the files but not sure if this is possible. Is it?

genRaiy12:08:22

are you open to a PR on this kind of thing?

Alex Miller (Clojure team)12:08:51

It’s all ultimately file based (you’re always making a classpath), so can’t avoid files. (I have made similar db-based dynamic classloaders before, but that’s attacking a different level)

Alex Miller (Clojure team)12:08:41

Not interested in adding that to tools.deps but it’s all open multimethods so no need to be in the project

Alex Miller (Clojure team)12:08:07

The one big caveat is that the Clojure CLI currently has no hook to load such a thing (not a problem when using tools.deps directly as a lib). I’ve been pushing that off as a problem to solve when it needed solving

Alex Miller (Clojure team)12:08:17

All of the extension points are defined in clojure.tools.deps.alpha.extensions

genRaiy12:08:56

ok, thanks. Understood

seancorfield17:08:55

@alexmiller With t.d.a, if it encounters the same dependency in multiple places in the dependency tree, both with git SHAs, can it compare them in some circumstances but not others, or does it always throw Unable to compare versions for... regardless of whether one SHA is an ancestor of the other?

Alex Miller (Clojure team)17:08:50

it can compare them in any case where there is an ancestor relationship and otherwise fails

Alex Miller (Clojure team)17:08:49

in the latter case, there is no way to determine which is preferred (so you'll need to resolve it explicitly at the top level)

Alex Miller (Clojure team)17:08:27

the more descendant one is preferred (as it is presumably the newer one)