Skip to content
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

Show better warning when dependency recipe is overridden #523

Open
raxod502 opened this issue May 9, 2020 · 8 comments
Open

Show better warning when dependency recipe is overridden #523

raxod502 opened this issue May 9, 2020 · 8 comments

Comments

@raxod502
Copy link
Member

raxod502 commented May 9, 2020

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
@matthuszagh
Copy link

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.

@raxod502
Copy link
Member Author

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

@blak3mill3r
Copy link

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.

@raxod502
Copy link
Member Author

raxod502 commented May 2, 2021

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.

@jasonhemann
Copy link

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

@progfolio
Copy link
Contributor

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

@raxod502
Copy link
Member Author

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.

@jasonhemann
Copy link

Even better

debanjum added a commit to debanjum/emacs.d that referenced this issue Jan 20, 2023
- This should remove the two different recipes for elfeed warning
- See for context
  - radian-software/straight.el#518
  - radian-software/straight.el#523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants