Closed tobyclemson closed 2 years ago
I've fixed the double-warning problem.
I don't believe the other one is fixable, unfortunately. In order to find the :parent-dev
profile, we must load the plugins. But we can't load the plugins without resolving the default profile, which includes :dev
. You've created a sort of circular dependency here, and I believe this is just an inherent limitation of the very ideas of profiles and plugins rather than a bug which can be fixed.
Initial debugging steps Before creating a report, especially around exceptions being thrown when running Leiningen, please check if the error still occurs after:
lein upgrade
).~/.lein/profiles.clj
(if present) out of the way. This contains third-party dependencies and plugins that can cause problems inside Leiningen.project.clj
, especially if the problem is with a plugin not working. Old versions of plugins like nREPL and CIDER (as well as others) can cause problems with newer versions of Leiningen.Describe the bug When a default profile is composite with a profile added by middleware, leiningen warns that the profile added by the middleware doesn't exist. For some reason the warning is displayed twice. This warning is displayed despite the fact that the composite profile works as expected after middleware has been applied.
The specific case in which this is affecting me is when using
lein-parent
which merges parts of a parent project.clj into the current project.clj. I've got a:parent-dev
profile which is composed into the current project's:dev
profile. See the reproduction repo for examples.To Reproduce See the minimal reproduction case at https://github.com/tobyclemson/leiningen-warning-repro
To reproduce, run
lein cprint
and observe the following at the top of the output:Actual behavior Leiningen warns about a missing profile that isn't missing. This warning is output twice. Regardless, the profile is merged correctly so the warning doesn't make sense.
Running
lein with-profile +dev cprint
shows that the profiles merge correctly:Expected behavior Ideally, no warnings would print since the profile does exist and the warnings seem to be the result of leiningen's own project evaluation ordering rather than a problem with configuration.
Link to sample project https://github.com/tobyclemson/leiningen-warning-repro
Logs N/A, described above
Environment
Additional context N/A