Building for each platform
thicket build packages a project as a standalone program: a prebuilt runtime, your compiled bytecode (bundle.tbc) and the assets you list. New to building? Start with Building a program.
sh
thicket build [<project-dir>] [--out <dir>] [--strategy <name>] [--force] [--release]Console apps and window apps
What you get depends on the project:
- A project without a
windowsection is a console app. It gets the smallest console runtime that has every system it lists. - A project with a
windowsection is a window app. It gets the window runtime: willow, the frame loop, input, audio and rendering, linked into one executable.
A console app can still list willow. It gets the console runtime plus willow, which runs the node tree, tweens and hit tests with no window, display or GPU. That is useful for servers and tools.
Strategies
A strategy decides the shape of the output. With no --strategy, a console app uses headless (or headless-willow when it lists willow) and a window app uses linux-portable on Linux.
| Strategy | Platform | What it makes |
|---|---|---|
headless | host | A console app: the console runtime beside bundle.tbc. |
headless-willow | Linux | A console app that lists willow. |
linux-portable | Linux | A window app as one flat folder with assets/ beside it. |
linux-appdir | Linux | A window app as an .AppDir with AppRun, a desktop entry and an icon. Needs build.icon. |
linux-appimage | Linux | An AppDir wrapped as an .AppImage. Needs appimagetool on your PATH. |
windows-portable | Windows | A Windows folder made from the windows-x86_64 runtime. |
macos-app | macOS | A macOS .app made from the macos-arm64 runtime. Any build.icon must be an .icns file. |
thicket build --list-strategies shows the strategies that fit your project and whether each one is ready.
A strategy refuses a project it does not fit, before anything is written, and names the one that does.
Building for another platform
thicket looks for each platform's runtime in a runtimes/ folder beside itself: linux-x86_64/, windows-x86_64/ and macos-arm64/. If a runtime folder is missing, build on that platform, or copy its runtime folder next to thicket. A build never relabels one platform's runtime as another's.
What a built window app needs
The folder is self-contained except for the operating system. On Linux the program needs only the C library and the window-system and graphics libraries the desktop already has. Nothing is installed beside the folder. The player needs a desktop session and a working GPU driver, plus an audio device for sound.
What each runtime includes
| Console runtime | Window runtime | |
|---|---|---|
| The language and standard library | yes | yes |
audio | yes | |
database | SQLite and server drivers | SQLite only |
http, net, ws | yes | no |
shell, terminal, package fetching | no | no |
| willow | with headless-willow | yes |
In a built window app, an uncaught error goes to crash.log beside the program and a native dialog.
Assets
Only what assets in thicket.json lists ships. Entries are paths or globs (*, **, ?, {a,b}) relative to the project, or <package>:<path> for a file inside a package. A glob that matches nothing is a build error.
json5
assets: [
"assets/**",
"willowui:assets/fonts/go-{regular,bold}.ttf",
]A plain list embeds the files inside bundle.tbc. The object form mixes three kinds:
| Kind | What happens |
|---|---|
embed | Stored inside bundle.tbc and read only when opened. Read-only. |
pack | Stored in one encrypted app.pak beside the program. A deterrent against casual browsing, not real secrecy: the key ships with the app. |
copy | Copied beside the program as plain files. |
json5
assets: {
embed: ["assets/**"],
copy: ["data/save.db"],
}Your code reads every file the same way. A read looks in the embedded files first, then the pack, then the disk, at the same project-relative path. SQLite databases must be listed under copy, because the app writes to them.
Version and icon
The build section of thicket.json holds version, icon and the per-platform settings under linux, windows and macos. On Windows, build.windows.console: true makes a console-subsystem program instead of a GUI one.
Bytecode only
thicket compile is the smaller step. It writes a .tbc bundle and nothing else, which thicket run app.tbc can run.
sh
thicket compile app.tks -o app.tbcComing next
These are on the way. Plans can change.
- Single-file programs: the bundle appended to the runtime, so a game is one file.
- Web builds: a WebAssembly runtime that runs a bundle in the browser.