Fork me on GitHub
#tools-deps
<
2021-01-04
>
hanDerPeder19:01:51

can I add :jvm-opts without adding it in an alias?

borkdude19:01:12

I don't think that works

hanDerPeder19:01:10

I don’t know the internals of tools-deps. Does that make sense? Coming from leiningen it seems like a strange omission.

vlaaad20:01:33

You can add jvm opts at the point of invocation with clj -J... , but not in deps.edn file

Alex Miller (Clojure team)20:01:47

I continue to feel this is weirdly at odds with using tools

Alex Miller (Clojure team)20:01:03

and I'm going to continue not implementing it until that makes sense :)

seancorfield21:01:49

Yeah, I don't see much of a use case for it either. I have only ever needed to set JVM options for a specific task, which means a specific alias.

seancorfield21:01:23

But people do keep asking for it, so hopefully someone will come up with a justification for it that is convincing... 🙂

seancorfield21:01:20

(and "leiningen supports it" isn't at all convincing to me 🙂 leiningen does a lot of things that I don't think are necessarily good ideas)

Alex Miller (Clojure team)21:01:41

I do actually get the use case, it's just that's not the only use case

seancorfield21:01:22

What sort of JVM options can you imagine folks wanting to set for all operations in a deps.edn project? I'm curious...

Alex Miller (Clojure team)21:01:13

well the use case is where "all" is the two things you usually do

Alex Miller (Clojure team)21:01:10

and you "always" want to do something like set a system property for your app or a particular garbage collector or whatever

Alex Miller (Clojure team)21:01:17

I think in some cases "all" is really "when I run my repl I want default stuff to be set"

Alex Miller (Clojure team)21:01:01

that is in particular an interesting case where having a "default" alias might be useful

Alex Miller (Clojure team)21:01:48

not too different than leiningen :default profile really

hanDerPeder21:01:16

My current (and only) reason for wanting this is for playing around with Dragan Djurics ML libraries. Seems it needs a workaround for java 9+. https://github.com/uncomplicate/neanderthal/blob/master/examples/hello-world/project.clj#L11-L12

Alex Miller (Clojure team)21:01:27

Which you could put in an alias, you just need to remember to use it then

hanDerPeder21:01:37

Indeed, but it’s annoying when you forget 🙂 I’m all for features carrying their weight, just thought I’d ask.

seancorfield21:01:51

I think I would have a :run alias for running the app so it's just clojure -M:run and perhaps a :dev alias for running a REPL and just live with the duplication of :jvm-opts...

vlaaad21:01:27

I find lein's default profiles confusing, it's always hard to tell what's enabled/on the classpath

seancorfield21:01:04

Indeed. Leiningen's "helpfulness" is one of the things I always liked the least about it.

3
hanDerPeder21:01:24

couldn’t you use that same reasoning to argue against having a default`:deps` key?

seancorfield21:01:34

Although some folks think this is a bit much clj -M:repl:reflect:jedi-time:reveal:j14:classes:add-libs:dev+test 🙂

seancorfield22:01:52

@peder.refsnes having a base set of dependencies that almost every use case builds on is very useful tho'... same with a base set of :paths...

jjttjj22:01:15

I just have a :dev alias and have my editor always start a repl with that alias. It's pretty easy in emacs on both cider and inf-clojure. Do other editors offer something like this?

seancorfield22:01:51

I always start my REPL separately (and leave it running for ages -- my current REPL was started on December 24th!) and then connect one or more editors or other tools to it.

jjttjj22:01:59

That's impressive! I can't seem to go a day without some catastrophic crash that I brought on myself

vlaaad22:01:28

how do you ensure your code is live when e.g. switching between branches?

seancorfield22:01:22

@U47G49KHQ We rarely have long-lived branches and for the most part the code changes across multiple branches are accretive, rather than contradictory. I almost never need to require ... :reload-all (but I do have it bound to a hot key in VS Code). I occasionally need to remove a namespace (and then load it back in), if I'm changing aliases around (and, again, I have remove-ns bound to a hot key as well).

seancorfield22:01:48

(and I tend to develop against multiple server processes all running from inside the REPL -- we have an "everything" subproject in our monorepo that has :local/root dependencies on all the other subprojects so we can start a REPL there and have all source/test code and all dependencies available in a single REPL)

hanDerPeder22:01:33

@seancorfield of course, just being pedantic 🙂