straight.el icon indicating copy to clipboard operation
straight.el copied to clipboard

Show better warning when dependency recipe is overridden

Open raxod502 opened this issue 5 years ago • 8 comments

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

raxod502 avatar May 09 '20 15:05 raxod502

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.

matthuszagh avatar Sep 24 '20 02:09 matthuszagh

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).

raxod502 avatar Sep 24 '20 13:09 raxod502

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.

blak3mill3r avatar May 01 '21 00:05 blak3mill3r

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.

raxod502 avatar May 02 '21 13:05 raxod502

This variable might be worth mentioning in the README file. I had a hard time finding it.

jasonhemann avatar May 16 '22 00:05 jasonhemann

@jasonhemann the straight-dependents command is available for this now.

progfolio avatar May 16 '22 00:05 progfolio

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.

raxod502 avatar May 16 '22 04:05 raxod502

Even better

jasonhemann avatar May 16 '22 09:05 jasonhemann