leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
mister_m 2020-05-24T16:35:39.153700Z

Hello - I'm looking at a legacy code base, a leiningen plugin actually, that is :aot-ing a specific dependency version. This is not a good practice, and I'd like to remove it. However, I also want to make sure that anything using my legacy code base isn't pulling in a transitive dependency, or heck even a direct dependency, that is older than the version that the plugin requires. In general I guess I'm interested in figuring out what options I have here when dealing with version conflicts.

mister_m 2020-05-24T16:38:39.153800Z

As I understand it, the :pedantic? setting by default will warn when a version range is encountered without me having to do anything., is that right?

mister_m 2020-05-24T18:33:44.155100Z

actually RE the above, I am a bit confused about one thing: are the dependencies of a plugin being used on a project mixed up with the dependencies on my project itself? Why is that? Would the plugin dependencies not be independent from the dependencies of the project using the plugin?

mister_m 2020-05-24T19:49:10.155300Z

"the classpath" is my answer, nvm

2020-05-24T20:10:24.157200Z

@radicalmatt plugins are ran within the process of Leiningen itself (as a default). A project is ran in a separate process with its own classpath specified by its own dependencies. It doesnโ€™t share classpath with its plugins either.

2020-05-24T20:11:15.158100Z

The plugin dependency tree is separate. You can actually look it via lein deps :plugin-tree

๐Ÿ‘ 1
penryu 2020-05-24T21:22:20.162300Z

I'm working with a simple clojure 1.10 program which has a single dependecy on tools.cli. I have main.clj which contains only:

(ns foo.main
  (:require [foo.core :refer [start]])
  (:gen-class))
(defn -main [& args] (apply start args))

penryu 2020-05-24T21:23:02.163Z

In project.clj, I have :main foo.main and {:aot [foo.main]}

penryu 2020-05-24T21:23:53.163900Z

In core.clj, I have none of the above, no type hints or reader tags. Yet I'm still seeing classfiles for foo.core in the jar products. What might be causing this?

alexmiller 2020-05-24T21:53:59.166100Z

aot compilation is transitive (it kind rides along on loading) so when you require http://foo.core it will be compiled

1
penryu 2020-05-24T22:00:55.167200Z

huh. I was wondering if that was the case, but that implies that once you :aot your -main... anything that -main then relies on is also AOT'd... and I might as well {:aot :all}?

penryu 2020-05-24T22:12:15.169300Z

which is understandable; it just sounds like {:aot :all} is largely implicit in the :main ... directive

penryu 2020-05-24T22:31:50.171100Z

Ah, apparently yes. To paraphrase the FAQ "Q: Is there a way to use an uberjar without AOT?": :uberjar, generally require AOT'ing all the things, unless you want to use clojure.main as the entrypoint and pass your main ns explicitly on the java cmdline

๐Ÿ‘ 1