Release channels (metadata)¶
Release channels (also called distribution channels) are implemented by references to metadata files. These references can be added, or specified, in the following ways (explained further below):
- added at the command line, with the
ghcup config add-release-channelcommand; - specified under the
url-sourcekey in GHCup's YAML configuration file (config.yaml); and - specified at the command line, with GHCup's
--url-sourceoption.
For each relevant tool, the metadata files describe versions of the tool, where to download them, and other information. The files can be viewed here: https://github.com/haskell/ghcup-metadata.
The purpose of each metadata file is described here. These purposes can be combined.
For example, if you want to add access to both 'prerelease' and 'cross' binary distributions, you can command:
ghcup config add-release-channel prereleases
ghcup config add-release-channel cross
Startig with the default, this results in the following configuration in GHCup's YAML configuration file:
url-source:
- GHCupURL # An alias for the base URL that contains all the release bindists
- prereleases
- cross
You can add as many release channels as you like. They are combined such that information in later channels takes precendence over information in earlier ones. In the example above, versions from the 'prerelease' channel overwrite the default ones, if any.
The default specification is:
url-source:
- GHCupURL
To remove all release channels, delete the entire url-source section or set it
to the default.
For further information about possible values of the url-source key, see
this example configuration file:
link.
The possible values include URLs. If you use a URL, you might need to check
whether there are more recent versions of the metadata file. For example
ghcup-0.0.9.yaml may have superceded ghcup-0.0.8.yaml. Old files are not
supported indefinitely, although they are supported for some time.
You can also specify an alternative metadata file at the command line using the
--url-source option, which accepts an alias or a URL. Such a file replaces the
specification in GHCup's YAML configuration file. For example:
ghcup --url-source=prereleases tui
ghcup --url-source=https://some-url/ghcup-0.0.9.yaml tui
Known 3rd-party distribution channels¶
GHCup only supports channels found in: https://github.com/haskell/ghcup-metadata Please do not report bugs for 3rd-party channels.
Below is a list of known 3rd-party channels and evaluation of their stability/quality.
- GHC nightlies
- maintained by GHC HQ
- generated by CI
- not endorsed by GHCup
- frequently outdated
- GHC WASM
- maintained by Cheng Shao
- generated by CI
- not endorsed by GHCup
- is not append-only (old versions are dropped, potentially causing your CI to fail)
Mirrors¶
Metadata files can also be used to operate third party mirrors. However, more recent versions of GHCup allow more sophisticated mirror support - see the section on mirrors (proper) below.
If you do use metafiles for mirroring, you will use a URL instead of the
default GHCupURL alias. For example, in GHCup's YAML configuration file, you
would specify:
url-source:
- https://mirror.sjtu.edu.cn/ghcup/yaml/ghcup/data/ghcup-0.0.9.yaml
Known mirrors¶
Git-based metadata config¶
If you don't like the way ghcup updates its metadata with caching and fetching via curl, you can also do as follows:
Clone the metadata git repo:
mkdir -p /home/user/git/
cd /home/user/git/
git clone -b master https://github.com/haskell/ghcup-metadata.git
Then tell ghcup to use file locations in ~/.ghcup/config.yaml, e.g.:
url-source:
- file:///home/user/git/ghcup-metadata/ghcup-0.0.9.yaml
- file:///home/user/git/ghcup-metadata/ghcup-cross-0.0.9.yaml
- file:///home/user/git/ghcup-metadata/ghcup-prereleases-0.0.9.yaml
Now, if you invoke ghcup tui, it will open instantly without any download, since it just
reads the metadata from local disk.
You'll have to update the metadata manually though, like so:
cd /home/user/git/
git pull --ff-only origin master