-
Notifications
You must be signed in to change notification settings - Fork 151
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
Straight doesn't reload a versioned dependency if an older version of the dependency is already loaded #822
Comments
If I understand correctly, the proper version of map is cloned and built. Bufler is compiled in a child Emacs process with this (correct) version of map. However, an older version of map is loaded prior to bufler being loaded. I'll have to think on this to see if there's a good solution we can implement. (unload-feature 'map t)
(straight-use-package 'bufler) This way the proper version of map should be on the load-path for whoever requires map next. (define-advice require (:before (&rest args) "bufler-reload-map.el")
(when (and (eq (car args) 'bufler)
(featurep 'map))
(unload-feature 'map t))) Again, not a great solution because we pay the penalty of that check for every call to |
Yes, this works
It lets me keep the special handling for map close to the bufler section of my init.el. Thanks! It is feasible for straight to warn about this sort of situation? "Oh, package |
Glad that works for you.
I will look into implementing something like this. |
Oh no, that's terrible! I hoped something like this wouldn't happen. See #236 for previous discussion of the problem of built-in packages. The thing that's new here is that I rather want to avoid bringing version numbers into it, though. For the last four and a half years, |
Not to tell you what to do, but I think that would be going too far--if for no other reason than that it's not the only package of mine that requires I don't know exactly how well |
Oh, sorry, when I said "special-casing it to happen automatically for this specific package", by "this specific package" I meant map.el, not your bufler package that depends on map.el :) |
What's wrong
The
bufler
package (https://github.com/alphapapa/bufler.el) depends on version 2.1 (or higher) ofmap
. My emacs, v27.2, ships with v 2.0 ofmap
. Straight correctly resolvesbufler
's dependency and clonesmap
from the ELPA mirror, butmap
is loaded by several other packages and, if one of these is loaded beforebufler
, the built-in version ofmap
is loaded before straight can update the load-path.M-x emacs-version
: GNU Emacs 27.2 (build 1, x86_64-apple-darwin19.6.0, Carbon Version 162 AppKit 1894.6) of 2021-03-27M-x straight-version
: prerelease (HEAD -> develop, origin/develop) 72a1ce9 2021-07-06Directions to reproduce
I have not been able to reproduce cleanly with
straight-bug-report
because its machinery itself triggers a "too-early" loading ofmap
, apparently via agnutls
>network-stream
>nsm
>map
dependency chain. Here is a~/.emacs.d/init.el
file that demonstrates the issue against an otherwise empty~/.emacs.d
:Now execute
M-x bufler
to see the errorSymbol's value as variable is void: max-width
.Loading
json
triggers Emacs to load the built-in version ofmap
, which defeats straight's efforts to add to load-path the version it installs from the ELPA mirror on the next line. Sobufler
gets v2.0 ofmap
and fails.This problem can be avoided by telling straight about map before anything else tries to load it. This works as
~/.emacs.d/init.el
once straight has been bootstrapped:and now
M-x bufler
works. This what I am doing now in my realinit.el
. But note that straight's bootstrapping code itself loadsmap
and so this approach doesn't work in a completely clean environment.It would be nice if straight noticed that the wrong version of
map
is loaded when it is handlingbufler
and reloaded the right version. I don't know if this is a reasonable expectation of straight.Version information
The text was updated successfully, but these errors were encountered: