-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
HLS fails to run on test-suite #4088
Comments
Hi, thank you for your bug report! This vaguely looks like an issue with your system... Can you try invoking |
Running Accoring to the error the command that fails is:
This command produces the exact error (minus the extra HLS info) as above.
Thus I suspect the issue lies with the hie-bios, and from my shoddy research thus far that is related to HLS (?). |
Yeah |
Here you have an example that doesn't work for me. Its literally just what you get when you run I'll also provide some further context: |
Hmm, personally I think somewhere in the chain my |
Interesting! You can check that by copying the contents of your {
"haskell.serverEnvironment": { "PATH": "path1:path2" }
} |
I had tried that right after my last comment as I happened upon that option. I tried putting |
I added my entire path to As part of my university course I have to grade other peoples projects. I'm not too well versed in the whole haskell toolchain but the process of installing some1 elses cabal project seems too convoluted and has me suspecting my entire toolchain is broken. Basically, I download their package and open the project in vscode. I get a notification that the required HLS version is 1.8.0.0 and that I don't have it installed. I tell the plugin to install this version and after some time it fails at the following step:
Runnin If I manually run the command it my terminal it fails in the same way because I always have the newest recommended ghc version set active. I always presumed cabal was meant to figure this stuff out for you and use the appropriate version anyways? Not that it matters much as I can just manually set the correct version, but because the haskell plugin uses its own active versions of the toolchain it won't help me there. I've had similar problems when doing stuff with stack, although if used it far less so I'm not sure to what degree the issues are actually the same. What tool is most likely the cause? or is it literally just my system being somehow incapable of running haskell normally? |
Regardless of what I do vscode haskell now tries to use base-4.13.0.0. Any way to reset this behavior? |
So what you are encountering is the fact that the version of
Where the third column tells you what version of So, if you have a conflict with the base version, you either need to switch ghc version, or remove the bounds on the However, these last issues are not related to HLS but rather basics and shenanigans of |
Yes, thats also what I figured. |
Well, I got around that by specifying explicitly the version I want to use with: "haskell.toolchain": {
"ghc": "recommended",
"hls": "latest",
"cabal": "latest",
"stack": "latest"
} But now I'm back to not having HLS support on the test-suite... |
Might need to open separate issues for these, but for the case where I try to have the vscode plugin infer the GHC version it fails with the popup Going into the plugin output I find the related debug:
Which is obvious given that the haskell plugin is using ghc-8.8.4 with base-4.13.0.0. Thinking about this a bit more, isn't this a circular dependency within the haskell plugin for vscode? I guess for now I'll use a |
And since I've strayed far from the original issue, here is again the error I get on my test-suite, but not on my library (and I'm pretty sure I also get this on a library + executable):
This seems to fail due to the Not sure if the process environment at the end is supposed to be all variables or just hie-bios related stuff, but if it is printing all then it must be the case that the path variable isn't being carried through properly / being discarded. |
Oh and this is the hie-bios/wrapper-bunchastuff in question: #!/usr/bin/env bash
function out(){
echo "$1" >> "$HIE_BIOS_OUTPUT"
}
if [ "$1" == "--interactive" ]; then
out "$(pwd)"
for arg in "$@"; do
out "$arg"
done
else
"${HIE_BIOS_GHC:-ghc}" "${HIE_BIOS_GHC_ARGS}" "$@"
fi |
So, something is dependant on the |
Full command replacing
|
And with only
|
And finally since its turns out only
It's a lot... |
Yeah, it is supposed to be a lot :) Could you now do the same with the call that works, so |
Here ya go:
|
Hm, unfortunately, can't see what might be going wrong. Could you post what is written in Does the call |
This comment already had the contents of the file. For the command Since then I've moved on to a new assignment from my university, where the issue still persists, so I tried it there too. Here is the output of the command you requested, so it should match with the others I've provided:
|
I asked for the Thanks for the output! Yeah, it is really darn weird only this one invocation seems to be failing. |
Whoops sorry, here it is: #!/bin/sh
exec /home/timo/.ghcup/ghc/9.4.8/lib/ghc-9.4.8/bin/ghc-pkg-9.4.8 --global-package-db /home/timo/.ghcup/ghc/9.4.8/lib/ghc-9.4.8/lib/package.conf.d ${1+"$@"} |
Hm, I am unfortunately out of ideas right now :( |
I don't blame you. Sometimes it just magically starts working if I've built it often enough / restart vscode / whatever I do at the time. Never works straight out of the gate though and it usually doesn't happen for a week minimum. Heck, given when I suddenly am able to do stuff I may even suspect interference from Git... It's just very weird all round. |
Your environment
Which OS do you use?
Ubuntu 22.04
Which version of GHC do you use and how did you install it?
9.4.8 from GHCup
How is your project built (alternative: link to the project)?
Using cabal, a single library and a test-suite.
Which LSP client (editor/plugin) do you use?
VS Code+vscode-haskell
Which version of HLS do you use and how did you install it?
2.5.0.0 from GHCup
Have you configured HLS in any way (especially: a
hie.yaml
file)?Yes and no (neither work)
What's wrong?
Code analysis works fine on my library, but not in my test-suite.
I found some "workarounds" such as:
None of the above seem to solve the error in the debug information part, or result in different issues such as being unable to resolve a build-scheme.
Given what I read in other issues and how long they have been open there won't be a solution soon, so preferably I'd like to know if there is something I haven't tried yet. If not, I'd like to know if it is possible to disable HLS for specific files in my project so I don't get bothered by the error message all the time.
Debug information
The text was updated successfully, but these errors were encountered: