haskell / haskell/cabal

The directory layout of dist-newstyle is utterly broken

Open
#11,236 1 comment 0 reactions 0 assignees View on GitHub
Cabal: cmd/build type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I have a package (`minimal`) with internal library (`internal`), something like

```cabal
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.

Contributor guide

Open the contributing guide

Research direction

Start with the linked haddock-issue-minimal reproduction and inspect the dist-newstyle tree produced for its internal and main libraries. No source file or test is named in the issue; done means the internal library no longer creates the unexpected top-level path and main libraries and sublibraries use a consistent layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.