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

Support for packages that depend on public sublibraries #5318

Closed
dcastro opened this issue Jun 17, 2020 · 9 comments
Closed

Support for packages that depend on public sublibraries #5318

dcastro opened this issue Jun 17, 2020 · 9 comments

Comments

@dcastro
Copy link

dcastro commented Jun 17, 2020

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

@kk-hainq
Copy link

@snoyberg Is this support desirable for stack? We may be able to work on this if it is.

@snoyberg
Copy link
Contributor

I personally have no use for it, but I’m sure others would be happy with such support.

@kk-hainq
Copy link

I did come from a repository that recently needed this for stack support. I'll see what we can do to tackle this work!

@amigalemming
Copy link

As a first measure it would be great to know which of the dependencies causes the problem.

@brandon-leapyear
Copy link
Contributor

brandon-leapyear commented Dec 20, 2022

This is an old work account. Please reference @brandonchinn178 for all future communication


@amigalemming what do you mean? It seems like the error is just saying that the public sublibraries are "missing"

Encountered missing or private
dependencies:
pkg-a : {pkg-a, pkg-a2} ==0.1.0.0

@kk-hainq @philderbeast What is the status of your PRs? (#5659, #5839) Seems like it's blocked on Stack using Cabal 3.8 itself? @mpilgrem any updates on #5887? Anything I could help with?

@amigalemming
Copy link

@amigalemming what do you mean? It seems like the error is just saying that the public sublibraries are "missing"

Encountered missing or private
dependencies:
pkg-a : {pkg-a, pkg-a2} ==0.1.0.0

That seems to be new.

@brandonchinn178
Copy link

I just copied the message from the issue description

@mpilgrem
Copy link
Member

@brandonchinn178, one of my priorities is moving Stack and its CI to GHC 9.4.3 and Cabal-3.8.1.0. I will return to #5887 soon - I am waiting for GitHub-hosted runners to move from Stack 2.9.1 to Stack 2.9.3 (which version of Stack should be able to build that version of Stack).

@mpilgrem
Copy link
Member

I am going to close this issue as a duplicate of the earlier #5256.

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

7 participants