Stack: GHCi with internal libraries only works after a build

Created on 11 Jul 2018  Â·  15Comments  Â·  Source: commercialhaskell/stack

General summary/comments (optional)

When running stack ghci on a fresh clone of a project having internal libraries, the attempt fails with

<command line>: cannot satisfy -package z-files-z-lib
    (use -v for more information)

However, if one first stack builds then the subsequent stack ghci succeeds.

Found while working on #4142 and will probably work on it in the coming weeks.

Steps to reproduce

  1. Go to the test code in test/integration/tests/3926-ghci-with-sublibraries/files
  2. Run rm -rf .stack-work to start from a clean state
  3. Run stack ghci and see that it fails
  4. Run step 2 again
  5. Run stack build and then stack ghci and it succeeds

Expected

Both step 3 and 5 should succeed.

Actual

Only step 3 succeeded

Stack version

[files] λ stack --version
Version 1.8.0, Git revision bcbfb1e90d1470ed6b9748b79e1655c52fc65b88 (6034 commits) x86_64 hpack-0.28.2

Method of installation

Git clone

ghci bug work-in-progress

All 15 comments

@mihaimaruseac it would be good to get this working _or_ add a note to the docs, before the next release.

I'm travelling at the moment, so won't be able to get it working, most likely. Will come back to this on Friday and do one or the other

Related: #2790 (possibly a duplicate)

Added documentation for this, will try solving it later when I get some time to dwell deep into the code.

I have this problem on 1.9.1 also (just fyi)

It hasn't been fixed — just documented, for now.

Yeah, just wanted to bump this issue. Any idea why it's happening? I'd love to help but I'd need some pointers to have a chance (aside: why are there 'z's interspersed with the internal library name?).

I'm sorry, didn't get a chance to look into this :( Probably I'll get a chance next week or the one after, after HCAR is released.

The z's are just a name mangling scheme.

I get this issue with stack ghci even after nuking .stack-work and then kicking off a stack build.

λ stack --version
Version 1.9.1, Git revision f9d0042c141660e1d38f797e1d426be4a99b2a3c (6168 commits) x86_64 hpack-0.31.0

Seems there has been a regression and now #4564 has the up to date status of this issue

Is anyone else still running into this issue? I think I'm running into something related with stack Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86_64 hpack-0.31.2 LTS 14.7. May open up a separate issue.

@austinvhuang I just ran into this today on a stack version 4 commits after what you have.

@austinvhuang I'm running into this today too; Stack Version 2.1.3 x86_64. Glad I was able to find this ticket, because I thought I was going to have to choose between ghcid and internal libraries; didn't know about the "successful stack build" workaround.

I tried a stack build before stack ghci but am still running into the problem:

<command line>: cannot satisfy -package z-technique-z-technique-internal
    (use -v for more information)

Reopening in this case.

Was this page helpful?
0 / 5 - 0 ratings