This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-16
Channels
- # aleph (3)
- # announcements (14)
- # babashka (16)
- # beginners (85)
- # calva (6)
- # cider (9)
- # clojure (42)
- # clojure-australia (8)
- # clojure-europe (30)
- # clojure-nl (4)
- # clojure-uk (29)
- # clojuredesign-podcast (7)
- # clojurescript (25)
- # cursive (4)
- # data-science (1)
- # datomic (31)
- # emacs (1)
- # events (1)
- # fulcro (16)
- # instaparse (2)
- # java (37)
- # kaocha (3)
- # malli (3)
- # meander (19)
- # membrane (7)
- # off-topic (13)
- # pathom (4)
- # pedestal (10)
- # re-frame (17)
- # reveal (3)
- # rewrite-clj (1)
- # ring (9)
- # shadow-cljs (17)
- # spacemacs (2)
- # sql (34)
- # tools-deps (88)
- # vim (4)
Hi! I’m having this issue https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows#long-classpath is there any other workaround besides the {:mvn/local-repo "/path/to/repo"}
one? That is not working either
@jplaza Hmmm. You could spit out the classpath to a file and then start Clojure using java -cp @classpath-file clojure.main
but this is a bit spartan maybe.
there is a ticket with some work on it but I don't know that they are workarounds currently
I tried the @$CpFile
suggested and seemed to work. Added a sample diff here: https://github.com/clojure/brew-install/pull/4#issuecomment-728905508
Doesn't check the Java version though so would need something extra for Java 8 (if needed).
borkdude@MBP2019 /tmp $ clojure -Spath > classpath
borkdude@MBP2019 /tmp $ java -cp @classpath clojure.main
Clojure 1.10.1
user=>
seems like it could easily do so since it always has a classpath file already :)
this would actually be trivial
if you wanted to hack your ClojureTools.psm1 and try it
basically where you have -classpath $CP
if you changed that to "@$CP"
(probably not the right syntax but that's the idea) in like line 396
$CP here is the name of a classpath file
the exec case is maybe the hardest as it adds the special exec jar: -classpath "$CP;$InstallDir/exec.jar"
so might need to emit a well-known variant for that case or something
if someone wanted to work on a patch, would be happy to integrate that
you would have to append $InstallDir/exec.jar to the classpath file and then read that. Probably better to append it to some other file classpath-exec
and then use that one
yes that would be my expectation. I'm suggesting that right now we write 12341234.cp and we could also write 12341234-exec.cp (which included the exec jar) and use that instead for the -X case
been around for a long time
if it works on Java 8, then it's ok by me :)
looks like maybe java 9?
I think maybe it was added in java 9 based on my googling. I thought it was older than that
well, could make it version dependent - if java version is 9+, use @
or maybe invert, if Java version is 8, don't use @
Yeah, that makes sense. That will assume you will not re-use your cache for different java versions, so maybe include the java version in the cache hash if you haven't already
I don't think you need that
the files are the same either way, it's just whether or not you can use it via @
by calling java -version ?
what's the error if you use the @file on java 8?
$ java -cp @classpath clojure.main
Error: Could not find or load main class clojure.main
not too distinguishable then
I was wondering if you could just assume it would work, detect the failure and retry
yeah, it could be an env var too. I was trying to avoid that :)
might be the cleanest though
that's fine
@alexmiller alternative dirty workaround: use add-lib to load the libs later on ;)
yeah, I said dirty, but it's always good to list alternatives, even when they're bad ;)
who knows if that day will ever come
another alternative: reverse engineer the java command line tool and build a nicer front-end which supports this for older java versions ;)
Thanks for the fast reply @alexmiller @borkdude! I’m helping a teammate with that issue. She has java 9.
I told her the problem is that she’s using Windows haha! She’s installing Windows Subsytem for Linux
as a quick workaround: https://clojurians.slack.com/archives/C6QH853H8/p1605552978403300
> Windows command-line length limit Does this apply to cmd.exe, powershell.exe or is it a conhost limit? Do you experience the same problem with the new Windows Terminal?
Yeah, I gave up on the whole Powershell thing and just do everything on WSL2 now. Esp. with VS Code's Remote-WSL2 extension.
Yes, but I prefer to dock a GUI next to my editor rather than switch back and forth between an editor and a browser.
(I run VcXsrv aka Xlaunch so I can start X11-based GUIs from WSL2, such as REBL or Reveal)
@jplaza I use Clover with VS Code. I like working with a plain Socket REPL in processes -- I avoid nREPL and all that stuff. Clover is "Chlorine for VS Code" and I was previously using Chlorine on Atom.
OK I will try that. I already cloned your deps.edn https://github.com/seancorfield/dot-clojure to play with the sock repl
We use clj-kondo in our team! Awesome tool! I actually mentioned our startup in the issue so you can list us there 😉
I assumed clojure -X:deps mvn-pom :lib 'foo/bar' :version '"0.0.1-SNAPSHOT"'
would generate generate me a POM with the specified details but I’m not having any luck - I just get defaults. (Maybe mvn-pom
doesn’t pass the args on through to sync-pom
?). Was this not an intended usage? Or am I missing something? Or just an oversight?
it does not pass those through right now
mvn-pom may go away in favor of tools.build once that is out so I'm resisting the urge to make it better
In the mean time you might try this: https://github.com/rickmoynihan/pom-update
hot off the press so YMMV, I’ve not even properly announced it yet.
Thanks - works for me if I generate the POM with tools.deps then update the version with pom-update. I needed to add :pom/write-strategy :overwrite :pom/input-file '"pom.xml"'
explicitly though.
oh yes thanks that’s intentional, I just forgot to add that to the README.md when I wrote it up last night. I’ll do that now. Thanks for letting me know.
Fixed.
My recommendation is that you include those in your deps.edn
rather than via command line, as they won’t vary across calls.
See the updated README.md
@jplaza if you find out stuff about using WSL2 with Calva, please consider updating this page: https://calva.io/wsl/