-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lein 2.8.2 warns about deprecated hook lein-environ.plugin/hooks #88
Comments
I had the same warning with Leiningen 2.8.3 on Java 10.0.2. I've changed the :plugin section to |
@extremus thanks, that works fine in my case too. |
Yes, adding |
@terjedahl is correct. Disabling hooks will stop writing The whole idea of writing to a file which is then consumed by the library is quite brittle. For example I had a lot of headaches when using this with lein-shell plugin. Imagine running a shell script from leiningen which then happens to call some other lein command (you end up with nested lein processes). This way only inner-most process wins writing the file and others get wrong environments depending on who was last writer to the file when they happen to read it. You have to understand implementation details of this plugin to see what went wrong. I would recommend opening a PR in leiningen itself and implement independent support for ENV variables there. Dynamic |
If anyone can come up with a better implementation for passing the environment data from the Leiningen project to the application process, I'd welcome a PR. |
One workaround could be to replace the hook-mechanism with a middleware mechanism. Another solution might be to simply have it hook in via the |
This is admittedly an idle thought, but figwheel seems to be able to pull information out of the project.clj without the need for the hooks mechanism. I wonder if a similar approach can be adopted here. Unless anybody tells me i'm crazy, i'll keep the warning in my project as a reminder to take a look as soon as I can. |
I was thinking along similar lines as you @wesleyhall: As |
I did take a very quick look into this last night and Bruce @ Figwheel actually has this little project: https://github.com/bhauman/simple-lein-profile-merge He doesn't seem particularly enthusiastic about it being ready for wider adoption, but it is out there. |
I just spent a couple days learning way more than I ever wanted to about lein and environ, because I thought I was helping myself by silencing the "Warning: implicit hook found" message. Oops. In the short term, how do you feel about a note in the README that warns idiots like me not to use |
There seems to be two issues under discussion here. One is about avoiding the Leiningen implicit hooks warning (but keeping the brittle On the first question of implicit hooks alone:
|
Hooks in general are scheduled to be removed in a future release of Leiningen. Anything that keeps using hooks is NG. This leaves us with the |
After upgrading from lein 2.8.1 to 2.8.2:
The text was updated successfully, but these errors were encountered: