Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mikolaj opened this issue May 1, 2021 · 4 comments
Labels
cabal-install: other can-workaround There is a (maybe partial) workaround for the issue or missing feature type: bug weird bug award

Comments

@Mikolaj
Copy link
Member

Mikolaj commented May 1, 2021

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".

@fgaz
Copy link
Member

fgaz commented May 1, 2021

Looks like a regression: #6038

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

@fgaz fgaz added the type: bug label May 1, 2021
@Mikolaj
Copy link
Member Author

Mikolaj commented May 1, 2021

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).

@fgaz
Copy link
Member

fgaz commented May 17, 2022

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

@fgaz
Copy link
Member

fgaz commented May 17, 2022

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 "-")

@fgaz fgaz added the can-workaround There is a (maybe partial) workaround for the issue or missing feature label May 17, 2022
@fgaz fgaz 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" May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal-install: other can-workaround There is a (maybe partial) workaround for the issue or missing feature type: bug weird bug award
Projects
None yet
Development

No branches or pull requests

2 participants