cabal icon indicating copy to clipboard operation
cabal copied to clipboard

The directory layout of dist-newstyle is utterly broken

Open phadej opened this issue 3 months ago • 1 comments

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.

phadej avatar Oct 02 '25 16:10 phadej

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.

Mikolaj avatar Oct 09 '25 17:10 Mikolaj