Skip to content
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

ghcup set fails on windows #1215

Open
ryani opened this issue Jan 15, 2025 · 6 comments
Open

ghcup set fails on windows #1215

ryani opened this issue Jan 15, 2025 · 6 comments

Comments

@ryani
Copy link

ryani commented Jan 15, 2025

From ghcup tui, trying to set the ghc version fails:

[ Info  ] This Version of GHC you are trying to set is not installed.
[ ...   ] Would you like to install it first? [Y/N]:
y
[ Info  ] Setting now...
[ Info  ] This Version of GHC you are trying to set is not installed.
[ ...   ] Would you like to install it first? [Y/N]:
y
[ Info  ] Setting now...
[ Info  ] This Version of GHC you are trying to set is not installed.
[ ...   ] Would you like to install it first? [Y/N]:
n
Error: [GHCup-00130] The version 'ghcup' of the tool ghc is not installed.
Press enter to continue

Same GHCup-00130 error from the command line.

History: I had a previous installation of ghcup from a few years back that I tried to upgrade and it had this problem. I ran ghcup nuke, deleted c:\ghc, and reinstalled from the powershell script, and the same problem is still happening.

@ryani
Copy link
Author

ryani commented Jan 15, 2025

  • The version I am trying to set is installed.
  • In fact it's the only version installed, and it is currently the default ghc, although it's not listed as set in the ui
  • But in my old install I was trying to upgrade ghc versions and this prevented me from changing to the new version

@hasufell
Copy link
Member

Is all antivirus disabled?

Are you out of disk space?

@dfordivam
Copy link
Collaborator

Error: [GHCup-00130] The version 'ghcup' of the tool ghc is not installed.

This error is weird, did this happen when doing set from tui ?

This command causes the error, and this is a wrong command.

$ ghcup set ghc ghcup
[ Error ] [GHCup-00130] The version 'ghcup' of the tool ghc is not installed.

Correct one is this

$ ghcup set ghc 9.8.4
[ Info  ] GHC 9.8.4 successfully set as default version

@ryani
Copy link
Author

ryani commented Jan 16, 2025

Yes, I get that either from tui or when doing set from the command line:

>ghcup set ghc 9.4.8
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.9.yaml as file C:\ghc\ghcup\cache\ghcup-0.0.9.yaml
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.12.1'
[ Warn  ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.14.1.1'
[ Info  ] verifying digest of: gs.exe
[ Error ] [GHCup-00130] The version 'ghcup' of the tool ghc is not installed.

I agree that the error is strange.

@ryani
Copy link
Author

ryani commented Jan 16, 2025

Some more info:

ghcup list shows this (as part of its output):

X  ghc   9.4.7      base-4.17.2.0
I  ghc   9.4.8      recommended,base-4.17.2.1 hls-powered
X  ghc   9.6.1      base-4.18.0.0

(I expect this to say IS, that's correct, right?)

where ghc: C:\ghc\ghcup\bin\ghc.exe

ghc --version: The Glorious Glasgow Haskell Compilation System, version 9.4.8

I am pretty sure that if I install another version of ghc that I won't be able to switch to it -- that was the problem that had me reinstall.

@hasufell
Copy link
Member

We test that the optparse behaves correctly:

, ("set ghc 9.2", SetGHCVersion
$ GHCTargetVersion
Nothing
$(versionQ "9.2")
)

So I'm not sure how that would be possible. Did you add or change files? C:\ghc\ghcup is an unusual directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants