tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
seancorfield 2020-12-10T00:01:02.384100Z

Zulu OpenJDK 8 has a version with OpenJFX bundled. That's what I use locally when I still need to test on JDK8.

seancorfield 2020-12-10T00:04:10.385500Z

(right now I'm running OpenJDK 15+36 and specifying OpenJFX 15-ea+6 in my ~/.clojure/deps.edn file, just FYI @felipecortezfi)

Felipe 2020-12-10T00:55:12.386500Z

huh, why does rolling back make javafx available then?

Felipe 2020-12-10T00:55:50.387Z

with an older version of tools.deps I do get to open a REBL window

seancorfield 2020-12-10T01:03:55.388100Z

An older version of the Clojure CLI, you mean (yes, it happens to use an older version of t.d.a but 1.10.1.507 is the CLI version, not the t.d.a version).

Felipe 2020-12-10T01:04:50.388900Z

yep

Felipe 2020-12-10T01:05:07.389500Z

sorry, I always get mixed up between CLI / tools.deps

seancorfield 2020-12-10T01:06:04.390500Z

I have to say that what you're seeing doesn't make much sense to me. I don't see how you can run REBL on OpenJDK 8 at all. And I can't see why just changing the CLI version would affect how REBL and its dependencies are handled.

alexmiller 2020-12-10T01:06:57.391Z

Ditto, not sure why it would work on the old one

alexmiller 2020-12-10T01:07:17.391500Z

Unless how you’re changing the version also changes the jdk

seancorfield 2020-12-10T01:09:24.392400Z

(! 806)-> JAVA_HOME=$OPENJDK8_HOME /usr/local/Cellar/clojure\@1.10.1.561/1.10.1.561/bin/clj -Sdeps '{:deps {com.cognitect/rebl {:mvn/version "0.9.242"}}}'
Clojure 1.10.1
user=> (require '[cognitect.rebl :as rebl])
nil
user=> (rebl/ui)
Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:382).
netscape.javascript.JSObject
user=> ^D
(! 807)-> JAVA_HOME=$OPENJDK8_HOME java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
I can repro your JSObject error with OpenJDK8 and CLI 1.10.1.561 and REBL 0.9.242 -- which is what I would expect.

seancorfield 2020-12-10T01:12:51.393Z

And I see the exact same error with the very latest CLI (again, exactly as I would expect):

(! 809)-> JAVA_HOME=$OPENJDK8_HOME /usr/local/Cellar/clojure\@1.10.1.754/1.10.1.754/bin/clj -Sdeps '{:deps {com.cognitect/rebl {:mvn/version "0.9.242"}}}'
Clojure 1.10.1
user=> (require '[cognitect.rebl :as rebl])
nil
user=> (rebl/ui)
Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:382).
netscape.javascript.JSObject
user=> 

seancorfield 2020-12-10T01:14:53.394Z

With JDK 15 and CLI 1.10.1.561, I get this error -- which, again, is expected because there's no OpenJFX deps in play:

(! 810)-> /usr/local/Cellar/clojure\@1.10.1.561/1.10.1.561/bin/clj -Sdeps '{:deps {com.cognitect/rebl {:mvn/version "0.9.242"}}}'
Clojure 1.10.1
user=> (require '[cognitect.rebl :as rebl])
nil
user=> (rebl/ui)
Execution error (ClassNotFoundException) at jdk.internal.loader.BuiltinClassLoader/loadClass (BuiltinClassLoader.java:606).
javafx.scene.web.WebEngine
user=> ^D
(! 811)-> java -version
openjdk version "15" 2020-09-15
OpenJDK Runtime Environment AdoptOpenJDK (build 15+36)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 15+36, mixed mode, sharing)

seancorfield 2020-12-10T01:15:59.394500Z

(and the exact same error happens on CLI 1.10.1.754 with that setup)

seancorfield 2020-12-10T01:16:23.395Z

@felipecortezfi What's in your ~/.clojure/deps.edn file?

Felipe 2020-12-10T01:22:26.395300Z

{:mvn/repos {"central" {:url "<https://repo1.maven.org/maven2/>"}
             "clojars" {:url "<https://repo.clojars.org/>"}}

 :aliases {:1.8     {:override-deps {org.clojure/clojure {:mvn/version "1.8.0"}}}
           :1.9     {:override-deps {org.clojure/clojure {:mvn/version "1.9.0"}}}
           :1.10    {:override-deps {org.clojure/clojure {:mvn/version "1.10.0"}}}
           :1.10.1  {:override-deps {org.clojure/clojure {:mvn/version "1.10.1"}}}
           :master  {:override-deps {org.clojure/clojure {:mvn/version "1.11.0-master-SNAPSHOT"}}}
           :new     {:extra-deps {seancorfield/clj-new {:mvn/version "0.8.6"}}
                     :main-opts  ["-m" "clj-new.create"]}
           :deps    {:extra-deps {org.clojure/tools.deps.alpha {:git/url "<https://github.com/clojure/tools.deps.alpha>"
                                                                :sha     "148cab8f154711f8495bd632ebdc53a14dff7f09"}}}
           :depstar {:extra-deps {seancorfield/depstar {:mvn/version "0.5.2"}}}}}

Felipe 2020-12-10T01:29:06.395400Z

I don't think so, but I'll check tomorrow

seancorfield 2020-12-10T03:20:25.396100Z

@felipecortezfi OK, doesn't look like anything that could disrupt what you're trying to do here... very weird...

seancorfield 2020-12-10T03:22:27.398Z

I will say: rename :deps to :add-libs and update the SHA to match what's in my latest dot-clojure file. :deps is provided in the system deps.edn (baked into the CLI and t.d.a) and having a conflicting :deps alias will cause you all sorts of breakage/confusion now that the Clojure CLI has documented -X:deps based tooling!

arohner 2020-12-10T15:54:36.398700Z

I think this is a bug, which would be very helpful in CI:

$ clojure -X bogus
Unqualified function can't be resolved: bogus
bash-3.2$ echo $?
0

arohner 2020-12-10T15:55:01.399200Z

similarly:

clojure -X clojure.core/println :foo :::invalid
Unreadable arg: ":::invalid"
bash-3.2$ echo $?
0

alexmiller 2020-12-10T16:03:47.399400Z

the bug being... the exit code?

arohner 2020-12-10T16:04:59.399600Z

yes

arohner 2020-12-10T16:05:46.400200Z

runtime errors correctly set the exit code:

$ clojure -X clojure.core/assoc 1 2
Execution error (ArityException) at clojure.run.exec/exec (exec.clj:39).
Wrong number of args (1) passed to: clojure.core/assoc--5416

Full report at:
/var/folders/4l/tfxcfcs16t17zs2_pgkyxy540000gn/T/clojure-4043596194159065702.edn
bash-3.2$ echo $?
1

alexmiller 2020-12-10T16:09:32.400800Z

yeah, I got it. that's done automatically if you throw out of main. I'll fix, thanks!

👍 1
alexmiller 2020-12-10T19:47:46.401900Z

@arohner I released 1.10.1.763 prerelease with that change if you care to try it (or just wait for the next stable)

alexmiller 2020-12-10T19:48:29.402500Z

I think I might actually have had that in there originally but pulled it when I was writing unit tests, with the intention to put it back

alexmiller 2020-12-10T19:49:02.403Z

all of the other programs run by clj were doing the proper thing already

arohner 2020-12-10T20:59:02.403200Z

Awesome, thank you

seancorfield 2020-12-10T21:16:46.404300Z

(this version just missed our candidate build for our next release but I have it on dev for testing; we have .739 on production and .754 in the QA pipeline)