Fork me on GitHub
#tools-deps
<
2021-07-13
>
dharrigan14:07:49

I'm curious, when executing a function using the -X switch, the JVM never exits, I have to put an explicit (System/exit 0) or similar. That's a bit surprising. I would have thought that as soon as the function has exited, the JVM would shut down.

dpsutton14:07:49

does it stop after about 30 or 60 seconds?

dpsutton14:07:43

yeah its the agent threadpool i believe. you can call the really cool-named function (shutdown-agents).

borkdude14:07:58

yeah, the thing is that when you thread multiple functions and the non-last function calls that, it might screw things up :)

borkdude14:07:16

but perhaps the "wrapper" of this thread could call it as the last op

dharrigan14:07:49

I wonder if that could be added to the docs, i.e., as a little bit of useful information? Others trying this out may also wonder why the function isn't exiting, until 60 or so seconds have passed.

borkdude14:07:18

it's a common thing with CLI apps/scripts

Alex Miller (Clojure team)14:07:38

that's already been added in the current prerelease

Alex Miller (Clojure team)14:07:03

so you won't need to do this

seancorfield17:07:59

@dharrigan Update your CLI. That has been fixed.

seancorfield17:07:22

Oh, I see Alex already said that. Sorry, just catching up 🙂

seancorfield17:07:50

@alexmiller I was trying out the -X:deps help/doc thing, and I can get it to give me help for a whole :ns but when I try to get help for a single function, I just get

(! 1036)-> clojure -X:deps:uberjar help/doc :fn hf.depstar/pom
-------------------------

(! 1037)-> clojure -X:deps:uberjar help/doc :fn pom :ns hf.depstar
-------------------------
There are no examples in the docs so I'm not sure what is supposed to work...

seancorfield17:07:22

The following works:

(! 1038)-> clojure -X:deps:uberjar help/doc :ns hf.depstar
Entry point for clojure -X options.

-------------------------
hf.depstar/aot
([options])
  -X entry point for AOT compilation.
... lots of help for every function ...

dharrigan17:07:59

@seancorfield only fixed on a pre-release

Alex Miller (Clojure team)17:07:03

Either qualified :fn or :ns is supposed to work

Alex Miller (Clojure team)17:07:15

Please file a jira if you have a repro that doesn’t work

seancorfield18:07:32

I'll stick it up on ask for others to vote for it, and you can create a Jira in whichever is the appropriate project...

seancorfield18:07:51

(I initially thought it might just be a problem with stuff brought in via an alias but apparently not)