Skip to content

"Error: Dependency on unbuildable library" with three internal libraries and --enable-multi-repl #10775

Closed
@nspin

Description

@nspin

Describe the bug

Given three internal libraries x, y, and z, where z depends on both x and y, cabal repl --enable-multi-repl x z fails with:

Error: Dependency on unbuildable library 'x' from foo

Modifying y to depend on x causes that cabal repl invocation to succeed.

Here is a concrete foo.cabal to demonstrate:

cabal-version: 3.14

name:           foo
version:        0.1.0.0
build-type:     Simple

library x
  exposed-modules:
      X
  hs-source-dirs:
      components/x
  build-depends:
      base

library y
  exposed-modules:
      Y
  hs-source-dirs:
      components/y
  build-depends:
      base
    -- uncommenting this causes 'cabal repl --enable-multi-repl x z`' to succeed
    -- , foo:x

library z
  exposed-modules:
      Z
  hs-source-dirs:
      components/z
  build-depends:
      base
    , foo:x
    , foo:y

To Reproduce

Run cabal repl --enable-multi-repl x z with the above foo.cabal file.

I've created a repository at https://github.com/nspin/cabal-multi-repl-bug-repro with all the necessary files, instructions, and a Nix shell.

Expected behavior

I would expect this cabal repl invocation to succeed.

System information

  • Operating system: NixOS
  • cabal, ghc versions: cabal version 3.14.1.0, ghc version 9.8.4

Additional context

Could be related to #6470 from 2019.

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