Fork me on GitHub
#tools-deps
<
2018-10-29
>
steveb8n04:10:23

When using :git/url deps, is there any way to emulate latest or snapshot style behaviour? I'm having to manually updates shas a lot.

dominicm06:10:53

I don't think so - as an intentional decision.

dominicm06:10:12

You could write a script to update them automatically though.

steveb8n08:10:33

Interesting idea. It seems like I won't be the only one wanting this. I wonder if there's another best/good practice to emulate maven in this way

dominicm10:10:30

The code is about 100 lines. You could modify the resolve-tags library I write quite easily.

👍 4
steveb8n10:10:38

Hmm, maybe I should be writing a new “procurer”. I’ll look into that as a solution. thanks for the nudge in a new direction

Alex Miller (Clojure team)12:10:35

It does, but tools.deps does not (gitlibs is intentionally broader and more generic)

arrdem09:10:31

If you're coordinating changes between many repos all the time I think it's worth considering whether the apparent decoupling you have at repo boundaries maps at all to stable designed API boundaries or whether you'd be better off admitting that you don't yet have decoupling and would be better served putting everything in one place for now.

steveb8n10:10:28

Good point. In my case it’s not de-coupling I want, but shared specs. The specs are changing a lot currently, hence the need for regular updates

arrdem09:10:59

In slightly related news I got a Katamari v0.0.5 out the door which successfully does content addressing of build products (jars, uberjars, javac'd classfiles). At this point it's fully self-bootstrapped and stable as such. Incremental rebuilds were the big thing I wanted to get working before this week's meeup - if I can get repl and test tasks sorted out I'll be happy enough to really try and push this thing. https://github.com/arrdem/katamari/releases/tag/v0.0.5 for your amusement.

cjohansen10:10:34

I cleared out ~/.m2/repos/org/apache, and now I’m seeing this error with tools.deps:

cjohansen10:10:40

Exception in thread "main" org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.httpcomponents:httpcore:jar:4.4.9

cjohansen10:10:00

after googling a little, it seems to go away with this in deps.edn:

cjohansen10:10:02

:mvn/repos {"central" {:url ""}
             "clojars" {:url ""}}

cjohansen10:10:06

what’s going on here?

cjohansen11:10:42

btw, I can observe that the jar in question is both being downloaded by the Clojure process, and is available in my ~/.m2 after its run (and failed)

Alex Miller (Clojure team)12:10:14

Those maven repos are already set in the install deps.edn so that shouldn’t make much difference

Alex Miller (Clojure team)12:10:41

Can you post the entire deps.edn for repro?

jerger_at_dda13:10:19

I had just the time to watch "Dependency Heaven" an like the arguments. I'm working quite a lot with git dependencies on systems like gitbook (make books out of git-repos containing md) or smeagol (a git-repo / MD based wiki) But I find it quite hard to find a good abstraction for addressing git resources. Are there any plans to support other git servers like gitlab (the SaaS and all the on prem instances) or gitblit, gittea et al? What about private repos? In context of privisioning git repos I use this schema: https://github.com/DomainDrivenArchitecture/dda-git-crate/blob/master/doc/reference_domain.md The relevant parts are Repository and GitCredential. These informations will lead to completely different urls like , or In my opinion this part of the dependency problem is not limited to the clojure world ... do you see a chance for finding a more general solution?

dominicm14:10:16

@jerger_at_dda gitlab is supported? Anything git takes should work I think?

dominicm14:10:30

Also, I think you'd be interested in tools.gitlibs 🙂

jerger_at_dda14:10:13

okay I see ... switching between https & ssh references is not a usecase for u - so your implementation not has to cope with url-magic.

jerger_at_dda14:10:26

Gitlab & Github will both have a git user for ssh access (url is sth like >)

jerger_at_dda14:10:19

But gitblit urls will not work in your way because gitblit urls will have a personal user like . Any cool idea about this case?

dominicm14:10:56

I would probably use the :defaults feature in my ~/.clojure/deps.edn file.

dominicm14:10:19

Sorry, *`:default-deps`

jerger_at_dda14:10:39

in tools.deps.alpha I can not find any information about default-deps. But our discussion made me more clear about my question remaining: How can I express a dependency for private gitblit repositories? The urls dependend on authorized user - so it would be or

dominicm14:10:15

:default-deps would be how I solve gitblit repos I mean. They are documented here https://clojure.org/reference/deps_and_cli

jerger_at_dda14:10:39

okay found default-deps in reference.

jerger_at_dda14:10:53

how would defaults help?

jerger_at_dda14:10:59

lets take

{:deps {gitblit-sally/awesome {:git/url ""}}}
for example

dominicm14:10:05

You wouldn't do that, you would do this:

{:deps {gitblit/awesome nil}}
Then a user would put an alias in ~/.clojure/deps.edn
{
:aliases
{:defaults
 {:default-deps {gitblit/awesome {:git/url "…"}}}}}
This way, the user specifies how to resolve gitblit/awesome on their machine.

jerger_at_dda14:10:00

okay ... got it

jerger_at_dda14:10:35

elegant solution for the clojure dependecy case ...

jerger_at_dda14:10:54

I will think about how to translate this idea to my dokument-references ... thx 🙂

dominicm14:10:18

It's an okay solution. In an ideal world, it would be nice to separate auth for some.server from it's reference, but ¯\(ツ)

Alex Miller (Clojure team)18:10:08

@dominicm hey, just helped someone track down a problem that looks due to a bad sha on the pack.alpha readme

Alex Miller (Clojure team)18:10:03

in the “Auto-add to project” example, the sha at the end that is being injected is 1d455f6c591f440560c57a29e6d930004d735dcf, which is from May (if I understand what’s happening there correctly)

Alex Miller (Clojure team)18:10:40

I’m assuming it should probably match the first sha or at least be more recent that that

Alex Miller (Clojure team)18:10:24

the thing that was failing was due to not having the system repos, which looks like it was fixed in August

dominicm18:10:21

I will bump that this evening, @alexmiller. Thanks for the nudge 😊

dominicm18:10:11

Was it somewhere I should have seen it to support? I don't want to burden you with my mistakes!

dominicm19:10:19

Bumped! 🙂

ro621:10:25

Is there something wrong with the way I'm trying to pass this Java option: clojure -J-verbose:class?

ro621:10:13

it works if I do it in deps.edn like this: :jvm-opts ["-verbose:class"]

dominicm21:10:58

@robert.mather.rmm what problem do you have?

ro621:10:41

Error building classpath. Specified aliases are undeclared: [:-J-verbose :class]

hiredman21:10:01

are you using a recent clj script?

hiredman21:10:48

clj -Sdescribe 
{:version "1.9.0.375"
 :config-files ["/home/kevin/clojure-scripts/lib/clojure/deps.edn" "/home/kevin/.clojure/deps.edn" "deps.edn" ]
 :install-dir "/home/kevin/clojure-scripts/lib/clojure"
 :config-dir "/home/kevin/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}
and clj -J-verbose:class works for me

ro621:10:31

:version "1.9.0.394"

ro621:10:45

weird, I changed deps.edn a bit and now it works suddenly. Let me see if I can rewind to the failing state

ro621:10:55

can't, now it just works. Filing that one under "no idea"...

dominicm21:10:09

The error is weird, makes me think of -O

ro621:10:07

Here's an even better one:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at clojure.main.<clinit>(main.java:20)

Alex Miller (Clojure team)21:10:38

I think where this ^^ has been seen is when user.clj has an issue

👍 4
ro621:10:15

You're right, moving user.clj out of the classpath fixed it.

Alex Miller (Clojure team)21:10:00

I’ve got a todo to look at the ticket filed about this in TDEPS (really, I think it’s a CLJ problem)

Alex Miller (Clojure team)21:10:02

@robert.mather.rmm if the error was occurring during classpath creation, then you are probably getting the cached cp and missing that part of the logic. You can use -Sforce to force recomputation (and maybe retrigger the error)

ro621:10:15

You're right, moving user.clj out of the classpath fixed it.

Alex Miller (Clojure team)21:10:46

Clojure should be better at reporting those

Alex Miller (Clojure team)21:10:59

just needs a try/catch in the user.clj load path