Fork me on GitHub

I have an exciting thing happening with a plugin I've wittled it down to a pretty basic setup where there's a plugin ns with a hooks function that adds an empty-function-hook to an empty task in another ns i.e., there's no functionality here, other than adding an empty hook to an empty task that never gets run the symptom is that lein check works fine but lein with-profiles -dev check throws an NPE note there is no dev profile, so it should be a NOOP; adding an empty dev profile doesn't change anything also lein with-profiles -somethingelse check also fails


seems like the hooks metadata got removed from some var (presumably the task being hooked, which never gets called?); very strange


@gfredericks I don’t have any great insight there. The only thought that sprung to mind was that lein check does a clojure.core/load on namespaces given for the “classpath” in question. That is a forceful reload of namespaces that could perhaps wipe out something like var metadata. However, I don’t see any reason that’d cause the problem you see (I don’t get how the metadata would be removed from the relevant vars in this situation). One way to troubleshot it may be to run it against your own modified leiningen or robert.hooke, where you add a print for the var that is being deref’ed for metadata prior to the NPE. May help.


👍 I'll poke around


the NPE is happening in a finally, so I guess it could be masking a real exception


what's the easiest way to experiment with the installed leiningen? e.g., how could I get a user.clj onto lein's classpath so I could do some monkeypatching?


@gfredericks I’d typically just checkout the leiningen from github, use the tag for whatever release version you are interested in (if it matters).



git clone <leiningen-path>
cd leiningen
lein repl ;; or whatever you like to do for a repl, cider-jack-in etc