Open Kleidukos opened 2 years ago
Note that this generally applies to errors that the user sees when Cabal is compiling multiple components. Even simple errors can be hard to locate in their originating component. A classic example is:
Main.hs:44:70: error:
Not in scope: ‘X’
Which Main.hs
? If you have a few executables or test suites, you might have many!
It would be great if cabal could disambiguate all such errors. The simplest way would be to prefix the name of the component before all output lines from building that component.
Context: When reporting about unused packages, GHC currently doesn't insert any information about the cabal component that is faulty. This results in an unhelpful output when multiple components get caught by the
-Wunused-packages
flag.This is a behaviour that was reported in this GHC ticket, in which @mpickering and @michaelpj gave helpful insights.
In the discussion, @mpickering suggests that GHC could insert Unit IDs in the location part of a diagnostic.
This would make it appear as
and especially notes about unit Ids:
I think this is one case where such a distinction is desired. An optimal output would be: