Skip to content

"Dependency on unbuildable library" with three sublibraries #6470

Open
@chris-martin

Description

@chris-martin

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions