Skip to content

Commit a126106

Browse files
Improve some GHCup errors (#381)
* Improve some GHCup errors * Update message-index/messages/GHCup-00160/index.md Co-authored-by: David Thrane Christiansen <[email protected]> * Update message-index/messages/GHCup-00160/index.md Co-authored-by: David Thrane Christiansen <[email protected]> * Update message-index/messages/GHCup-00160/index.md Co-authored-by: David Thrane Christiansen <[email protected]> * Update message-index/messages/GHCup-05841/index.md Co-authored-by: David Thrane Christiansen <[email protected]> * Make clear that snap/flatpak/appimage are unsupported * Update message-index/messages/GHCup-00160/index.md Co-authored-by: David Thrane Christiansen <[email protected]> * Update message-index/messages/GHCup-00160/index.md --------- Co-authored-by: David Thrane Christiansen <[email protected]>
1 parent 192e995 commit a126106

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

message-index/messages/GHCup-00160/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Potential underlying causes for this errors are:
1313

1414
* No internet connection
1515
* Unreliable disk or Internet leading to a corrupted file
16+
* Non-functional `curl` or `wget` (users have reported difficulties when these tools are installed through [snap](https://snapcraft.io/))
1617
* Malformed metadata file, indicating an issue in the [ghcup-metadata](https://github.com/haskell/ghcup-metadata) repository
1718

1819
As an example with no internet connection, GHCup will fail to list available tools:
@@ -32,22 +33,31 @@ $ ghcup list
3233
[ ... ]
3334
```
3435

36+
If you use `ghcup --metadata-fetching-mode=Strict list`, then you'll likely receive error
37+
[GHCup-05841](https://errors.haskell.org/messages/GHCup-05841/) instead.
38+
3539
The best way to debug this is to try to fetch the metadata manually:
3640

3741
```
42+
cd "$(ghcup whereis cachedir)"
3843
curl https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml
3944
```
4045

4146
Alternatively try with wget:
4247

4348
```
49+
cd "$(ghcup whereis cachedir)"
4450
wget -O- https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml
4551
```
4652

47-
If the download succeeds, but the error persists, try examining the file:
53+
If the download fails, your `curl`/`wget` installation might be broken. On Linux, make sure you've installed
54+
these from your package manager and not via [snap](https://snapcraft.io/), [Flatpak](https://flatpak.org/) or [AppImage](https://appimage.org/). GHCup neither recommends nor supports those tools.
55+
On Windows, make sure you use `curl.exe` and not `curl` (which is a cmdlet) when testing. It should be pre-installed.
56+
57+
If the download succeeds, but the error persists, try examining the file and verify that it's valid YAML:
4858

4959
```
50-
cat $(ghcup whereis cachedir)/ghcup-0.0.7.yaml
60+
cat "$(ghcup whereis cachedir)/ghcup-0.0.7.yaml"
5161
```
5262

5363
Fix your connection issues, make sure to delete `$(ghcup whereis cachedir)/ghcup-0.0.7.yaml` and then try again.

message-index/messages/GHCup-05841/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ $ ghcup install ghc -u https://nothing/ghc.tar.gz 9.4.3
2121
```
2222

2323
This error is a combination of [GHCup-00841](https://errors.haskell.org/messages/GHCup-00841/index.html) and `GHCup-05000`.
24+
Sometimes you may encounter [GHCup-00160](https://errors.haskell.org/messages/GHCup-00160/index.html) instead, depending
25+
on how you invoked `ghcup`.
2426

25-
Reasons for this errors:
27+
Reasons for this error:
2628

2729
* the URL does not point to a valid download (this could be an issue with [GHCup's database of available tools](https://github.com/haskell/ghcup-metadata))
2830
* you have networking issues

0 commit comments

Comments
 (0)