Skip to content

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

Closed

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

Activity

  1. 23Skidoo commented on May 7, 2019

    @23Skidoo
    Member

    Why not just prohibit such packages?

  2. 23Skidoo commented on May 7, 2019

    @23Skidoo
    Member

    (At least for now, the restriction could be relaxed in a later spec version)

  3. fgaz commented on May 7, 2019

    @fgaz
    MemberAuthor

    Good idea! It should be an easy to implement stopgap

  4. added a commit that references this issue on May 13, 2019
    ffaf323
  5. added a commit that references this issue on Nov 21, 2019
    9017952
  6. self-assigned this
    on Nov 22, 2019
  7. added a commit that references this issue on Dec 17, 2019
    3ce10aa
  8. added 4 commits that reference this issue on Jan 20, 2020
    3e8ddf7
    cfb57fc
    b05d3b2
    d59d2b4
  9. added a commit that references this issue on Feb 16, 2020
    bad2208
  10. added a commit that references this issue on Mar 1, 2020
    2dff7ca
  11. added a commit that references this issue on Mar 23, 2020
    bb09dbc
  12. added a commit that references this issue on Apr 6, 2020
    703de47
  13. added a commit that references this issue on Apr 18, 2020
    a4e16b7
  14. added a commit that references this issue on May 9, 2020
    93348de
  15. added a commit that references this issue on May 17, 2020
    a3dbcac
  16. added 2 commits that reference this issue on May 18, 2020
    aa6bcf8
    1fada6e
  17. added a commit that references this issue on May 22, 2020
    a73fa07
  18. added 2 commits that reference this issue on May 24, 2020
  19. added a commit that references this issue on Jun 6, 2026
  20. added a commit that references this issue on Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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