Skip to content

stack ghci can't load package defined in internal-libraries #6214

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

Closed
karamellpelle opened this issue Aug 19, 2023 · 3 comments
Closed

stack ghci can't load package defined in internal-libraries #6214

karamellpelle opened this issue Aug 19, 2023 · 3 comments

Comments

@karamellpelle
Copy link

General summary/comments (optional)

stack ghci fails when I create an internal library in package.yaml (Hpack has a top level field internal-libraries which creates internal libraries). stack build goes fine, however.

Steps to reproduce

  1. stack new test-internal
  2. Change package.yaml, from
library:
  source-dirs: src

into

internal-libraries:
  myinternal:
    source-dirs: src

and updating the dependencies

    dependencies:
    #- test-internal
    - myinternal

Expected

I expected ghci to load the project in the same way as it builds.

Actual

stack ghci quits because: <command line>: cannot satisfy -package z-test-internal-z-myinternal. Verbose output is

2023-08-19 17:08:26.878756: [debug] Run process within /Users/karamellpelle/Source/tmp/test-internal/: /Users/karamellpelle/.stack/programs/x86_64-osx/ghc-9.4.5/bin/ghc-9.4.5 --interactive -i -odir=/Users/karamellpelle/Source/tmp/test-internal/.stack-work/odir -hidir=/Users/karamellpelle/Source/tmp/test-internal/.stack-work/odir -hide-all-packages -XHaskell2010 -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/myinternal -i/Users/karamellpelle/Source/tmp/test-internal/src -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/myinternal/autogen -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/global-autogen -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/myinternal/myinternal-tmp -stubdir=/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build -package=z-test-internal-z-myinternal -package-id=base-4.17.1.0 -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/test-internal-exe -i/Users/karamellpelle/Source/tmp/test-internal/app -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/test-internal-exe/autogen -i/Users/karamellpelle/Source/tmp/test-internal/.stack-work/dist/x86_64-osx/Cabal-3.8.1.0/build/test-internal-exe/test-internal-exe-tmp -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -rtsopts -with-rtsopts=-N -optP-include -optP/Users/karamellpelle/Source/tmp/test-internal/.stack-work/ghci/374157a2/cabal_macros.h -ghci-script=/Users/karamellpelle/.cache/stack/ghci-script/08631029/ghci-script
GHCi, version 9.4.5: https://www.haskell.org/ghc/  :? for help
<command line>: cannot satisfy -package z-test-internal-z-myinternal
    (use -v for more information)

Stack version

stack --version
Version 2.11.1, Git revision c1167a6abc3f4978ccded5ba0246a57387da0e2f x86_64 hpack-0.35.2

Method of installation

Homebrew

Platform

macOS Catalina 10.15.7

@mihaimaruseac
Copy link
Contributor

This is #4148 but it's not simple to solve sadly.

@karamellpelle
Copy link
Author

OK! I searched for an issue with internal-libraries but couldn't find one.

@mpilgrem
Copy link
Member

mpilgrem commented Sep 3, 2023

I am going to close this issue as the problem is covered by #4148 (stack ghci/repl with internal sublibraries only works after a build).

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

3 participants