Skip to content

Commit 8908dff

Browse files
hsyl20claude
andcommitted
Docs: split the install and build-from-source guides
The install page (/how-to/install/) now covers only the recommended ghcup route; building from source moves to its own page. The source-build page keeps the /how-to/build/ permalink so existing deep links (notably #test-and-benchmark) stay valid. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 51858b9 commit 8908dff

9 files changed

Lines changed: 70 additions & 56 deletions

File tree

_data/navigation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ docs:
5050
url: /how-to/
5151
children:
5252
- title: Install Plinth standalone compiler
53+
url: /how-to/install/
54+
- title: Build Plinth from source
5355
url: /how-to/build/
5456
- title: Use uplc-ghc in a project
5557
url: /how-to/use/

explanation/standalone-compiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ GHC, brings several benefits:
4444
Pinning the plugin to a specific GHC build keeps compiler and plugin in
4545
lockstep, which makes the generated Plutus Core reproducible and lets the whole
4646
thing be validated as a single unit (see the test and benchmark scripts in
47-
[Install Plinth standalone compiler]({% link how-to/build.md %}#test-and-benchmark)).
47+
[Build Plinth from source]({% link how-to/build.md %}#test-and-benchmark)).
4848

4949
## Further reading
5050

how-to/build.md

Lines changed: 13 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,16 @@
11
---
2-
title: Install Plinth standalone compiler
2+
title: Build Plinth from source
33
permalink: /how-to/build/
44
---
5-
This guide explains how to get `uplc-ghc`, the
6-
[Plinth standalone compiler]({% link explanation/standalone-compiler.md %}).
5+
This guide explains how to build `uplc-ghc`, the
6+
[Plinth standalone compiler]({% link explanation/standalone-compiler.md %}),
7+
from source. Most users do not need this: the recommended way to get
8+
`uplc-ghc` is to
9+
[install a released binary via ghcup]({% link how-to/install.md %}). Build
10+
from source when you work on the compiler itself, or when no binary
11+
distribution covers your platform.
712

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-
13-
## Installing via ghcup
14-
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 %}).
47-
48-
## Building from source
49-
50-
### Prerequisites
13+
## Prerequisites
5114

5215
`plinth-build.sh` expects the following tools on `PATH`:
5316

@@ -64,7 +27,7 @@ over to [Use uplc-ghc in a project]({% link how-to/use.md %}).
6427
`happy` and `alex` are built locally into `_build/tools/` if they are not
6528
found, so they are effectively optional. The others must be present.
6629

67-
### 1. Clone with submodules
30+
## 1. Clone with submodules
6831

6932
The `plutus` submodule provides `plutus-tx`, `plutus-tx-plugin`, and
7033
`plutus-core`, so clone recursively:
@@ -79,7 +42,7 @@ If you already cloned without `--recurse-submodules`, fetch them with:
7942
$ git submodule update --init --recursive
8043
```
8144

82-
### 2. Run the build script
45+
## 2. Run the build script
8346

8447
From the root of the repository:
8548

@@ -90,7 +53,7 @@ $ ./plinth-build.sh
9053
The script bootstraps GHC and then builds `uplc-ghc`. What it produces is
9154
described under [Build outputs](#build-outputs) below.
9255

93-
### Build options
56+
## Build options
9457

9558
`plinth-build.sh` is controlled by environment variables. The two most common
9659
force a full rebuild or select the release flavour:
@@ -110,7 +73,7 @@ It also honours tool-location overrides such as `GHC`, `CABAL`, `HAPPY`,
11073
`FLAVOUR`, when you need to point it at specific tools or change the build
11174
flavour.
11275

113-
### Build outputs
76+
## Build outputs
11477

11578
When `plinth-build.sh` finishes it has produced two things.
11679

how-to/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ permalink: /how-to/
55
*Task-oriented recipes.* Each guide assumes you already know the basics and
66
shows the steps to get one specific job done.
77

8-
- [Install Plinth standalone compiler]({% link how-to/build.md %})
8+
- [Install Plinth standalone compiler]({% link how-to/install.md %})
9+
- [Build Plinth from source]({% link how-to/build.md %})
910
- [Use uplc-ghc in a project]({% link how-to/use.md %})
1011
- [Generate a blueprint]({% link how-to/generate-blueprint.md %})
1112
- [Test a Plinth contract locally]({% link how-to/test.md %})

how-to/install.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Install Plinth standalone compiler
3+
permalink: /how-to/install/
4+
---
5+
`uplc-ghc`, the
6+
[Plinth standalone compiler]({% link explanation/standalone-compiler.md %}),
7+
is distributed as a custom tool named `plinth` for
8+
[ghcup](https://www.haskell.org/ghcup/), the standard installer for Haskell
9+
toolchains. Installing it via ghcup, as described here, is the recommended way
10+
to get it. To work on the compiler itself, or when no binary distribution
11+
covers your platform, [build it from source]({% link how-to/build.md %})
12+
instead.
13+
14+
## Install via ghcup
15+
16+
You need ghcup 0.2.1.0 or newer (check with `ghcup --version`). Add the Plinth
17+
release channel, then install and activate the tool:
18+
19+
```console
20+
$ ghcup config add-release-channel https://raw.githubusercontent.com/input-output-hk/ghc-plinth/ghcup-channel/ghcup-plinth.yaml
21+
$ ghcup install plinth latest
22+
$ ghcup set plinth latest
23+
```
24+
25+
`ghcup install` downloads the binary distribution for your platform and
26+
installs it under ghcup's own directory; `ghcup set` then symlinks `uplc-ghc`
27+
into ghcup's `bin` directory (`~/.ghcup/bin` by default), which is already on
28+
`PATH` for ghcup users. Verify with:
29+
30+
```console
31+
$ uplc-ghc --version
32+
```
33+
34+
Installing `plinth` does not affect any GHC installed by ghcup: the tool ships
35+
only the `uplc-*` binaries, so your regular `ghc` is left untouched.
36+
37+
## Supported platforms
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`.
46+
47+
Once installed, head over to
48+
[Use uplc-ghc in a project]({% link how-to/use.md %}).

how-to/test.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ experimentation, not production.
190190
`unsafeApplyCode`.
191191
- [How smart contracts run: Plutus Core and the CEK machine]({% link explanation/plutus-core.md %})
192192
&mdash; why off-chain evaluation and costing are faithful to the chain.
193-
- [Install Plinth standalone compiler]({% link how-to/build.md %}) &mdash; the
193+
- [Build Plinth from source]({% link how-to/build.md %}) &mdash; the
194194
tasty/golden test mechanism the compiler's own suites use.
195195
- [Generate a blueprint]({% link how-to/generate-blueprint.md %}) &mdash; the
196196
other main thing off-chain code does with a `CompiledCode`.

how-to/use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ permalink: /how-to/use/
44
---
55

66
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 %})
7+
`cabal.project`. If you [installed it via ghcup]({% link how-to/install.md %})
88
(the recommended way), `uplc-ghc` is on `PATH` and its name alone is enough:
99

1010
```haskell

reference/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ from or follow as a procedure.
77

88
There are no reference pages yet. The build script's prerequisites, options, and
99
outputs currently live in
10-
[Install Plinth standalone compiler]({% link how-to/build.md %}).
10+
[Build Plinth from source]({% link how-to/build.md %}).

tutorials/first-smart-contract.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ later.
1313
## Before you start
1414

1515
You need `uplc-ghc` installed. If you do not have it yet, follow
16-
[Install Plinth standalone compiler]({% link how-to/build.md %}) first &mdash;
16+
[Install Plinth standalone compiler]({% link how-to/install.md %}) first &mdash;
1717
this tutorial waits for you here. If you installed it via ghcup (the
1818
recommended way), the binary is simply `uplc-ghc` on your `PATH`: wherever
1919
this tutorial says `/path/to/uplc-ghc`, write plain `uplc-ghc` instead. If

0 commit comments

Comments
 (0)