Fork me on GitHub
#tools-deps
<
2020-06-30
>
Jakub Holý (HolyJak)11:06:05

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

Lone Ranger15:06:41

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?

Alex Miller (Clojure team)16:06:08

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

borkdude15:06:24

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

borkdude15:06:01

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

Lone Ranger15:06:55

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

Lone Ranger15:06:19

😄 reading seems like a good start

borkdude15:06:22

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

Lone Ranger15:06:00

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

Lone Ranger15:06:16

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

Lone Ranger15:06:22

also I can never remember version numbers

Lone Ranger15:06:47

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

borkdude15:06:02

interesting, anything public yet?

Lone Ranger15:06:31

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

dpsutton15:06:26

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

Lone Ranger15:06:46

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

Lone Ranger15:06:00

and for personal education, I suppose

borkdude15:06:12

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

Lone Ranger15:06:29

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

borkdude15:06:32

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

dpsutton15:06:36

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

Lone Ranger15:06:53

I'm hear here to learn in all forms!

Lone Ranger15:06:26

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

Lone Ranger15:06:39

(out of the loop)

borkdude15:06:48

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

Lone Ranger16:06:01

I need to sneak that one in at work 😈

borkdude16:06:40

@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

Lone Ranger16:06:20

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

borkdude16:06:34

yeah, Windows supported too

Lone Ranger16:06:02

some heroes don't wear capes

borkdude16:06:32

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

6
Lone Ranger16:06:01

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

😂 9
Lone Ranger16:06:40

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

Lone Ranger16:06:00

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

Lone Ranger16:06:27

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

Lone Ranger16:06:02

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

dpsutton16:06:29

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

dpsutton16:06:39

dealing with rankings and preferences if i recall correclty

Alex Miller (Clojure team)16:06:23

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

Alex Miller (Clojure team)16:06:42

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

Alex Miller (Clojure team)16:06:36

But could potentially be used for either I guess

flefik22:06:32

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.

seancorfield23:06:06

I have an example in my dot-clojure repo that I use all the time -- but @alexmiller has cautioned that add-lib will probably break as code moves around

lread22:06:57

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

avi22:06:31

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

avi22:06:25

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.

avi22:06:53

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

avi22:06:14

I don’t really know ¯\(ツ)

lread22:06:29

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

avi23:06:12

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>

avi23:06:28

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.

Alex Miller (Clojure team)23:06:56

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

Alex Miller (Clojure team)23:06:51

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

Alex Miller (Clojure team)23:06:22

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

lread23:06:08

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