Skip to content

Support for packages that depend on public sublibraries #5318

Closed
@dcastro

Description

@dcastro

Seems like stack does not currently (v2.3.1) support projects with multiple packages, where:

  • one package exposes multiple public libraries
  • and another package depends on those public sublibraries.

I've create a small repro to show what I'm trying to achieve here (branch: multi-lib).
stack build pkg-b fails with:

stack log

SubLibrary dependency is not supported, this will almost certainly fail
pkg-b> configure (lib)
Configuring pkg-b-0.1.0.0...
Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.3: Encountered missing or private
dependencies:
pkg-a : {pkg-a, pkg-a2} ==0.1.0.0


--  While building package pkg-b-0.1.0.0 using:
      /home/dc/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.3 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0 configure --user --package-db=clear --package-db=global --package-db=/home/dc/.stack/snapshots/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/pkgdb --package-db=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/pkgdb --libdir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/lib --bindir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/bin --datadir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/share --libexecdir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/libexec --sysconfdir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/etc --docdir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/doc/pkg-b-0.1.0.0 --htmldir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/doc/pkg-b-0.1.0.0 --haddockdir=/home/dc/dev/serokell/demo233/.stack-work/install/x86_64-linux-tinfo6/a6119f4790a036ddc181a55d35e8fb09910df5235ac7a59872f78c70ded9011a/8.8.3/doc/pkg-b-0.1.0.0 --dependency=base=base-4.13.0.0 --dependency=pkg-a=pkg-a-0.1.0.0-80giyUDLKHPCSvIpWeSK7i --exact-configuration --ghc-option=-fhide-source-paths
    Process exited with code: ExitFailure 1

I noticed there's an integration test for this, which is expected to fail.

I was wondering if this feature is in the roadmap (short/long-term)?

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