Fork me on GitHub
#tools-deps
<
2019-07-01
>
dharrigan13:07:07

This may be a daft question, but if I switch JVMs (from 12 to 8 ) on the command line, and I restart the repl, do I need to clean up anything to ensure that JVM 12 bytecode is gone? Or is it all in memory etc...?

dharrigan13:07:27

I'm trying to track down a really really difficult to diagnose interop issue and I'm starting to run out of options.

ghadi13:07:34

same as lein

ghadi13:07:42

it's all in memory unless you've AOTed something to disk

ghadi13:07:00

you should post more specifics about the interop issue @dharrigan

dharrigan13:07:12

I've posted the problem in #interop, no response yet.

Alex Miller (Clojure team)13:07:13

bytecode is only created if you 1) AOT (and you typically tell it where to go, like target/classes) or 2) in memory when loading source. It's not cached anywhere else.

dharrigan13:07:46

basically (and I don't really want to get into a crosspost/in-depth here), a one-liner in Kotlin message.toByteArray() where message = protobuf, fails miserably with clojure (.toByteArray message), with clojure complaining about illegalaccesserror. So, I even tryed to extract that code into a little kotlin module by itself and invoke kolin code from clojure (that does the same thing) but I see the same issue. It feels like the JVM isn't finding all the classes <shrug> no idea.

Alex Miller (Clojure team)13:07:36

prob better to have this discussion in #interop

dharrigan13:07:58

I see your message 🙂

Travis16:07:56

with tools deps is there a way to add built java classes to the classpath ? For instance I have a project using GRPC which is protobuf java classes that are generated.

ghadi16:07:12

^ corresponds to classpath directly

ghadi16:07:25

or :extra-paths if you're in an alias

Travis16:07:49

ok, so just add a path to where the classes exist

ghadi16:07:03

to the output directory of protobuf, probably

Travis16:07:04

gotcha, wasn’t sure if that worked for class files

ghadi16:07:35

for $dir/foo/bar/Something.class you'd add $dir

dnolen19:07:16

hrm in order to resolve conflicts between git deps & mvn deps (in this case ClojureScript) it should be possible to use :exclusions right? Has anyone else got this working?

dnolen19:07:44

I keep seeing: Error building classpath. Unable to compare versions for org.clojure/clojurescript: {:mvn/version "1.10.516", :deps/manifest :mvn} and {:git/url "[email protected]:clojure/clojurescript.git", :sha "13fde33d737b0d47bdaaf102ed8e1c49342ade3c", :deps/manifest :deps, :deps/root "~/.gitlibs/libs/org.clojure/clojurescript/13fde33d737b0d47bdaaf102ed8e1c49342ade3c"}

dnolen19:07:16

Odd because -Stree doesn't show org.clojure/clojurescript after my exclusions

Alex Miller (Clojure team)19:07:12

@dnolen not sure if that msg connects to something above?

dnolen19:07:59

to clarify, I got the above error

dnolen19:07:10

then I ran clj -Stree and I saw ClojureScript coming from maven

dnolen19:07:39

I used -Stree to systematically remove ClojureScript maven artifacts via :exclusions

dnolen19:07:16

still get the same error

dnolen20:07:23

also I don't see ClojureScript except for the git one when I run clj -Spath

Alex Miller (Clojure team)20:07:05

"got the above error" refers to what?

dnolen20:07:42

Error building classpath. Unable to compare versions for org.clojure/clojurescript: {:mvn/version "1.10.516", :deps/manifest :mvn} and {:git/url "[email protected]:clojure/clojurescript.git", :sha "13fde33d737b0d47bdaaf102ed8e1c49342ade3c", :deps/manifest :deps, :deps/root "~/.gitlibs/libs/org.clojure/clojurescript/13fde33d737b0d47bdaaf102ed8e1c49342ade3c"}

dnolen20:07:10

(was that missing before?)

Alex Miller (Clojure team)20:07:48

now I see it, maybe slack being weird

Alex Miller (Clojure team)20:07:44

the resolution algorithm may download things that don't show up in the final tree as it goes through the process of walking the deps and making decisions

dnolen20:07:08

I guess I'm confused as it to it barfs

dnolen20:07:10

and doesn't start

dnolen20:07:21

oh but maybe something adds it?

dnolen20:07:35

though I guess there's no way for me to see what?

Alex Miller (Clojure team)20:07:37

well at some point it's encountering the maven version and then trying to decide whether it's newer/older than the git version

Alex Miller (Clojure team)20:07:44

you can add a hidden verbose flag

Alex Miller (Clojure team)20:07:29

clj -Sdeps '{:aliases {:v {:verbose true}}}' -A:v

Alex Miller (Clojure team)20:07:51

not really designed to be understandable to anyone but me. I'm not sure you'll get the parent child linkage to know where it's coming in from that

Alex Miller (Clojure team)20:07:26

if you specify the clojurescript as a top dep, it should never need to make a decision though, so I'd expect that to work regardless

Alex Miller (Clojure team)20:07:29

if you want me to look at it in more depth, send me the full deps.edn and the verbose output if you have it, don't need to spam the channel here with it

dnolen20:07:33

let me see if I can just make this minimal

dnolen20:07:44

will drop something later, have to head for now