Skip to content

cabal-install: cannot depend on public sublibrary when the package does not contain a main library too #6038

Closed
@fgaz

Description

@fgaz

Repro:

cabal.project:

packages: d, p

d.cabal:

cabal-version: 3.0
name: d
version: 0.1.0.0

library sublib
  visibility: public
  default-language: Haskell2010

p.cabal:

cabal-version: 3.0
name: p
version: 0.1.0.0

library
  build-depends: d:sublib
  default-language: Haskell2010

cabal v2-build p output:

cabal: Could not resolve dependencies:
[__0] trying: d-0.1.0.0 (user goal)
[__1] next goal: p (user goal)
[__1] rejecting: p-0.1.0.0 (requires library from d, but the component does
not exist)
[__1] fail (backjumping, conflict set: d, p)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: d, p

Adding an empty main library to d fixes it.:w

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