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

Weeder does not detect redundant build dependecies in common stanzas #52

Open
recursion-ninja opened this issue Apr 5, 2019 · 2 comments

Comments

@recursion-ninja
Copy link

If we have a common stanza in our cabal file that includes a build-depends component with one or more dependencies, and each of the build targets that imports that common stanza does not require one or more of the dependencies listed in the build-depends of the common stanza, then weeder does not report these as redundant dependencies.

Consider the following .cabal file:

name: my-package

common deps

  build-depends: libA, libB

library

  import deps

  [... more stuff here ...]

executable exe

  import deps

  [... more stuff here ...]

If neither the executable exe nor the package library my-package require libA or libB, it would be very helpful for weeder to report libA and libB are redundant dependencies.

This issue is perhaps speculative, as I don't know if it is feasible for weeder to do this.

@recursion-ninja recursion-ninja changed the title Weeder does not detect redundat build dependecies in common stanzas Weeder does not detect redundant build dependecies in common stanzas Apr 5, 2019
@ndmitchell
Copy link
Owner

Weeder predates the common syntax. Certainly easy enough to add - just a patch to https://github.com/ndmitchell/weeder/blob/master/src/Cabal.hs. PR welcome!

I would actually say that anything imported from a common stanza but not used should be considered a weed. Every unused package increases compile time etc, so only shared things should actually be put in common sections.

@ndmitchell
Copy link
Owner

Weeder 2.0 is being developed at https://github.com/ocharles/weeder so I suggest you go see if that fixes your issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants