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: update metadata version to 0.0.9 #271

Merged
merged 18 commits into from
Jan 4, 2025
Merged
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/ghcup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Stackage 源使用。

!!! warning

当前的 GHCup 0.0.8 版本会在安装时也尝试安装 cabal,因此建议在安装 GHCup 前先手动配置 cabal 使用镜像,方法为参考文档 [hackage](https://mirrors.ustc.edu.cn/help/hackage.html#cabal) 中的说明,修改 `~/.cabal/config`。
当前的 GHCup 版本会在安装时也尝试安装 cabal,因此建议在安装 GHCup 前先手动配置 cabal 使用镜像,方法为参考文档 [hackage](https://mirrors.ustc.edu.cn/help/hackage.html#cabal) 中的说明,修改 `~/.cabal/config`。

## 使用方法

参考如下步骤可安装完整的 Haskell 工具链。

!!! note

以下命令会安装并配置 GHCup 0.0.8 版本的元数据。可查看
以下命令会安装并配置 GHCup latest 版本的元数据。可查看
Erchiusx marked this conversation as resolved.
Show resolved Hide resolved
<https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/>
目录的内容,并选择需要安装的 GHCup 版本的 yaml 文件替换以下命令中的
URL。
Expand All @@ -29,21 +29,21 @@ Stackage 源使用。
Linux, FreeBSD, macOS 用户:在终端中运行如下命令:

```bash
curl --proto '=https' --tlsv1.2 -sSf https://mirrors.ustc.edu.cn/ghcup/sh/bootstrap-haskell | BOOTSTRAP_HASKELL_YAML=https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.8.yaml sh
curl --proto '=https' --tlsv1.2 -sSf https://mirrors.ustc.edu.cn/ghcup/sh/bootstrap-haskell | BOOTSTRAP_HASKELL_YAML=https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-latest.yaml sh
```

Windows 用户:以非管理员身份在 PowerShell 中运行如下命令:

```powershell
$env:BOOTSTRAP_HASKELL_YAML = 'https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.8.yaml'
$env:BOOTSTRAP_HASKELL_YAML = 'https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-latest.yaml'
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://mirrors.ustc.edu.cn/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true
```

**第二步** :配置 GHCup 使用科大源。编辑 `~/.ghcup/config.yaml` 增加如下配置:

url-source:
OwnSource:
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.8.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-latest.yaml

**第三步(可选)** :配置 Cabal 和 Stack 使用科大源,请参考文档 [hackage](hackage.md) 和 [stackage](stackage.md)。

Expand All @@ -59,10 +59,10 @@ Ghcup 提供预发布版本(`prereleases`)、交叉编译版本(`cross`)

url-source:
OwnSource:
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.8.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-prereleases-0.0.8.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-cross-0.0.8.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-vanilla-0.0.8.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-latest.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-prereleases-latest.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-cross-latest.yaml
- https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-vanilla-latest.yaml

关于使用 GHCup 安装交叉编译器的说明,请参考 GHCup User Guide 的 [Cross Support](https://www.haskell.org/ghcup/guide/#cross-support) 章节。

Expand Down
Loading