tools-build

2023-04-11T14:07:28.286369Z

hi everybody! I noticed when I build a jar it is always adding a dependency on clojure on my pom. Looks like this is because create-basis always returns clojure as a dependency I guess because it is on the default deps.edn. Is this a desired default behavior? I guess I could remove it from the basis before calling write-pom but I feel I'm missing something

Alex Miller (Clojure team) 2023-04-11T14:28:17.702529Z

is it not a Clojure project?

Alex Miller (Clojure team) 2023-04-11T14:29:06.280769Z

I think you can set org.clojure/clojure nil in the :extra passed to create-basis if you want to omit it

borkdude 2023-04-11T14:31:25.323189Z

Also :classpath-overrides should work, like we discussed last time

2023-04-11T14:33:00.072459Z

yeah, it is a Clojure project, I just saw when testing something on lein that my library was providing a version of clojure that was replacing the version there, and I was curious why it was the case

2023-04-11T14:35:53.294419Z

so, as library authors what are best practices for packaging libraries? since by default it will include a dependency on your dev clojure version I guess, which will then overwrite users one?

borkdude 2023-04-11T14:36:44.566939Z

Just specify the lowest clojure version you depend on?

Alex Miller (Clojure team) 2023-04-11T14:37:04.419729Z

well, the opposite of that - the user presumably defines their own clojure version at top level and that controls

Alex Miller (Clojure team) 2023-04-11T14:38:30.030669Z

many libs do specify a minimum version, but that's more informational than useful in practice

Alex Miller (Clojure team) 2023-04-11T14:41:04.645799Z

Rich has argued that Clojure libs should treat Clojure itself as a "provided" (undeclared) dependency. I personally find that often to be tedious because you need to specify extra stuff to test or dev. In practice, the user using a lib has the actual say, so it doesn't actually matter, because top-level lib versions always win

2023-04-11T14:43:37.015029Z

great, thanks! first time I'm thinking about this stuff a little deeper since I'm working in this clojure dev compiler that I swap on dev over the official one, but no problem since the user can remove the org.clojure/clojure in deps and lein