-
Notifications
You must be signed in to change notification settings - Fork 63
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
Use the proper GHC version given by cabal #282
Conversation
closes #194 |
b7c6de2
to
428954e
Compare
130e0b2
to
09b10fb
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.
many thanks @fendor and @Kleidukos !
This can be merged, no? It will be included in the next release though |
I am having doubts about the implementation. In particular, I am worried we might break everything irreparable for expert users in non-standard systems. |
Are you thinking in nix, f.e.? what kind of problems could this cause? |
No, I am just thinking of people who supply their libdir path to ghc directly and use a non-expected relative location. We won't find the ghc executable in that case, hie-bios will not find anything, thus, hls will stop working for those people, although the correct So, as a work-around, if we don't find the ghc location, we default to the previous behaviour? Then we only improve the situation for some without destroying it for others? |
well, looking for ghc in path, or even better, ghc-${version} if we can extract the version from EDIT: well the entire fallback could be but we could left ghc-${version} for another pr of course |
I am thinking in a ugly hack:
😆 🤣 |
@fendor could we try to revisit this pr and merge it? I think we have to take a decision about the fallback
I think we could start with this and go ahead |
@jneira Thank you for reminding us of this issue, will spend some brain cells on it! |
As with everything in cabal, doesn't work on first try.
if we haven't invoked Maybe it would make sense to call EDIT:
|
Friendly ping, an user reported this in irc |
ha! it seems
|
It appears this should work fine:
|
94eb273
to
3c5f992
Compare
94eb273
to
859c90c
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.
LGTM, let's push this forward (lol, of course my approval doesn't matter in this case)
withSystemTempDirectory "hie-bios" $ \ tmpDir -> do | ||
let wrapper_hs = cacheDir </> wrapper_name <.> "hs" | ||
let wrapper_hs = wrapper_fp -<.> "hs" | ||
writeFile wrapper_hs wrapperContents | ||
let ghc = (proc mbGhc $ | ||
ghcArgs ++ ["-rtsopts=ignore", "-outputdir", tmpDir, "-o", wrapper_fp, wrapper_hs]) | ||
{ cwd = Just wdir } | ||
readCreateProcess ghc "" >>= putStr |
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.
What is this for, btw?
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.
We basically need a shim for ghc on windows to intercept the ghc arguments cabal would pass to ghc. However, there is no simple shim available, thus we compile a hs file that is the shim.
I find the |
243aa84
to
d440c7d
Compare
@jneira would you mind blow testing whether this works as intended on windows? I tried to come up with some tests, but it complicates CI quite a bit as we have to install two ghc versions, afaict |
oh well, I believe we can drop 8.4.4 support, since we have, afaik, no other consumer than HLS which supports only 8.8.4. So we can even drop support for 8.6.5 as well. |
I am giving a try and i am getting hangs, i am still investigating what could be the cause. Not sure if it would be a local issue. |
hmm hls still supports 8.6.5, no? |
My mistake, don't know why I thought we dropped support |
I think the machinery to accomplish the feature has become complex enough to setup such test, it will be good for all os's. |
d440c7d
to
29c9c8b
Compare
Ok, I wrote a test, windows looks good, only thing missing is dropping 8.4 support. Any objections or other todos? @jneira, @Kleidukos, @hasufell |
Let's go |
54f8fec
to
dbf4476
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.
Sure, great work, congrats all
dbf4476
to
000bf05
Compare
Proof against NoImplicitPrelude fix imports Add ghc-pkg wrapper Add documentation to new functions Construct ghc-pkg name from ghc filename Replace 'ghc' with 'ghc-pkg' in the filename of the ghc executable. This is better than assuming the executable starts with a 'ghc-' prefix, as some distros provide a "triple" for the executable, e.g. 'x86_64-redhat-linux-ghc'. Replacing 'ghc' with 'ghc-pkg' works for these distros as well and, additionally, we don't have to manually take care of the '.exe' suffix. Clear package-env for ghc executable path discovery Refactor 'cabalProcess' function Undo indentation changes and improve naming Remove verbose mode from wrapper
000bf05
to
b3fb774
Compare
WIP with @fendor to use the proper GHC version provided by Cabal instead of using blindingly the one in $PATH.