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

GHCi with internal libraries only works after a build #4148

Open
mihaimaruseac opened this issue Jul 11, 2018 · 15 comments
Open

GHCi with internal libraries only works after a build #4148

mihaimaruseac opened this issue Jul 11, 2018 · 15 comments

Comments

@mihaimaruseac
Copy link
Contributor

@mihaimaruseac mihaimaruseac commented Jul 11, 2018

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

@mihaimaruseac mihaimaruseac self-assigned this Jul 11, 2018
mihaimaruseac added a commit that referenced this issue Jul 11, 2018
mattaudesse added a commit that referenced this issue Jul 14, 2018
Ensure we build before ghci, due to #4148.
@dbaynard dbaynard added this to the P0: Blocking release milestone Jul 18, 2018
@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Jul 18, 2018

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

@mihaimaruseac
Copy link
Contributor Author

@mihaimaruseac mihaimaruseac commented Jul 18, 2018

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

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Jul 21, 2018

Related: #2790 (possibly a duplicate)

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.
@mihaimaruseac
Copy link
Contributor Author

@mihaimaruseac mihaimaruseac commented Jul 28, 2018

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

@adamschoenemann
Copy link

@adamschoenemann adamschoenemann commented Nov 21, 2018

I have this problem on 1.9.1 also (just fyi)

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Nov 21, 2018

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

@adamschoenemann
Copy link

@adamschoenemann adamschoenemann commented Nov 22, 2018

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

@mihaimaruseac
Copy link
Contributor Author

@mihaimaruseac mihaimaruseac commented Nov 26, 2018

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.

@TD5
Copy link

@TD5 TD5 commented Jan 7, 2019

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
@mihaimaruseac
Copy link
Contributor Author

@mihaimaruseac mihaimaruseac commented Feb 5, 2019

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

cimbul added a commit to cimbul/hasklog that referenced this issue Jun 1, 2019
Using an internal library led to an error with "stack ghci" that also affected by IDE. It seems to be related to this stack issue, but wasn't fixed by running "stack build" first:

commercialhaskell/stack#4148
@austinvhuang
Copy link

@austinvhuang austinvhuang commented Dec 1, 2019

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.

@ProofOfKeags
Copy link

@ProofOfKeags ProofOfKeags commented Apr 16, 2020

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

@aryairani
Copy link

@aryairani aryairani commented Apr 17, 2020

@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.

@istathar
Copy link
Contributor

@istathar istathar commented Nov 8, 2020

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)
@mihaimaruseac
Copy link
Contributor Author

@mihaimaruseac mihaimaruseac commented Nov 10, 2020

Reopening in this case.

@mihaimaruseac mihaimaruseac reopened this Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants