---
synopsis: Attach package name to package warnings
packages: [Cabal]
prs: 12123
---

Expose `labelMessage` from `Distribution.Simple.Utils` and use this to change a
`Warning: ` prefix to a `Warning: package-name ` prefix for warnings about
packages. This is helpful because with interleaved output from the build it was
difficult to associate these warnings with a package.

Here's an example showing that without this fix it was hard to see that the
warning was about the `Cabal-tests` package:

```diff
  Configuring library for solver-benchmarks-3...
  Configuring test suite 'cabal-benchmarks' for cabal-benchmarks-3...
  Configuring test suite 'rpmvercmp' for Cabal-tests-3...
  Configuring test suite 'no-thunks-test' for Cabal-tests-3...
  Configuring library for Cabal-3.17.0.0...
  Configuring library for hackage-security-0.6.3.3...
- Warning: [no-default-language] Packages using 'cabal-version: >= 1.10' and
+ Warning: Cabal-tests [no-default-language] Packages using 'cabal-version: >= 1.10' and
  before 'cabal-version: 3.4' must specify the 'default-language' field for each
  component (e.g. Haskell98 or Haskell2010). If a component uses different
  languages in different modules then list the other ones in the 'other-languages'
  field.
  Preprocessing library for Cabal-3.17.0.0...
  Preprocessing library for solver-benchmarks-3...
  Building library for Cabal-3.17.0.0...
  Preprocessing test suite 'rpmvercmp' for Cabal-tests-3...
  Building library for solver-benchmarks-3...
  Building test suite 'rpmvercmp' for Cabal-tests-3...
  Preprocessing test suite 'no-thunks-test' for Cabal-tests-3...
  Building test suite 'no-thunks-test' for Cabal-tests-3...
  Preprocessing test suite 'cabal-benchmarks' for cabal-benchmarks-3...
  Building test suite 'cabal-benchmarks' for cabal-benchmarks-3...
  Preprocessing library for hackage-security-0.6.3.3...
  Building library for hackage-security-0.6.3.3...
```
