hadrian leaves behind old package config files: ambiguous module name ..., it was found in multiple packages
If we run multiple builds in the same tree, stray package config files from earlier builds can leak into newer builds.
For example running this script:
```
#!/usr/bin/env bash
./boot
./configure
./hadrian/build -j --flavour=release
./hadrian/build -j --flavour=default test
```
results in tests failing with the following errors:
```
[1 of 2] Compiling Main ( ado001.hs, ado001.o )
ado001.hs:1:1: error: [GHC-45102]
Ambiguous module name ‘Prelude’.
it was found in multiple packages: base-4.22.0.0 base-4.22.0.0
ado001.hs:4:1: error: [GHC-45102]
Ambiguous module name ‘Control.Applicative’.
it was found in multiple packages: base-4.22.0.0 base-4.22.0.0
ado001.hs:5:1: error: [GHC-45102]
Ambiguous module name ‘Data.Maybe’.
it was found in multiple packages: base-4.22.0.0 base-4.22.0.0
ado001.hs:6:1: error: [GHC-45102]
Ambiguous module name ‘Text.PrettyPrint’.
it was found in multiple packages: pretty-1.1.3.6 pretty-1.1.3.6
```
We can see what happened if we look at our package database directory:
```
$ ls _build/stage1/lib/package.conf.d/
Cabal-3.16.0.0-4f05.conf
Cabal-3.16.0.0-inplace.conf
Cabal-syntax-3.16.0.0-36da.conf
Cabal-syntax-3.16.0.0-inplace.conf
array-0.5.8.0-ffcf.conf
array-0.5.8.0-inplace.conf
base-4.22.0.0-4e40.conf
base-4.22.0.0-inplace.conf
binary-0.8.9.3-5269.conf
binary-0.8.9.3-inplace.conf
bytestring-0.12.2.0-2138.conf
bytestring-0.12.2.0-inplace.conf
containers-0.8-feff.conf
containers-0.8-inplace.conf
deepseq-1.5.1.0-049c.conf
deepseq-1.5.1.0-inplace.conf
...
```
The `--flavour=default` build produced the _inplace_ `packagename-x.y.z-inplace.conf` files, but the _hashed_ `packagename-x.y.z-XXXX.conf` files from the `--flavour=release` build are also still there! Lots of conflicts ensue.
Hadrian should really ensure that only package config files belonging to the current build are included in the package database.
(before this is fixed, a quick workaround is `rm -r _build/stage1/lib/package.conf.d/`)
issue