Skip to content

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 window section is a console app. It gets the smallest console runtime that has every system it lists.
  • A project with a window section 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.

StrategyPlatformWhat it makes
headlesshostA console app: the console runtime beside bundle.tbc.
headless-willowLinuxA console app that lists willow.
linux-portableLinuxA window app as one flat folder with assets/ beside it.
linux-appdirLinuxA window app as an .AppDir with AppRun, a desktop entry and an icon. Needs build.icon.
linux-appimageLinuxAn AppDir wrapped as an .AppImage. Needs appimagetool on your PATH.
windows-portableWindowsA Windows folder made from the windows-x86_64 runtime.
macos-appmacOSA 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 runtimeWindow runtime
The language and standard libraryyesyes
audioyes
databaseSQLite and server driversSQLite only
http, net, wsyesno
shell, terminal, package fetchingnono
willowwith headless-willowyes

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:

KindWhat happens
embedStored inside bundle.tbc and read only when opened. Read-only.
packStored in one encrypted app.pak beside the program. A deterrent against casual browsing, not real secrecy: the key ships with the app.
copyCopied 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.tbc

Coming 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.