-
-
Notifications
You must be signed in to change notification settings - Fork 389
Improve wrapper cradle errors #2711
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
Conversation
@jhrcek build via:
|
Thank you @hasufell , you're really fast! I'm getting this error:
|
Uh... can you run
inside your project? What if you run it outside of your project? Is What are the contents of |
Yeah, pretty sure it's
|
Outside of any project it works fine
within our work codebase it doesn't: ~/Devel/github.com/Holmusk/PI/backend> stack exec ghc -- -v0 -package-env=- -e "putStr =<< System.Environment.getExecutablePath"
<interactive>:0:1: error: Variable not in scope: putStr
<interactive>:0:8: error:
Variable not in scope:
(=<<) :: t0 -> GHC.Types.IO GHC.IO.FilePath -> t Indeed we are using NoImplicitPrelude 😄 |
Ok, I'll push a fix to this PR. |
@jhrcek please try again |
I should mention that we're using Relude + base-noprelude, basically setup described here |
I wonder if it woulndn't be maybe easier to do
and then strip the quotes? Or alternatively use |
|
That works ok
|
bc909bc
to
5168f1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for quick response. Works for me 👍
5168f1a
to
887d32d
Compare
@@ -114,13 +114,21 @@ launchHaskellLanguageServer parsedArgs = do | |||
callProcess e args | |||
#else | |||
let Cradle { cradleOptsProg = CradleAction { runGhcCmd } } = cradle | |||
(CradleSuccess ghcBinary) <- fmap trim <$> runGhcCmd ["-v0", "-package-env=-", "-e", "putStr =<< System.Environment.getExecutablePath"] | |||
(CradleSuccess libdir) <- HieBios.getRuntimeGhcLibDir cradle | |||
ghcBinary <- (fmap trim <$> runGhcCmd ["-v0", "-package-env=-", "-e", "do e <- System.Environment.getExecutablePath ; System.IO.putStr e"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth a comment, very non-obvious that you're doing it this way to be compatible with NoImplicitPrelude
.
Also, this probably won't work with RebindableSyntax
still, but surely nobody sets that globally...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RebindableSyntax
oh dear...
887d32d
to
9bb9087
Compare
@jhrcek
wrt #2675 (comment)