-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add ghcup to PATH automatically #962
Comments
How do we probe for ghcup? We can guess all the locations ghcup installs itself into when installed via curl. |
We try to invoke it directly. If that works, then we run If that doesn't work, we follow this logic to guess the ghcup basedir: https://github.com/haskell/ghcup-hs/blob/371eda962f713fe483616310291004a82e5b029d/lib/GHCup/Utils/Dirs.hs#L202 Then check if a ghcup binary is in the |
Doesn't that only work if it already is on the PATH? The rest of the implementation roadmap looks sensible. |
Yes, but it might be in |
Right, but if ghcup is on the PATH, then the extension will find it and ghcup works as expected. Or is the point to unconditionally add ghcup bindir to the PATH via serverEnvironment? |
We probably should, since vscode-haskell/src/hlsBinaries.ts Line 552 in aef73c2
However, we need to make sure this doesn't take precedence over other user configurations, so I'm wondering if we should append to PATH, just in case of weird shenanigans (like someone putting ghcup binary into a custom dir and adding that via haskell.serverEnvironment to the PATH... then we don't want to overrule it). |
Although that case is fine, since we'll find the binary there anyway and won't guess the ghcup bindir. Still think it's safer to append. |
Hm, but if we append, |
Yeah, I guess most conservative method is to do nothing if we find a |
Actually we don't need to touch PATH at all, since we're only interested in the binary: #963 |
Do we want to make a release? |
Ideally, we have some more manual tests. But yes, there is no big change expected in the near future, might as well release this week. |
I haven't followed this thread, but our master branch has a bunch of unrelated error messages introduced by hls-cabal-plugin, not sure if it has been fixed. See release note https://github.com/haskell/vscode-haskell/releases/tag/2.5.0 |
https://discourse.haskell.org/t/haskell-and-vs-code-issues/7663
Comes up very frequently. The extension can probe for ghcup and if it's not in PATH, suggest to add it via
haskell.serverEnvironment
.@fendor
The text was updated successfully, but these errors were encountered: