Skip to content

Commit 51858b9

Browse files
hsyl20claude
andcommitted
Docs: recommend installing uplc-ghc via ghcup
The ghcup channel is live and release 9.6.166.1 is published, so replace the 'coming soon' placeholder with the real instructions and make ghcup the recommended install method; building from source stays as the alternative. Point the tutorial and how-to/use at the PATH-installed uplc-ghc and pin the ghc-plinth-plutus commit matching the release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 1b618f6 commit 51858b9

3 files changed

Lines changed: 60 additions & 14 deletions

File tree

how-to/build.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,45 @@ permalink: /how-to/build/
55
This guide explains how to get `uplc-ghc`, the
66
[Plinth standalone compiler]({% link explanation/standalone-compiler.md %}).
77

8+
The recommended way is to [install a released binary via
9+
ghcup](#installing-via-ghcup). [Build from source](#building-from-source) when
10+
you work on the compiler itself, or when no binary distribution covers your
11+
platform.
12+
813
## Installing via ghcup
914

10-
*Coming soon.* Installing `uplc-ghc` through
11-
[ghcup](https://www.haskell.org/ghcup/) &mdash; the standard installer for
12-
Haskell toolchains &mdash; is planned but not yet available. Until then, build
13-
from source as described below.
15+
`uplc-ghc` is distributed as a custom tool named `plinth` for
16+
[ghcup](https://www.haskell.org/ghcup/), the standard installer for Haskell
17+
toolchains. You need ghcup 0.2.1.0 or newer (check with `ghcup --version`).
18+
19+
Add the Plinth release channel, then install and activate the tool:
20+
21+
```console
22+
$ ghcup config add-release-channel https://raw.githubusercontent.com/input-output-hk/ghc-plinth/ghcup-channel/ghcup-plinth.yaml
23+
$ ghcup install plinth latest
24+
$ ghcup set plinth latest
25+
```
26+
27+
`ghcup install` downloads the binary distribution for your platform and
28+
installs it under ghcup's own directory; `ghcup set` then symlinks `uplc-ghc`
29+
into ghcup's `bin` directory (`~/.ghcup/bin` by default), which is already on
30+
`PATH` for ghcup users. Verify with:
31+
32+
```console
33+
$ uplc-ghc --version
34+
```
35+
36+
Installing `plinth` does not affect any GHC installed by ghcup: the tool ships
37+
only the `uplc-*` binaries, so your regular `ghc` is left untouched.
38+
39+
Binary distributions are published for:
40+
41+
- Linux, x86_64 and aarch64 (glibc, and musl/Alpine)
42+
- macOS, Apple Silicon
43+
- Windows, x86_64
44+
45+
List the available versions with `ghcup list -t plinth`. Once installed, head
46+
over to [Use uplc-ghc in a project]({% link how-to/use.md %}).
1447

1548
## Building from source
1649

how-to/use.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,21 @@ title: Use uplc-ghc in a project
33
permalink: /how-to/use/
44
---
55

6-
The recommended way to use the Plinth standalone compiler is to set its path once in `cabal.project`.
6+
The recommended way to use the Plinth standalone compiler is to set it once in
7+
`cabal.project`. If you [installed it via ghcup]({% link how-to/build.md %})
8+
(the recommended way), `uplc-ghc` is on `PATH` and its name alone is enough:
79

810
```haskell
9-
with-compiler: /path/to/uplc-ghc
11+
with-compiler: uplc-ghc
1012
packages: .
1113
```
1214

15+
For a compiler built from source, give the path to the binary instead:
16+
17+
```haskell
18+
with-compiler: /path/to/uplc-ghc
19+
```
20+
1321
The same file also needs the Cardano package repository (CHaP), which provides
1422
the Cardano dependencies of the Plinth libraries:
1523

@@ -41,15 +49,17 @@ are neither bundled with the compiler nor taken from CHaP. Pull them from the
4149
source-repository-package
4250
type: git
4351
location: https://github.com/input-output-hk/ghc-plinth-plutus
44-
tag: 33decd91baf18e76927ffd97a6c3d0ab571bbdb6
52+
tag: 2e582ecde824238f927322d208740322eada8115
4553
subdir: plutus-tx
4654
plutus-core
4755
plutus-tx-plugin
4856
```
4957

5058
Use the `ghc-plinth-plutus` commit that matches your `uplc-ghc`: the compiler
5159
and these libraries are released together as a matched set, built from the same
52-
commit.
60+
commit. The commit above matches release 9.6.166.1 (the current ghcup
61+
`latest`); for a different `uplc-ghc`, use the plutus commit it was built
62+
from.
5363

5464
In addition you may want to add the following `source-repository-package` blocks
5565
that build the C crypto libraries used by Cardano (`libsodium`, `secp256k1`,

tutorials/first-smart-contract.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ later.
1212

1313
## Before you start
1414

15-
You need a built `uplc-ghc`. If you have not built it yet, follow
15+
You need `uplc-ghc` installed. If you do not have it yet, follow
1616
[Install Plinth standalone compiler]({% link how-to/build.md %}) first &mdash;
17-
this tutorial waits for you here. Note where the `uplc-ghc` binary ended up;
18-
throughout this tutorial, replace `/path/to/uplc-ghc` with its actual path.
17+
this tutorial waits for you here. If you installed it via ghcup (the
18+
recommended way), the binary is simply `uplc-ghc` on your `PATH`: wherever
19+
this tutorial says `/path/to/uplc-ghc`, write plain `uplc-ghc` instead. If
20+
you built from source, use the path of the binary the build produced.
1921

2022
You will also need a recent `cabal` (3.8 or newer) on your `PATH`.
2123

@@ -54,7 +56,7 @@ index-state:
5456
source-repository-package
5557
type: git
5658
location: https://github.com/input-output-hk/ghc-plinth-plutus
57-
tag: 33decd91baf18e76927ffd97a6c3d0ab571bbdb6
59+
tag: 2e582ecde824238f927322d208740322eada8115
5860
subdir: plutus-tx
5961
plutus-core
6062
plutus-tx-plugin
@@ -98,8 +100,9 @@ package sodium-clib
98100

99101
Use the `ghc-plinth-plutus` commit that matches your `uplc-ghc`: the compiler and
100102
these libraries are released together as a matched set, built from the same
101-
commit. The commit above matches this guide's compiler; for a different
102-
`uplc-ghc`, use the plutus commit it was built from.
103+
commit. The commit above matches release 9.6.166.1 (the current ghcup
104+
`latest`); for a different `uplc-ghc`, use the plutus commit it was built
105+
from.
103106

104107
**Not for production.** The vendored crypto C libraries pulled in by the
105108
`*-clib` `source-repository-package`s above have not been audited. Use this

0 commit comments

Comments
 (0)