Tooling
Audience: contributors. The tools for working on hotfpc, the hook and CI.
| Tool | Version | Used for |
|---|---|---|
| Free Pascal | 3.2.2 (the pinned compiler); also tested with fpc-toolchain's 3.2.4-rc and 3.3.1 | building hotfpc; the scenarios use it to build the test programs |
| fpcres | ships with fpc | turns the agent's source into a resource of hotfpc (build system) |
| Python | 3.9 or later | the scenario tests in tests/scenarios/, the check of the agent in tests/agent/ and the reference check |
| Lefthook | 1.5 or later | the pre-commit hook in lefthook.yml (lefthook install once per clone) |
| Node.js | 22 or later, with npx: markdownlint-cli2 0.24.0 and its markdownlint 0.42.0 require it | the Markdown lint (markdownlint-cli2 0.24.0, which npx fetches) |
| Node.js, for the website | 22.12 or later, which the site's mermaid 12.2.0 requires; CI builds it with Node.js 24 | the website (website/) |
| tmux, vim, asciinema, agg, ffmpeg | any recent | recording the terminal demo with scripts/record-demo.py; only needed to re-record (demos) |
Only fpc is needed to build hotfpc. Everything else is for working on it.
The pre-commit hook
lefthook.yml runs ./build.sh hotfpc tests before each commit that changes the source,
which builds hotfpc and runs the unit tests. Before each commit that changes the source or
docs/reference/, it also runs the reference check.
The scenarios take about two minutes, so CI runs them, not the hook. Don't bypass
the hook with --no-verify unless the maintainer agrees.
The documentation checks
docs/ is written for people who use hotfpc (guides and a reference) and for people who
change it (these pages). Two checks keep it honest, and CI's docs job runs both.
The reference check
python3 scripts/check-reference-docs.pydocs/reference/ is written by hand. The check reads source/HotFPC.pas and
source/HotFPC.Agent.pas and fails when the reference:
- doesn't quote the usage text exactly as hotfpc prints it;
- has no table row of its own for an option in the usage text, or names an option the usage text doesn't have;
- misses a
[hot]line the driver prints, including the error it prints when a compile or link fails without an error from fpc, or a restart reason, note or error the agent sends back; - has no table row for a
HOT_*environment variable named insource/.
A line counts as documented when its fixed parts appear in order on one line of
docs/reference/; the parts filled in at run time can be written as <unit>, <ms> and
so on. So a new option or a new [hot] line fails CI until it is documented, usually in
command line or output.
Markdown lint
npx --yes markdownlint-cli2@0.24.0The rules are in .markdownlint-cli2.jsonc: ATX headings, two-space list indents, fenced
code blocks with a language; long lines and inline HTML are allowed. CHANGELOG.md is left
out.
CI
.github/workflows/ci.yml runs on pull requests and on pushes to main. On Linux x86-64,
Linux arm64 (GitHub's ubuntu-24.04-arm runner), macOS arm64 and macOS x86-64 (GitHub's
macos-15-intel runner) with fpc 3.2.2 it builds
hotfpc, runs the unit tests, the scenarios and the check of the agent on its own. On Windows
it builds hotfpc.exe with build.bat, runs the unit tests, and runs the scenarios and the
check of the agent with hotfpc.exe. The docs job runs the
reference check and the Markdown lint.
.github/workflows/release.yml builds the release binaries for a version tag
(releasing), and .github/workflows/pages.yml builds and deploys the
website (below).
The website
https://frostney.github.io/hotfpc/ is a landing page and docs/ rendered as it is. It is
a Fumadocs site in website/, exported as static files by Next.js
with the basePath /hotfpc. Only the landing page and the glue live in website/; every
documentation page is a file in docs/, ordered by the meta.json in each folder, with
its H1 as its title. Node and the site's packages are for the website only: building
hotfpc doesn't need them.
cd website
npm ci
npm run build # the static export in website/out
npm run start # website/out at http://localhost:3000/hotfpc/lib/remark-repo-links.mjsmaps the links indocs/: a link to a page becomes the page's route, a link to a file underdocs/that isn't a page (the demo recordings, an image) becomes the site's copy of it, whichscripts/sync-docs-assets.mjsmakes before each build, and any other link in the repository becomes its GitHub URL. A link or image whose target doesn't exist fails the build, and so does a link whose fragment (page.md#section,#section) names no heading of the Markdown file it points to.lib/remark-term-links.mjslinks the first mention of a few tools on each page (Free Pascal, raylib, lwpt, Wine).- A
```mermaidblock is drawn in the browser bycomponents/mermaid.tsx; GitHub draws the same block natively. - The site has a static search index,
llms.txt,llms-full.txtand a Markdown copy of every page, whose links to pages, sections and files of the site are absolute URLs, an Open Graph image per page and a sitemap. The headings in the Markdown copies are written as GitHub Markdown writes them:lib/source.tsturns off the[#id]that fumadocs puts after each heading by default. The search index takes each page's headings and their ids from the structure fumadocs' MDX preset exports for the page. scripts/check-export.mjsruns after each build and fails it when a search result's#anchoris no id on its page, or when a heading in a Markdown copy orllms-full.txtends with[#id].package.jsonpins every package to an exact version, andpackage-lock.jsonthe rest.
pages.yml builds the site on every pull request, so a broken link fails the pull request,
also when the change that breaks it is outside docs/, such as a renamed heading in
README.md. It deploys the site from pushes to main.