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

Improve NoDownload Pretty instance on missing/unknown "mtarget" #960

Merged
merged 2 commits into from
Jan 20, 2024

Conversation

runeksvendsen
Copy link
Collaborator

@runeksvendsen runeksvendsen commented Dec 30, 2023

The guard was only used for the "Perhaps you meant"-part, so include the other part regardless of what mtarget is.

Also: quote the version in the NotInstalled Pretty instance, so it matches that of the NoDownload Pretty instance.

Fixes #957

The guard was only used for the "Perhaps you meant"-part, so include the other part regardless of what `mtarget` is.
@ffaf1
Copy link

ffaf1 commented Dec 30, 2023

Thanks @runeksvendsen! Could you paste some example output?

@hasufell
Copy link
Member

Yeah, example output would be nice, for both cases

@runeksvendsen
Copy link
Collaborator Author

runeksvendsen commented Jan 10, 2024

@hasufell @ffaf1 the new example output is the following. I don't know how to trigger the existing case — any hints @hasufell? EDIT: see below

[nix-shell:~/code/ghcup-hs]$ cabal run exe:ghcup -- install --set cabal latest
[ Warn  ] This is an old-style command for installing GHC. Use 'ghcup install ghc' instead.
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1'
[ Error ] [GHCup-07140] Both installation and setting the tool failed.
[ ...   ] Install error was: Unable to find a download for GHC version 'cabal' on detected platform aarch64-linux-ubuntu-22.04 
[ ...   ] Set error was: The version cabal of the tool ghc is not installed.
[ Error ] Also check the logs in /home/parallels/.ghcup/logs

@ffaf1
Copy link

ffaf1 commented Jan 10, 2024

Excellent. I would add quotes here too

[ ...   ] Set error was: The version cabal of the tool ghc is not installed.

(i.e. [ ... ] Set error was: The version 'cabal' of the tool ghc is not installed.)

@runeksvendsen
Copy link
Collaborator Author

I found out how to trigger the other message:

$ cabal run exe:ghcup -- install cabal-3.10.1.0
[ Warn  ] This is an old-style command for installing GHC. Use 'ghcup install ghc' instead.
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1'
[ Error ] [GHCup-00010] Unable to find a download for GHC version 'cabal-3.10.1.0' on detected platform aarch64-linux-ubuntu-22.04
[ ...   ] Perhaps you meant: 'ghcup <command> cabal 3.10.1.0'
[ Error ] Also check the logs in /home/parallels/.ghcup/logs

Excellent. I would add quotes here too

Done: 6fec9d4

Output:

$ cabal run exe:ghcup -- install --set cabal latest
[ Warn  ] This is an old-style command for installing GHC. Use 'ghcup install ghc' instead.
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml as file /home/parallels/.ghcup/cache/ghcup-0.0.8.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.1'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.13.1'
[ Error ] [GHCup-07140] Both installation and setting the tool failed.
[ ...   ] Install error was: Unable to find a download for GHC version 'cabal' on detected platform aarch64-linux-ubuntu-22.04 
[ ...   ] Set error was: The version 'cabal' of the tool ghc is not installed.
[ Error ] Also check the logs in /home/parallels/.ghcup/logs

@hasufell hasufell merged commit f6cf4cb into master Jan 20, 2024
24 of 26 checks passed
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

Successfully merging this pull request may close these issues.

GHCup old-style command: unclear suggestion on trying to instal cabal
3 participants