Unused modules incorrectly flagged on re-exports
Describe the bug
If you add build-depends
on a library that only contains re-exports, the -Wunused-packages
warning triggers.
To Reproduce
- Define a module in an internal library component
- Re-export the module in the library component.
- Add the library component to a
build-depends
of an executable component. - Use the module from an executable component.
- Enable
-Wunused-packages
and-Werror
on the executable component. - Build the project.
The build fails.
Expected behavior The build should succeed.
System information
cabal-3.4.0.0
, ghc-8.10.4
Additional context N/A
Originally reported here: https://github.com/haskell/cabal/issues/7357
See the original ticket for example.