This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-02
Channels
- # announcements (1)
- # beginners (119)
- # calva (2)
- # cider (40)
- # cljsrn (14)
- # clojure (145)
- # clojure-dev (122)
- # clojure-europe (4)
- # clojure-italy (9)
- # clojure-nl (5)
- # clojure-spec (2)
- # clojure-uk (32)
- # clojuredesign-podcast (1)
- # clojurescript (10)
- # cursive (44)
- # data-science (1)
- # datomic (53)
- # defnpodcast (6)
- # emacs (6)
- # fulcro (13)
- # garden (25)
- # graalvm (3)
- # graphql (7)
- # jobs (3)
- # liberator (4)
- # nrepl (1)
- # off-topic (21)
- # quil (27)
- # reagent (4)
- # reitit (2)
- # remote-jobs (1)
- # ring-swagger (3)
- # shadow-cljs (3)
- # spacemacs (24)
- # sql (29)
- # tools-deps (68)
- # xtdb (2)
@ikitommi AFAIK tool.deps doesn't support java compilation. Only way I know to get around it is build the java project separately and import it as a dep in deps.edn
.
I messed around with JNI stuff and deps.edn
but basically did the compiling myself through a Makefile
, probably not helpful but still. https://github.com/Olical/snowball
yeah I had asked about it a while back and got the answer. compiling java is beyond tools.deps scope i think and it makes sense
My two suggestions are either to use an additional build tools around clj or to wall off your Java bits in their own project with their own artifact build
haven't tried the following yet, but it looked promising: https://github.com/EwenG/badigeon
@ikitommi you could always cheat and use the -e
option to run clojure.java.sh
and shell out to the Java compiler 😇😂🤪

great idea Sean 😉 did a external compile for my case, but puzzled that has the idea been that people would start using deps instead of boot or lein? Still need a “do-it-yourself” build tool on top - not the most welcoming newbie experience. Some official lein’ish battery-pack would be great?
someone in #core-async was having issues using badigeon to build an uberjar and the errors they were getting made me thing badigeon was double aot compiling core.async somehow, but looking at it again, I suspect badigeon may have an issue with timestamps so the clojure source files can end up being tagged with a newer time then the aot'ed code, which can break things
maybe here https://github.com/EwenG/badigeon/blob/master/src/badigeon/jar.clj#L120-L125
@U0NCTKEV8 yes thanks you were right. I forgot to set the last modification time when moving files to a jar/zip archive
@ikitommi Given how many beginners I've seen get tripped up with ~/.lein/profiles.clj
in the last few months, I think there's a good argument for simpler tooling like the Clojure CLI. I've seen beginners struggle a lot less with the CLI than you might think.
And, yes, as @ghadi says, "newbies" aren't trying to compile Java and Clojure together.
At work, we do everything with the CLI and a small handful of (sharp) tools. We have a shell script purely to automate repeated sequences of clojure
invocations.
@ikitommi in pack.alpha I do some clever stuff to compile java using the JDK api. Not much better than shelling out 🙂
I have toyed around with the idea of using the ztellman library for reloadable java with tools.deps but never actually done it.
@alexmiller circling back - the problem goes away if I supply a ClojureScript git dep version in the root project. Is the behavior I observed yesterday a bug, or just the current behavior? if I supply all the exclusions should I be able to avoid the warning about comparing versions?
walking the full deps tree necessarily requires comparing versions of things, and comparing mvn to git is not (yet) supported (although I know how to do it)
the question is whether in this particular scenario, with exclusions, the comparison can be avoided. exclusions are tricky and it's hard for me to answer that question without having the full scenario in hand.
@alexmiller ok when I made a minimal case :exclusions
worked for me - so I guess -Stree
can't be used reliably?
yes, and as you encounter more things, it's possible for the excluded state of something to change
-Stree tells you the end state, but is not the whole story of how it got there
yes, there is a ticket in this area (specifically around cljs iirc, although not with a git dep)
I think you are jumping to conclusions that are not necessarily true
it is possible to declare deps trees that are either logically inconsistent (impossible to satisfy the deps and exclusions as stated across the tree) or that are ambiguous
well you haven't given me a repro, so I can say either way
yeah I don't know how make this one since it's non-trivial project with non-trivial deps
most things do :)
-Stree should be the full tree of everything chosen at the end (it's just the inverted lib map which you can find in the .cpcache in the .lib file)
so other git stuff will appear there
it does not list things that were children but not chosen (due to exclusions or version selection or being dominated by a top dep)
sorry, I have to run to the dentist
I had a project which delcared a ClojureScript dep - and of course there were transitive deps that also declared ClojureScript but no conflicts because I guess clj considers the deps.edn :deps
to be overrides?
On your question above about overrides, I’m not sure what you mean but I suspect you’re making up a model there. Top level deps are always taken as overriding decisions of the transitive deps
When you move to your “upstream” project though, the deps of the “downstream” project are no longer top deps
So are subject to other selections