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

Stack ghci on a component of a package does not cause the library component to be built #2790

Open
mgsloan opened this issue Nov 19, 2016 · 2 comments

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Nov 19, 2016

Repro: Run stack ghci :store-test on store (after stack clean)

Result:

store-0.3: configure (lib)
Configuring store-0.3...
store-0.3: initial-build-steps (lib)
The following GHC options are incompatible with GHCi and have not been passed to it: -O2 -threaded
Configuring GHCi with the following packages: store
Using main module: 1. Package `store' component test:store-test with main-is file: /home/mgsloan/fpco/store/test/Spec.hs
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
<command line>: cannot satisfy -package store-0.3
    (use -v for more information)

The issue is that it needs to build the library in order to be able to load these auxiliary components.

For now, the workaround is to either do a stack build first, or load both the library and the component into ghci.

@mgsloan mgsloan added this to the P2: Should milestone Nov 19, 2016
@mgsloan mgsloan changed the title Stack ghci on a component does not cause the library to Stack ghci on a component of a package does not cause the library component to be built Nov 19, 2016
@mgsloan mgsloan modified the milestones: P2: Should, P1: Must Mar 28, 2018
mihaimaruseac added a commit that referenced this issue Jul 28, 2018
This documents the #2790 and #4148 bugs as we decided in #4177 to only
document this behavior for 1.8.1 release and solve them later.
mihaimaruseac added a commit that referenced this issue Jul 28, 2018
This documents the #2790 and #4148 bugs as we decided in #4177 to only
document this behavior for 1.8.1 release and solve them later.
@snoyberg snoyberg modified the milestones: P1: Must, P2: Should Apr 15, 2019
@qrilka
Copy link
Contributor

qrilka commented Jul 16, 2020

I think this was partially fixed by #5306

@mpilgrem
Copy link
Member

mpilgrem commented Apr 1, 2024

This still appears to be an issue with Stack 2.15.5 and store-0.7.18:

> stack unpack store
> cd store-*
> stack init
> stack ide targets
> stack ghci store:test:store-test
...
Configuring GHCi with the following packages: store.
Progress 65/66GHCi, version 9.6.4: https://www.haskell.org/ghc/  :? for help
<command line>: cannot satisfy -package store-0.7.18
    (use -v for more information
> stack build
> stack ghci store:test:store-test
...
<no location info>: error:
    Could not find module ‘Data.StoreSpec’
    Perhaps you meant
      Data.Store (from store-0.7.18)
      Data.Store.TH (from store-0.7.18)
Loaded GHCi configuration from C:\Users\mike\AppData\Local\stack\ghci-script\2b6af032\ghci-script
ghci>

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