-
Notifications
You must be signed in to change notification settings - Fork 138
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
Weird import behavior when using stack #612
Comments
There's a relevant IRC conversation here (copied and cleaned up version):
|
Very strange.. These are both GHC errors, and we just pass a few Also, are you using the latest hackage release or master? Thanks! |
Hrm, I can't reproduce this on master or 0.5.0.1.
(My error in |
I was using the latest hackage release (0.5.0.1). It's a shame the What's especially weird is that I can reproduce this in exactly one stack directory. Even copies of that directory don't have the issue. Is there a way I can see what flags are being passed to |
...and the problem was using a |
We don't expose that with a flag, unfortunately, but the options we pass are essentially
Interesting, we link against GHC instead of shelling out to the binary, so this could definitely cause problems if GHC changed something about the I'm not sure what we can do about this issue, maybe the ghc-mod or hdevtools folks have some experience here. Thanks! |
At least for The solution I've found (for both) is to not run EDIT: this doesn't quite work... I have to also install it locally to the sandbox. I've opened a |
I had a feeling this might be the case. Well, at the very least we should (hopefully) be able to check for a ghc-version mismatch and produce a more informative error message. |
@spinda could you investigate what it would take to produce a better error here? What I want to do is basically compare the version of GHC we compiled against to the version that produced the libraries we're loading. I think there's enough metadata around to do this. |
Yes, this should be possible. {-# LANGUAGE CPP #-}
compiledGhcVersion :: String
compiledGhcVersion = VERSION_ghc
getGhcApiVersion :: Ghc String
getGhcApiVersion = projectVersion <$> getSessionDynFlags
isCorrectGhcVersion :: Ghc Bool
isCorrectGhcVersion = (compiledGhcVersion ==) <$> getGhcApiVersion |
@rpglover64 I'm having some trouble reproducing your environment. You built and In that case, I don't understand how LiquidHaskell could end up reading .hi files compiled with ghc-7.10.2. LiquidHaskell would be linked against ghc-7.10.3 and, since LH produces its own copy of the .hi files every execution, it would be ghc-7.10.3 both creating and using in the .hi files, not the ghc-7.10.2 in the project environment. Am I misunderstanding your situation? |
Right.
It doesn't produce .hi files for system libraries like |
To reproduce:
If you'd like more detail on how to get the actual |
I see now. Thanks! So what needs to be checked, I think, is that the GHC version associated with the package DB matches the one we're expecting. |
Consider two simple files in a stack project:
FileA.hs
:FileB.hs
:Running
stack exec -- liquid [...]
gives the following output:As far as I can tell,
liquid
is opening the appropriate interface files (at least according tostrace
), but not using them properly (whatever that means)The text was updated successfully, but these errors were encountered: