Skip to content

Wrong "cabal: Encountered missing or private dependencies" error on sublibraries that start with "z" #7375

Open

Description

@Mikolaj

Describe the bug

As described under "Edit" at #5782 (comment)

Basically, the example should compile fine, just as the version listed before it that differs only in that the main library is changed to private library z, but instead it bugs out with "cabal: Encountered missing or private dependencies".

Activity

  1. fgaz commented on May 1, 2021

    @fgaz
    Member

    Looks like a regression: #6038

    But we have a test for this (#6842), why didn't it fail?

  2. Mikolaj commented on May 1, 2021

    @Mikolaj
    MemberAuthor

    This may be a different bug. In particular, adding an empty main (and so public) library doesn't fix compilation, unlike with the test you mention. Perhaps it's similar, but errors out not when public libraries are absent in the .cabal file, but when they are absent in the build-depends stanza (some private libraries present, but not a single public library from the same package present).

  3. fgaz commented on May 17, 2022

    @fgaz
    Member

    looks like Setup.hs does not have this problem. only cabal-install fails.

    I made a (more) minimal reproducer:

    cabal-version: 2.2
    name: issue5782
    version: 0.1
    build-type: Simple
    
    library a
      hs-source-dirs: .
      build-depends: base
      default-language: Haskell2010
    
    library z
      hs-source-dirs: .
      build-depends: a, base
      default-language: Haskell2010
    
    library c
      hs-source-dirs: .
      build-depends: z, base
      default-language: Haskell2010

    The weird thing is, if you rename "z" into "b"... it works.

    Do stanzas have to be lexicographically ordered now?? Something must be very wrong for this to happen

  4. fgaz commented on May 17, 2022

    @fgaz
    Member

    z

    of course it's the munged package name...

    workaround: don't start the name of your sublibrary with (an arbitrary number of) "z" (unless followed by something other than "z" or "-")

  5. added
    can-workaround
    on May 17, 2022
  6. changed the title [-]Wrong "cabal: Encountered missing or private dependencies" error[/-] [+]Wrong "cabal: Encountered missing or private dependencies" error on sublibraries that start with "z"[/+] on May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cabal-install: othercan-workaroundtype: bugweird bug award

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions