straight.el
straight.el copied to clipboard
Show better warning when dependency recipe is overridden
We currently have a warning
Two different recipes given for org-noter (:flavor cannot be both melpa and nil)
which is produced when a recipe conflict happens, see #518. However this is not very informative to the end user in the most common case, which is that the package was pulled in as a dependency unbeknownst to them, using the default recipe, and then they try to specify a custom recipe for it. We have the data available to detect when this has happened, so we should use it and display a different warning, like
Custom recipe given for org-noter, but it was already pulled in as a dependency using the default recipe
Is it possible to also specify the package that pulled in the dependency? This would make it easier to rearrange an init file so that the custom recipe is evaluated first.
Yep, sounds like a good idea and simple to implement (the data already exists at the right place as it is used when displaying messages about build system status).
As things stand today, is there any good way to inspect the tree of transitive dependencies? I have no idea which of my packages is pulling in cider via the default recipe.
The only way I know to find it is commenting out packages, which is tedious.
We don't have anything graphical at the moment, but all the needed information is available in the straight--build-cache variable. For example, in mine there's an entry for
"cider"
("2021-05-02 05:30:15"
("emacs" "clojure-mode" "parseedn" "pkg-info" "queue" "spinner" "seq" "sesman")
(:type git :flavor melpa :files
("*.el"
(:exclude ".dir-locals.el")
"cider-pkg.el")
:host github :repo "clojure-emacs/cider" :package "cider" :local-repo "cider"))
which indicates that the cider package has dependencies on all of ("emacs" "clojure-mode" "parseedn" "pkg-info" "queue" "spinner" "seq" "sesman"). In my installation, since cider doesn't appear anywhere else, I know nothing else depends on it. Presumably, in your installation, you'd find a different result.
This variable might be worth mentioning in the README file. I had a hard time finding it.
@jasonhemann the straight-dependents command is available for this now.
Right, we want to avoid documenting such internal variables, and instead we want to provide user-facing commands that have a stable and well-designed API, like the one @progfolio mentioned.
Even better