Skip to content

-Wunused-packages doesn't display for which component the warning is raised

In a cabal project with several components, the result of -Wunused-packages looks like this:


<no location info>: error: [-Wunused-packages, -Werror=unused-packages]
    The following packages were specified via -package or -package-id flags,
    but were not needed for compilation:
      - postgresql-simple-0.6.4

<no location info>: error: [-Wunused-packages, -Werror=unused-packages]
    The following packages were specified via -package or -package-id flags,
    but were not needed for compilation:
      - tmp-postgres-1.34.1.0
      - aeson-2.0.3.0
      - Cabal-3.6.2.0

Which is fairly confusing.

The output should indicate which component is being talked about.

I am using GHC 8.10.7, and was told that #18567 (closed) had previously raised the issue last year. Is there any plan to backport this fix?

Edited by Matthew Pickering
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information