Fork me on GitHub
#tools-deps
<
2020-01-20
>
tap02:01:46

Got an error trying to start clj repl with rebl

Error building classpath. org.apache.maven.repository.internal.DefaultModelResolver.<init>(org.eclipse.aether.RepositorySystemSession, org.eclipse.aether.RequestTrace, java.lang.String, org.eclipse.aether.impl.ArtifactResolver, org.eclipse.aether.impl.VersionRangeResolver, org.eclipse.aether.impl.RemoteRepositoryManager, java.util.List)
java.lang.NoSuchMethodException: org.apache.maven.repository.internal.DefaultModelResolver.<init>(org.eclipse.aether.RepositorySystemSession, org.eclipse.aether.RequestTrace, java.lang.String, org.eclipse.aether.impl.ArtifactResolver, org.eclipse.aether.impl.VersionRangeResolver, org.eclipse.aether.impl.RemoteRepositoryManager, java.util.List)
	at java.lang.Class.getConstructor0(Class.java:3082)
	at java.lang.Class.getConstructor(Class.java:1825)
	at clojure.tools.deps.alpha.extensions.pom$model_resolver.invokeStatic(pom.clj:49)
	at clojure.tools.deps.alpha.extensions.pom$model_resolver.invoke(pom.clj:39)
	at clojure.tools.deps.alpha.extensions.pom$read_model.invokeStatic(pom.clj:60)
	at clojure.tools.deps.alpha.extensions.pom$read_model.invoke(pom.clj:54)
	at clojure.tools.deps.alpha.extensions.local$eval925$fn__927.invoke(local.clj:68)
	at clojure.lang.MultiFn.invoke(MultiFn.java:244)
	at clojure.tools.deps.alpha$expand_deps$fn__1191.invoke(alpha.clj:191)
	at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:190)
	at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:168)
	at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:236)
	at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:216)
	at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invokeStatic(make_classpath2.clj:56)
	at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invoke(make_classpath2.clj:48)
	at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:82)
	at clojure.tools.deps.alpha.script.make_classpath2$run_core.invoke(make_classpath2.clj:73)
	at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:102)
	at clojure.tools.deps.alpha.script.make_classpath2$run.invoke(make_classpath2.clj:96)
	at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:147)
	at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:119)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:514)
	at clojure.main$main_opt.invoke(main.clj:510)
	at clojure.main$main.invokeStatic(main.clj:664)
	at clojure.main$main.doInvoke(main.clj:616)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:40)
deps.edn
{:deps {}
 :aliases
 {:rebl {:extra-deps {org.clojure/clojure {:mvn/version "1.10.1"}
                      org.clojure/core.async {:mvn/version "0.4.490"}
                      com.cognitect/rebl {:local/root "/path/to/REBL.jar"}}
         :main-opts ["-m" "cognitect.rebl"]}}}
The command I run
clj -R:rebl
Has anyone had the similar issue?

seancorfield03:01:57

What version does clojure -Sdescribe report?

seancorfield03:01:46

@tap And you're aware that -R:rebl will add those dependencies but won't run REBL -- it will run the default behavior, which is to start a regular clojure.main REPL.

tap03:01:05

{:version "1.10.1.496"
 :config-files ["/usr/local/Cellar/clojure/1.10.1.496/deps.edn" "/Users/xxx/.clojure/deps.edn" "deps.edn" ]
 :config-user "/Users/xxx/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/Cellar/clojure/1.10.1.496"
 :config-dir "/Users/xxx/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}

seancorfield03:01:50

Your deps.edn file doesn't look valid -- you have five } on that line with com.cognitect/rebl

seancorfield03:01:18

That would put :main-opts outside the whole { } of the deps.

tap03:01:50

Yeah. Fixed up there. I removed :main-opts just to test it out. Miss that when I readded it to ask question here.

tap03:01:50

Yes. I'm aware that -R won't run REBL. Just want to make it clearer that it's not related to :main-opts.

seancorfield03:01:17

Which version of REBL is that local JAR file?

tap03:01:15

REBL-0.9.220.jar

seancorfield03:01:11

Ok, I have that setup locally... just a sec...

seancorfield03:01:52

Yeah, with -R:rebl I get that same error. I've just never run it that way -- that's odd.

tap03:01:19

I got the same error with -A as well

seancorfield03:01:54

Let me switch computers and try something...

tap03:01:59

I saw a quick fix related to pom for tools.deps.alpha recently. Not sure if it's related. https://github.com/clojure/tools.deps.alpha/commit/fbe57d942af2016229e0aabba9121e62de848729 I'm also not sure if I'm using the latest tools.deps.alpha at the moment.

seancorfield03:01:44

I tried it with the add-lib branch SHA that I normally use and got the same exception.

tap03:01:19

Thanks for your help looking into this

seancorfield03:01:07

Yeah, I can't start my regular dev environment with the latest clojure version with REBL (I've been on vacation for a several days so this is the first time I've tried since the last clojure/`tools.deps.alpha` update) -- /cc @alexmiller looks like the latest release breaks when used with REBL

seancorfield03:01:23

Looks like clojure isn't set up in a way that earlier releases can be installed with brew 😞

sogaiu03:01:44

@seancorfield @tap it looks like i am able to reproduce the problem as well (this is a linux box)

sogaiu03:01:35

i have an install script for 1.10.1.492 i can try

seancorfield03:01:01

Yeah, I think the latest changes in clojure/`tools.deps.alpha` are incompatible with the current release of REBL -- because it is AOT'd

seancorfield03:01:56

Looks like Cognitect will need to release a new version of REBL to fix this (which in turn won't be compatible with earlier clojure/`tools.deps.alpha` builds, I suspect).

sogaiu03:01:56

i just tried with 1.10.1.492 and it works with the REBL-0.9.220 jar

sogaiu03:01:44

switching to 1.10.1.496 gives the exception

seancorfield03:01:54

Weirdly, there's nothing I can see in the REBL JAR or its pom.xml that suggests it wouldn't be compatible... so I guess we have to wait for @alexmiller and/or some other Cognitect folks to chime in tomorrow. Very frustrating we can't downgrade clojure via Homebrew tho'...

sogaiu03:01:24

i guess the bit about "installing from a specific commit" here: http://effectif.com/mac-os-x/installing-specific-version-of-homebrew-formula doesn't apply?

sogaiu03:01:53

may be the info is dated...

seancorfield03:01:41

Workaround:

$ curl -O 
$ curl -O 
$ tar xvfz clojure-tools-1.10.1.492.tar.gz
and then edit your current clojure shell script to point to the clojure-tools/clojure-tools-1.10.1.492.jar from that expansion instead of the installed 496 version.

❤️ 1
seancorfield04:01:00

(at least I'll be back up and running at work tomorrow morning now!)

alexmiller04:01:40

the exception above from @tap is a regression that is fixed in master and I'll release it tomorrow

👍 1
1
alexmiller04:01:07

you can actually get the older brew formulas if you want to download

alexmiller04:01:11

rename that to clojure.rb, then brew reinstall --force clojure.rb

alexmiller04:01:57

brew can only reinstall older versions that you have previously downloaded and installed that you still have in the brew cache

alexmiller04:01:19

there is no repository of versions like there is with Maven or something, just "the current version"

seancorfield04:01:18

Is there an option on upgrade or in a specific formula to not delete the old version?

seancorfield04:01:45

(and good to know on the force install from a downloaded older version)

alexmiller04:01:52

by default, I think it leaves it

alexmiller04:01:52

ls ~/Library/_Caches_/Homebrew

alexmiller04:01:30

and then Formula/clojure under that

tap04:01:42

Is it appropriate to write about this how to downgrade brew clj package on https://clojure.org under Guides section? I'll do that if y'all think so.

alexmiller04:01:56

nah, I'd prefer to bury it in reference and link

seancorfield04:01:47

Under ~/Library/Caches/Homebrew is just the current version of each installed package.

alexmiller19:01:47

Latest (1.10.1.502) with regression fixes is now available in brew etc

alexmiller19:01:59

Fixed for pom deps and pom gen

seancorfield19:01:10

Works with REBL now -- thank you for the swift update!

alexmiller19:01:13

I also added some tests to catch it earlier next time!

sogaiu20:01:26

seems to work on a linux here :thumbsup:

alexmiller21:01:51

oh also, this release has the version as the first line of clj -h

👍 5
andy.fingerhut21:01:23

You have been worn down explaining the -Sdescribe and -Sverbose options 🙂 Soon you will succumb to the pull to the dark side of adding a --version option.

alexmiller21:01:59

even that won't be the end - there will be confusion between the clojure tools version, the clojure tools default clojure version, and the version of clojure specified by the current project :)

andy.fingerhut22:01:03

Long ago I gave myself slightly more sanity by including a line like the following at the beginning of Eastwood's output, by default: == Eastwood 0.3.6-SNAPSHOT Clojure 1.10.0 JVM 1.8.0_192 ==

seancorfield22:01:08

Heh, that's why all our services report their git tag/SHA, along with the version of Clojure and the JVM at startup! 🙂

littleli21:01:24

seems to work on Windows too