haskell / haskell/cabal

"Dependency on unbuildable library" with three sublibraries

Open
#6,470 5 comments 0 reactions 0 assignees View on GitHub
attention: needs-test type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

For a minimal reproduction of the problem, try using this `demo.cabal` file (no other files required):

```
cabal-version: 3.0

name: demo
version: 0

common all
default-language: Haskell2010
hs-source-dirs: .
build-depends: base

library

library a
import: all
visibility: public
build-depends: demo:b

library b
import: all
visibility: public
build-depends: demo:c

library c
import: all
visibility: public
```

Cabal cannot build this project:

```
$ cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library

$ cabal build
Error:
Dependency on unbuildable library 'b' from demo
In the stanza 'library a'
In the inplace package 'demo-0'
```

It seems to require three sublibraries to reproduce this issue - it is important both that `demo:a` depends on `demo:b`, and that `demo:b` depends on `demo:c`. If we remove either of those `build-depends` lines, the package does build.

The alternative or perhaps further issue here is that the error message does not explain *why* the `demo:b` library is unbuildable. But it seems rather suspicious that the presence of `demo:a` depending on `demo:b` somehow causes `demo:b` to become unbuildable.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.