librelist archives

« back to archive

Re: [leiningen] Leiningen built-in dependencies

Re: [leiningen] Leiningen built-in dependencies

Phil Hagelberg
2013-07-31 @ 16:17
Alex Hall writes:

> 1. The fact that there are additional dependencies specified in :base that
> need to be added to the project classpath in order for certain built-in
> Leiningen features to work implies that these features will no longer work
> if a :base profile in included in project.clj or ~/.lein/profiles.clj. As
> far as I can tell there's nothing to protect from that happening - maybe
> there should be a warning if a user or project attempts to redefine :base?

Yeah, that's a good idea; happy to take a patch for this. We already
emit warnings when a profile is defined both in ~/.lein/profiles.clj as
well as ~/.lein/profiles.d/$PROFILE.clj; so that could be a natural
place to add additional warnings.

> 2. The pom task isn't the only place where dependencies specified by :base
> are user-visible. In particular, these show up in the output from `lein
> deps :tree`. I'm of two minds on this - on the one hand, it is a dependency
> and does get added to a classpath and that's potentially relevant
> information if I'm debugging classpath issues. On the other hand, it's very
> disconcerting as a user to see dependencies show up in my project that I
> didn't specify anywhere in my project.clj or in my user profile. In that
> case, I think it might helpful, and a useful feature in general, for the
> output from the dependency tree to indicate which profile added each
> dependency. Maybe that's a feature request that could be considered for a
> future Leiningen version?

I think this would be pretty tricky to implement, but I'd welcome
someone taking a stab at it.

We used to keep nrepl and clojure-complete in the repl profile and only
merged it during the repl task, but this was much more confusing and
lead to version conflicts that were very difficult to track down.