-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Changing cider-injected-middleware-version
will not propagate to 'cider-jack-in-lein-plugins
without emacs restart
#3133
Comments
I think we should simply replace the direct usage of the var |
A straightforward change might be a breaking one. Which might be fine is done carefully. Would be also a good chance to use a more veridic name since |
I've tweaked this minimally for now, but at some point I'll just reap all of this code as it's just ridiculous how |
On second thought - it wasn't particularly hard to decouple |
Hmm, actually this will likely break |
Not sure I follow, Lein plugins aren't just dependencies, they have middleware so they surely deserve a separate type? At this point I'm fine with breakage, but these requirements seem sensible:
|
I meant I removed the usage of |
Basically, we extend the fix for cider-injected-middleware-version and encapsulate the required deps nREPL and cider-nrepl in a reusable function.
Expected behavior
Should update the
cider-jack-in*
command to use version 0.27.4 ofcider/cider-nrepl
.Actual behavior
cider/cider-nrepl
version in generated commandline is unchanged and still "0.28.0". IE:However, if the setq is called prior to cider require, then the value is updated to 0.27.4.
Steps to reproduce the problem
Use the setq above to update cider-injected-middleware at runtime, and then run
cider-jack-in-clj
orcider-jack-in-cljs
. The injected plugins will stay 0.28.0.Workaround Fix
The problem appears to be that
'cider-jack-in-lein-plugins
is updated at top-level during require from the current value ofcider-injected-middleware-version
. This happens atcider/cider.el
Lines 467 to 468 in 8bb6717
Is sufficient to update the injected plugin.
It's not entirely clear to me what the best fix is. Initially I thought it would be easiest to ensure the top level call to cider-jack-in-lein-plugins is calculated as late as possible, but it's used in
cider-jack-in-normalized-lein-plugins
,cider-clojure-cli-jack-in-dependencies
,cider-shadow-cljs-jack-in-dependencies
,cider-jack-in-cljs
andcider-jack-in-clj&cljs
at minimum, so it appears to have a pretty wide surface area.It's also not clear that the
cider-add-to-alist
behavior should be disabled, if'cider-jack-in-lein-plugins
is directly mutated it seems like it should override the value, and I suspect there is .dir-locals or package setup code in the wild doing that.However, it is still confusing to have a specific defcustom that is ignored unless it's at the first require. It breaks the published docs and API, but I think the easiest fix might be to remove the defcustom and document mutating the plugins list directly. Otherwise I think it might require a careful rewrite of the access to
cider-jack-in-lein-plugins
to ensure it can calculate the version at runtime.I also appreciate this is a very edge case error, so maybe it's best just to improve the documentation on it and leave it be for now.
Environment & Version information
CIDER version information
Emacs version
GNU Emacs 29.0.50 (build 14, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-01-16
Operating system
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: