tools-build

Eddie 2021-09-29T15:52:52.429600Z

Does uber prune deps that aren’t used? (Maybe the term is “tree shaking”?) I am trying to set the uberjar main to a namespace in a :local/root dep that is never called called and getting a Error: Failed to load class ... When a require the namespace in an arbitrary source file and rebuild the uberjar, the error is no longer raised.

Alex Miller (Clojure team) 2021-09-29T15:54:23.430500Z

no pruning, should use all deps

Alex Miller (Clojure team) 2021-09-29T15:54:46.431100Z

are you compiling? if so, you might need to specify that it should be compiled if it's not in your src dir

Eddie 2021-09-29T15:55:09.431700Z

Ah ok. I am compiling. That is probably the issue.

Alex Miller (Clojure team) 2021-09-29T15:55:26.432100Z

by default compile-clj will compile all the namespaces in your project srcs

Alex Miller (Clojure team) 2021-09-29T15:55:39.432400Z

but it doesn't know about the local dep ones

Eddie 2021-09-29T15:57:08.433500Z

So maybe the way to go in this case is to inspect the basis to get the path to the dep(s) and call compile-clj on each? Does that sound sane?

Alex Miller (Clojure team) 2021-09-29T16:00:32.433900Z

compile-clj can be given a set of namespaces to compile

Alex Miller (Clojure team) 2021-09-29T16:00:45.434200Z

I think maybe I would call it twice - once the way you are

Alex Miller (Clojure team) 2021-09-29T16:01:04.434700Z

and again just to specify any additional specific namespaces to compile

Eddie 2021-09-29T16:04:08.435500Z

Gotcha. Thanks!