tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
Jakub Holý 2020-06-30T11:22:05.123Z

FYI my problem is fixed now. I believe something was wrong with my .m2/repository

alexmiller 2020-06-30T12:01:32.123200Z

Cool

unbalanced 2020-06-30T15:46:41.125300Z

Heya @alexmiller I'm reading through tools.deps and you're using some pretty advanced kung fu in there. I don't suppose in all your ample free time you've given any talks or write-ups on a deep dive there have you? I'm trying to write some clojurescript CLI tools for working with deps and trying to port some of the stuff. Also, I tried running with CIDER but nREPL on the deps ran into the predictable errors for including java classpaths -- I'm curious what your REPL technique is for developing tools.deps.alpha?

borkdude 2020-06-30T15:47:24.125700Z

@goomba There are a couple of tools.deps talks, they are listed in the repo

borkdude 2020-06-30T15:48:01.126100Z

Hmm, only the one from EuroClojure is https://www.youtube.com/watch?v=sStlTye-Kjk. But there's another one from the latest Conj.

unbalanced 2020-06-30T15:48:55.127300Z

I was there for the last one. I think I'm looking for more "how to contribute" style info

unbalanced 2020-06-30T15:49:19.128100Z

😄 reading seems like a good start

borkdude 2020-06-30T15:49:22.128200Z

@goomba ClojureScript already has cljs.main which works great in tandem with tools.deps?

unbalanced 2020-06-30T15:50:00.128700Z

yeah of course. I'm not trying to replicate that functionality -- I'm working on something more like "pip for deps"

unbalanced 2020-06-30T15:50:16.129Z

I'm lazy and I don't like editing my deps file by hand

unbalanced 2020-06-30T15:50:22.129200Z

also I can never remember version numbers

unbalanced 2020-06-30T15:50:47.129600Z

I've got it working for clojars but there's a bunch of stuff on git and maven and I don't know how to work with those yet

borkdude 2020-06-30T15:51:02.129900Z

interesting, anything public yet?

unbalanced 2020-06-30T15:51:31.130500Z

not yet because it's still a mess but I'll send you some stuff on what I've got

dpsutton 2020-06-30T15:53:26.130800Z

there is a project out there that will search and add things to your deps files

dpsutton 2020-06-30T15:54:38.131Z

https://github.com/hagmonk/find-deps

unbalanced 2020-06-30T15:57:46.131600Z

Ahh that's great. Reason I'm going the cljs route is just b/c of startup time etc

unbalanced 2020-06-30T15:58:00.131900Z

and for personal education, I suppose

borkdude 2020-06-30T15:58:12.132300Z

@goomba if startup time is important, you can also use GraalVM and/or babashka

unbalanced 2020-06-30T15:58:29.132800Z

I need to learn to use both of those, for sure

borkdude 2020-06-30T15:58:32.133Z

(all good options, including what you're doing now of course!)

dpsutton 2020-06-30T15:58:36.133300Z

didn't mean to derail your exercise. but you can peruse the good if you like 🙂

unbalanced 2020-06-30T15:58:53.133600Z

I'm hear here to learn in all forms!

unbalanced 2020-06-30T15:59:26.134200Z

Has GraalVM gotten to the point where we can write arbitrary CLI stuff in Clojure now?

unbalanced 2020-06-30T15:59:39.134600Z

(out of the loop)

borkdude 2020-06-30T15:59:48.134800Z

yeah, but you can do a lot with babashka as well, without compiling.

unbalanced 2020-06-30T16:00:01.135200Z

I need to sneak that one in at work 😈

borkdude 2020-06-30T16:00:40.135700Z

@goomba meta-example: https://github.com/borkdude/deps.clj that is the clojure bash script ported to both babashka and GraalVM, so you can either run it as script or binary

unbalanced 2020-06-30T16:01:20.136800Z

you can even babashka in powershell!? @borkdude your level of masochism is very impressive

borkdude 2020-06-30T16:01:34.137100Z

yeah, Windows supported too

unbalanced 2020-06-30T16:02:02.137400Z

some heroes don't wear capes

borkdude 2020-06-30T16:02:32.137800Z

how do you know I'm not wearing a cape? (haha, just kidding...)

2
unbalanced 2020-06-30T16:03:01.138200Z

well with covid I'm willing to wager most aren't even wearing pants. So I was just playing the odds

😂 3
unbalanced 2020-06-30T16:04:40.138800Z

It looks like find-deps , from a quick glance, is dealing with the same limitation I have

unbalanced 2020-06-30T16:05:00.139300Z

which is finding reagent is easy but org.clojure/core.match or org.clojure/core.async is not as easy

unbalanced 2020-06-30T16:05:27.139800Z

I'm not sure how to differentiate in Maven what is Clojure and what is Java, for instance, conceptually

unbalanced 2020-06-30T16:06:02.140300Z

or... maybe it doesn't matter -- as I say it out loud. That's kind of the point of Clojure, isn't it? 😆

dpsutton 2020-06-30T16:17:29.140700Z

there are some nice todos and vision in that find-deps lib that you could tackle

dpsutton 2020-06-30T16:17:39.141Z

dealing with rankings and preferences if i recall correclty

alexmiller 2020-06-30T16:44:08.143200Z

The last conj talk is probably the most detailed info about the impl. What part are you having trouble with? Re repl, I just open it in Cursive as a Maven project

alexmiller 2020-06-30T16:47:23.145800Z

If you’re talking about searching/finding deps, we’ve actually done some thinking about this in tandem with add-lib and I’ve even prototyped some of it in the add-lib2 branch of tools.deps but it’s not in a usable state right now

alexmiller 2020-06-30T16:48:42.146700Z

I guess really more in the context of repl dev not updating deps.edn

alexmiller 2020-06-30T16:49:36.147200Z

But could potentially be used for either I guess

flefik 2020-06-30T22:44:32.149400Z

Is there a good commit on the add-lib or add-lib2 branch that can be checked out and played around with? I'm thinking of adding a filewatcher on deps.edn and just automatically add any new libraries that are added there without having to restart the repl.

flefik 2020-07-01T07:47:53.169Z

thanks!

lread 2020-06-30T22:49:57.150400Z

hey @aviflax did you ever get a tools dep answer for tar.gz files ending up on your classpath? https://github.com/oracle/graal/issues/2481

avi 2020-06-30T22:50:15.150700Z

No

avi 2020-06-30T22:50:31.151Z

I meant to ask Alex about it here… thanks for the reminder

avi 2020-06-30T22:51:25.152Z

The comment on that issue from olpaw to the effect that the tar.gz file shouldn’t have been included in the classpath in the first place made sense to me.

avi 2020-06-30T22:51:53.152800Z

So I thought maybe this might be one of those places wherein tools.deps is deviating from commonly assumed Maven behavior/convention

avi 2020-06-30T22:52:14.153600Z

I don’t really know ¯\(ツ)

lread 2020-06-30T22:54:41.155400Z

Yeah, I bet @alexmiller knows! Here’s the dep that brings in tar.gz files: https://github.com/FundingCircle/repro-graalvm-mac-issue/blob/83abc805467808221cf48108f735527e3e3de9fa/deps.edn#L3

lread 2020-06-30T22:56:29.156700Z

I guess this does not happen with leiningen, as @borkdude references it from babashka project.clj https://github.com/borkdude/babashka/blob/e667bb5d2f344fdfd12ce12639c768d80e252138/project.clj#L57

avi 2020-06-30T22:58:54.157Z

Right

avi 2020-06-30T23:00:12.157800Z

As I mentioned in that graal issue, the tar.gz file comes from https://search.maven.org/artifact/org.graalvm.truffle/truffle-nfi/20.1.0/jar for org.graalvm.truffle/truffle-nfi 20.1.0:

<dependency>
      <groupId>org.graalvm.truffle</groupId>
      <artifactId>truffle-nfi-native-linux-amd64</artifactId>
      <version>20.1.0</version>
      <type>tar.gz</type>
    </dependency>

avi 2020-06-30T23:01:28.159300Z

I assume must be some use case for including such a file in a pom, although I have no idea what it is. And I assume that Maven, and whatever mechanism Leiningen uses to work with Maven, somehow filters these files out when/where they’re not needed/useful.

alexmiller 2020-06-30T23:23:56.160400Z

That’s a native dep and there is a facility in Maven to support loading those for the jvm

alexmiller 2020-06-30T23:24:51.161500Z

That Linux and amd64 there are actually parsed and used to select the right native dep for the os/arch

alexmiller 2020-06-30T23:25:22.162200Z

I think lein supports at least some of this too, but deps does not

lread 2020-06-30T23:26:56.162500Z

Thanks @alexmiller!

seancorfield 2020-06-30T23:29:28.165400Z

^ @cfeckardt

lread 2020-06-30T23:34:08.168600Z

@aviflax I have something working for my project, I’ll head over to #graalvm to followup

avi 2020-06-30T23:34:22.168700Z

Great!