Skip to content

"Dependency on unbuildable library" with three sublibraries #6470

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

Open
chris-martin opened this issue Dec 31, 2019 · 5 comments
Open

"Dependency on unbuildable library" with three sublibraries #6470

chris-martin opened this issue Dec 31, 2019 · 5 comments

Comments

@chris-martin
Copy link

chris-martin commented Dec 31, 2019

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.

chris-martin added a commit to chris-martin/prosidy-haskell that referenced this issue Dec 31, 2019
@asheshambasta
Copy link

@chris-martin Have you found a workaround? I've also run into this.

@fgaz
Copy link
Member

fgaz commented Aug 8, 2020

For some reason this only seems to happen when using the pkg:lib syntax. The lib syntax works fine. So for now that's a possible workaround (edit: for cabal<3.4, otherwise see below)

@fgaz fgaz added the type: bug label Aug 8, 2020
@fgaz fgaz mentioned this issue Aug 8, 2020
31 tasks
@phadej
Copy link
Collaborator

phadej commented Aug 8, 2020

I cannot reproduce this with cabal-install-3.4.0.0-rc1

@fgaz
Copy link
Member

fgaz commented Aug 8, 2020

Hah, I was just about to suggest that after seeing the changes here! That's great!

@fgaz
Copy link
Member

fgaz commented Dec 15, 2020

@phadej can this be closed or does it need regression tests?

treeowl added a commit to runtimeverification/haskell-backend that referenced this issue Jan 26, 2023
This looks like haskell/cabal#6470
which has (apparantly) been fixed for a while.
treeowl added a commit to runtimeverification/haskell-backend that referenced this issue Jan 26, 2023
This looks like haskell/cabal#6470
which has (apparantly) been fixed for a while.
treeowl added a commit to runtimeverification/haskell-backend that referenced this issue Jan 26, 2023
This looks like haskell/cabal#6470
which has (apparantly) been fixed for a while.
treeowl added a commit to runtimeverification/haskell-backend that referenced this issue Jan 31, 2023
This looks like haskell/cabal#6470
which has (apparantly) been fixed for a while.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants