The directory layout of dist-newstyle is utterly broken
I have a package (minimal) with internal library (internal), something like
cabal-version: 3.14
name: minimal
version: 0.1.0.0
...
library internal
...
library
...
(See https://github.com/dschrempf/haddock-issue-minimal)
When I build the package and look the contents of dist-newstyle I see
dist-newstyle/build/x86_64-linux/ghc-9.12.2/internal-0.1.0.0
dist-newstyle/build/x86_64-linux/ghc-9.12.2/minimal-0.1.0.0/build/
dist-newstyle/build/x86_64-linux/ghc-9.12.2/minimal-0.1.0.0/l/internal
Stuff is all over the place. internal library could rewrite a true package with the same name. main libraries and sublibraries are not treated uniformly.
At the very least the dist-newstyle/build/x86_64-linux/ghc-9.12.2/internal-0.1.0.0 should not exist. It's clearly a bug.
At the very least the dist-newstyle/build/x86_64-linux/ghc-9.12.2/internal-0.1.0.0 should not exist. It's clearly a bug.
Is it because another package with library internal could overwrite this directory? If so, let's reproduce that. I wonder when the bug has been introduced --- @geekosaur thinks it may have been relatively recently.