raz / site / README.md

141 lines · 6.9 KiB · raw · history · last change de634aad

Building raz's website #

make site builds the pages, tours, reports and downloads with Build.raz, then the source browser and release pages with Source.raz. Both are raz programs, as are Verify.raz and the modules they share (Site, Releases, Markup and Sha256): the Makefile builds them with this repository's ./raz into build/site/. Source needs git, gzip and an x86-64 Linux; Build also pandoc, pdfinfo and make. Its pinned static ladle executable is kept compressed under tools/, with a checksum and build instructions. The helper verifies the compressed bytes, unpacks it into build/site/ladle and runs it. No network connection is needed with a full checkout. If a deployment service clones shallowly, the helper first fetches the full history and tags from that checkout's origin, using its existing repository access.

The existing /download/ URLs and archives stay as they are. Before attaching an archive to a release, Source.raz checks its bytes against the published checksum beside it. It fails if either is missing or the sum differs; it never replaces that checksum to fit new bytes.

The source browser #

Source.raz makes a fresh bare clone of main, with its reachable tags, using --single-branch --no-local. Other branches, reflogs and unreachable tags are not published. The store is repacked with a 20 MiB target, and git update-server-info prepares it for cloning over plain HTTP. The exported files are only HEAD, info/refs, objects/info/packs and objects/pack/: no git configuration, hooks or local paths. ladle writes the pages beside these files.

The clone's committed tree is the source of every page. A detached deployment checkout is supported too: the publishing service chooses main, and the helper names its commit main only in the temporary store. Uncommitted files and the generated source site do not enter it. In particular, public/source/ must stay ignored: committing a source browser's own output would publish a copy of the previous output on the next build.

The result lives at public/source/, browsed and cloned at https://raz.lucela.org/source/. To build just this part, after the normal downloads exist:

make site-source

Or run build/site/Source directly. --ladle /path/to/ladle overrides the bundled executable for development. --url may give another absolute address ending in /source/, for previewing the feeds and clone line. source.theme starts from ladle's paper theme, with raz's page and link colours; ladle checks its light and dark contrast when it runs.

Cutting a release #

To release, check main and tag it; the tag's message is what raz --version will print:

$ make check
$ git tag -a v0.25.3 -m 'raz 0.25.3, report 2026-10.38'
$ git push origin v0.25.3

GitHub then builds and checks the tag, and makes a release of it with a tarball of raz, its lib/ and its manual pages, made by make dist. A tag pushed before the workflow existed is released from the Actions tab: run "ci" with its name. Then make site adds the new tag's tarball to the website's download/ (it builds it from the tag, apart from the tree at hand); commit site/public/ and push to publish it. A release whose tag isn't pushed yet goes there too, by make site RELEASES="v0.25.3=COMMIT": make dist REV=COMMIT VERSION=0.25.3 makes the tarball the tag will, byte for byte. Every release since 0.7.1 stays there, at its own name, and is never made again, so that its SHA-256 holds: programs pin raz by it. From 0.15.0 on, make dist makes the same tarball, byte for byte, wherever it runs, so GitHub's and the website's agree. Once a release is out, BOOT may name it, and the next one is built by it: then src/ may use what it brought.

Releases and downloads #

Each supported tag from v0.7.1 onward gets its existing Linux x86-64 compiler archive and a separate source archive of the tagged commit. Source archives use git archive and gzip without a timestamp; their names include the version, and they do not include submodules. ladle writes each artifact's size and SHA-256 on its release page, with a downloadable .sha256 beside it.

releases lists distributions whose tags have not yet been pushed: one vX.Y.Z FULL_COMMIT_HASH per line, with # comments. The commit must be on main's first-parent line. A tag added later must name the same commit; otherwise the build fails. Remove a manifest row only after that tag exists. This records existing distributions; the site build never creates tags or compiler releases.

release-notes/vX.Y.Z.md, when present, supplies that version's notes. Otherwise an annotated tag supplies them.

Both builders read this list through Releases.raz, so the home page and source browser offer the same versions. An existing distribution can also be given as vX.Y.Z=COMMIT on either helper's command line; make site RELEASES='vX.Y.Z=COMMIT' passes it to both. Permanent distributions belong in the manifest rather than a remembered command.

Headers and hosting #

ladle's header rules are prefixed with /source and merged into the root public/_headers between marked comments. Rebuilding replaces that block, preserving other root rules. Its general security policy therefore applies only to /source/*, including raw files and git objects. Source.raz never changes _redirects, so /download/latest continues to work. Cloudflare reads the root header file; the nested one is not enough.

The new source tree is built in a temporary directory before replacing the old one. The complete output is counted before it is installed: at most 20,000 files, each at most 25 MiB. A 20 MiB pack target is not a guarantee, since git may place a larger object in its own pack. The final file check catches that too. No total-byte limit is assumed; the build prints total bytes for review against the hosting plan.

Before deploying, serve public/ locally, clone /source/ and run git fsck in the clone. Download a compiler and its checksum from a release page, check it, then unpack it and compile Hello. Repeat the clone and download checks against the live address after deployment; a local file server does not test Cloudflare's headers.

make site-check (Verify.raz) checks release identity and ordering against small real Git repositories, including shallow deployment checkouts, and rejects a damaged bundled builder. make check remains the compiler's required check before committing.

The Wrangler configuration runs make site-source before deployment. The usual npx wrangler deploy therefore generates the ignored source browser from the committed repository before uploading the assets. It uses the already generated main pages and distributions; it builds raz to compile Source.raz (src/boot.sh fetches the compiler BOOT names, unless build/boot/ has it), but does not run pandoc or the tours on the deployment machine.

The source archives' gzip bytes come from the gzip program (gzip -9n, as make dist packs the tarballs), so their checksums depend on its version.

source
1# Building raz's website
2
3`make site` builds the pages, tours, reports and downloads with
4`Build.raz`, then the source browser and release pages with `Source.raz`.
5Both are raz programs, as are `Verify.raz` and the modules they share
6(`Site`, `Releases`, `Markup` and `Sha256`): the Makefile builds them
7with this repository's `./raz` into `build/site/`. `Source` needs git,
8gzip and an x86-64 Linux; `Build` also pandoc, pdfinfo and make. Its
9pinned static ladle executable is kept compressed under `tools/`, with
10a checksum and build instructions. The helper verifies the compressed
11bytes, unpacks it into `build/site/ladle` and runs it. No network
12connection is needed with a full checkout. If a deployment service
13clones shallowly, the helper first fetches the full history and tags
14from that checkout's origin, using its existing repository access.
15
16The existing `/download/` URLs and archives stay as they are. Before
17attaching an archive to a release, `Source.raz` checks its bytes against
18the published checksum beside it. It fails if either is missing or
19the sum differs; it never replaces that checksum to fit new bytes.
20
21## The source browser
22
23`Source.raz` makes a fresh bare clone of `main`, with its reachable
24tags, using `--single-branch --no-local`. Other branches, reflogs and
25unreachable tags are not published. The store is repacked with a
2620 MiB target, and `git update-server-info` prepares it for cloning
27over plain HTTP. The exported files are only `HEAD`, `info/refs`,
28`objects/info/packs` and `objects/pack/`: no git configuration, hooks
29or local paths. ladle writes the pages beside these files.
30
31The clone's committed tree is the source of every page. A detached
32deployment checkout is supported too: the publishing service chooses
33main, and the helper names its commit `main` only in the temporary
34store. Uncommitted
35files and the generated source site do not enter it. In particular,
36`public/source/` must stay ignored: committing a source browser's own
37output would publish a copy of the previous output on the next build.
38
39The result lives at `public/source/`, browsed and cloned at
40<https://raz.lucela.org/source/>. To build just this part,
41after the normal downloads exist:
42
43```sh
44make site-source
45```
46
47Or run `build/site/Source` directly. `--ladle /path/to/ladle`
48overrides the bundled executable for development. `--url` may give
49another absolute address ending in `/source/`, for
50previewing the feeds and clone line. `source.theme` starts from
51ladle's paper theme, with raz's page and link colours; ladle checks
52its light and dark contrast when it runs.
53
54## Cutting a release
55
56To release, check `main` and tag it; the tag's message is what
57`raz --version` will print:
58
59 $ make check
60 $ git tag -a v0.25.3 -m 'raz 0.25.3, report 2026-10.38'
61 $ git push origin v0.25.3
62
63GitHub then builds and checks the tag, and makes a release of it with
64a tarball of `raz`, its `lib/` and its manual pages, made by `make
65dist`. A tag pushed before the workflow existed is released from the
66Actions tab: run "ci" with its name. Then `make site` adds the new
67tag's tarball to the website's `download/` (it builds it from the tag,
68apart from the tree at hand); commit `site/public/` and push to publish
69it. A release whose tag isn't pushed yet goes there too, by `make site
70RELEASES="v0.25.3=COMMIT"`: `make dist REV=COMMIT VERSION=0.25.3` makes
71the tarball the tag will, byte for byte. Every release since 0.7.1 stays there, at its own name, and is
72never made again, so that its SHA-256 holds: programs pin raz by it.
73From 0.15.0 on, `make dist` makes the same tarball, byte for byte,
74wherever it runs, so GitHub's and the website's agree. Once a release
75is out, `BOOT` may name it, and the next one is built by it: then
76`src/` may use what it brought.
77
78## Releases and downloads
79
80Each supported tag from `v0.7.1` onward gets its existing Linux
81x86-64 compiler archive and a separate source archive of the tagged
82commit. Source archives use `git archive` and gzip without a timestamp;
83their names include the version, and they do not include submodules.
84ladle writes each artifact's size and SHA-256 on its release page,
85with a downloadable `.sha256` beside it.
86
87`releases` lists distributions whose tags have not yet been pushed:
88one `vX.Y.Z FULL_COMMIT_HASH` per line, with `#` comments. The commit
89must be on `main`'s first-parent line. A tag added later must name the
90same commit; otherwise the build fails. Remove a manifest row only
91after that tag exists. This records existing distributions; the site
92build never creates tags or compiler releases.
93
94`release-notes/vX.Y.Z.md`, when present, supplies that version's notes.
95Otherwise an annotated tag supplies them.
96
97Both builders read this list through `Releases.raz`, so the home page
98and source browser offer the same versions. An existing distribution
99can also be given as `vX.Y.Z=COMMIT` on either helper's command line;
100`make site RELEASES='vX.Y.Z=COMMIT'` passes it to both. Permanent
101distributions belong in the manifest rather than a remembered command.
102
103## Headers and hosting
104
105ladle's header rules are prefixed with `/source` and merged into the
106root `public/_headers` between marked comments. Rebuilding replaces
107that block, preserving other root rules. Its general security policy
108therefore applies only to `/source/*`, including raw files and git
109objects. `Source.raz` never changes `_redirects`, so `/download/latest`
110continues to work. Cloudflare reads the root header file; the nested
111one is not enough.
112
113The new source tree is built in a temporary directory before replacing
114the old one. The complete output is counted before it is installed:
115at most 20,000 files, each at most 25 MiB. A 20 MiB pack target is not
116a guarantee, since git may place a larger object in its own pack.
117The final file check catches that too. No total-byte limit is assumed;
118the build prints total bytes for review against the hosting plan.
119
120Before deploying, serve `public/` locally, clone `/source/` and run
121`git fsck` in the clone. Download a compiler and its checksum from a
122release page, check it, then unpack it and compile Hello. Repeat the
123clone and download checks against the live address after deployment;
124a local file server does not test Cloudflare's headers.
125
126`make site-check` (`Verify.raz`) checks release identity and ordering
127against small real Git repositories, including shallow deployment
128checkouts, and rejects a damaged bundled builder. `make check` remains the
129compiler's required check before committing.
130
131The Wrangler configuration runs `make site-source` before deployment.
132The usual `npx wrangler deploy` therefore generates the ignored source
133browser from the committed repository before uploading the assets.
134It uses the already generated main pages and distributions; it builds
135`raz` to compile `Source.raz` (`src/boot.sh` fetches the compiler
136`BOOT` names, unless `build/boot/` has it), but does not run pandoc or
137the tours on the deployment machine.
138
139The source archives' gzip bytes come from the `gzip` program (`gzip
140-9n`, as `make dist` packs the tarballs), so their checksums depend on
141its version.