Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

B. buildl.toml Reference

buildl.toml sits at the workspace root and marks it. Every table and every key in it is optional, and an empty file is valid: every setting takes its default, and the ceiling is empty, which allows nothing. A key this version does not know is an error wherever it stands, and so is a value of the wrong type or one its key refuses. Each is reported on one line with the place it was written:

error: manifest: buildl.toml:2:4: unknown field `wirte`, expected `read` or `write`

The Line column below names the line of crates/buildl/src/manifest/schema.rs that declares the key, so you can check this page against the code.

TableWhat it setsLine
[workspace]the workspace's name, its build file name and its output directory66
[ceiling]the most any build may be granted69
[declaration]the limits one build file is evaluated under72
[execution]how actions are run75
[approver]who approves what a build wants78
[plugins.<name>]where each plugin comes from, and what it may have81
[remote]the remote cache, and remote execution85

[workspace]

KeyTypeDefaultMeaningLine
namestringnonea name for people; must not be empty93
entrystring"build.lua"the file name of the build file in every directory95
outstring"out"the directory every output is placed under; not the workspace root, and not .buildl, a directory holding it or one inside it97
configintegernonethe version of this file's format; when written, it must be 199

buildl keeps its own files, the cache, the store and the log, in .buildl. No key changes that.

[ceiling]

The ceiling has three parts, written as sub-tables [ceiling.proc], [ceiling.env] and [ceiling.fs], or as dotted keys such as proc.run = [...] under [ceiling]. A list left out is empty, and an empty list allows nothing. The output directory and .buildl are not added for you: a workspace that builds writes them into fs.write itself.

KeyTypeDefaultMeaningLine
proctableemptythe programs, below108
envtableemptythe environment variables, below111
fstableemptythe directories, below114
proc.runlist of strings[]the programs a command may run, by bare name such as "cc"123
env.readlist of strings[]the environment variables a target may read132
env.unkeyedlist of strings[]the variables a target may mark "unkeyed": given to the command, but only the name enters the action key and nothing is sent to a remote server. Every name must also be in env.read, or the file is refused135
fs.readlist of strings[]the directories inputs may come from; "." is the workspace root144
fs.writelist of strings[]the directories a build may write under; "." is the workspace root147

proc and env are also the names of the same lists in a plugin's table, below. A variable may be marked "unkeyed" only when every level lists it: the ceiling's env.unkeyed and, for a plugin's target, the plugin's table and its manifest too. The Build File API says what the two marks do.

[declaration]

Limits on evaluating one build file. A build file that goes over one stops with an error.

KeyTypeDefaultMeaningLine
memorystring"16MB"the memory one build file may use: a whole number followed by B, KB, MB or GB, each 1024 times the one before; not zero155
instructionsinteger10000000how many Lua instructions one build file may run; at least 1157
walk_entriesinteger100000how many directory entries one build file's source listings may visit; at least 1. A folder a .buildlignore ignores is not entered and an ignored path is not counted159

[execution]

KeyTypeDefaultMeaningLine
workersinteger0how many actions run at once; 0 is one per core of the machine167
timeoutstring"10m"how long one action may run before it is stopped: a whole number followed by ms, s, m or h; not zero169
strategystring"sandbox"how strongly actions are kept apart, one of the four below171
strategyWhat this version does with it
"bare"runs each action as a plain process in the workspace, with only the variables its target declared
"sandbox"runs each action in a fresh directory outside the workspace, holding only its declared inputs, with TZ, LC_ALL and SOURCE_DATE_EPOCH pinned
"os-sandbox"accepted, but build, test and verify refuse it
"container"accepted, but build, test and verify refuse it

[approver]

KeyTypeDefaultMeaningLine
defaultstring"manifest"who answers whether a build may have what it wants: "manifest", "interactive" or "deny"179
defaultMeans
"manifest"the ceiling is all the approval there is
"interactive"you are asked on the terminal about anything new, and a yes is remembered outside the workspace
"deny"no build runs

[plugins.<name>]

One table per plugin, under the name build files load it by with buildl.use. A plugin comes from exactly one of path, git and github. What the plugin may have starts empty: a list or flag left out allows nothing.

KeyTypeDefaultMeaningLine
pathstringnonea directory of the workspace holding the plugin; not the output directory or .buildl, nor one holding or inside them; takes no rev226
gitstringnonethe URL of a git repository holding the plugin; needs rev228
githubstringnonea GitHub repository written owner/repo, the same as git = "https://github.com/owner/repo"; needs rev230
revstringnonethe tag or full commit the repository is pinned to232
dirstringthe repository rootthe folder of the repository that holds the plugin, relative to its root, with no .., no leading / and no empty part; only that folder is stored and digested; takes git or github, not path234
proctableemptyholds run, the programs the plugin's targets may run237
envtableemptyholds read and unkeyed, the environment variables the plugin's targets may read, and may mark "unkeyed"240
networkbooleanfalsewhether the plugin's targets may reach the network242
proc.runlist of strings[]as in [ceiling]123
env.readlist of strings[]as in [ceiling]132
env.unkeyedlist of strings[]as in [ceiling]; every name must also be in this table's env.read135

[remote]

The remote cache this workspace shares results with, which may also run actions. With no [remote] table, buildl uses no remote. When the table is there, url is required.

KeyTypeDefaultMeaningLine
urlstringrequiredthe cache's address: grpc:// or grpcs://, a host, and an optional :port187
instancestringnonethe instance name the cache's storage is addressed under189
castringnonea certificate authority file to trust: an absolute path, or one inside the workspace191
tokentablenonewhere the token sent with every request comes from, below; only over grpcs://193
headerstring"authorization"the request header the token is sent in195
timeoutstring"30s"how long one request may take, written as in [execution]197
executebooleanfalsewhether the cache also runs the actions it has no result for199
jobsinteger128how many actions may be with the remote at once, from 1 to 1024201
queue_timeoutstring"1h"how long a remote execution may wait in the cache's queue, written as in [execution]203
retriesinteger5how many times a failed call is tried again after the first, from 0 to 10205
propertiestable of stringsnonethe platform properties asked of the remote executor, such as pool = "large"; OSFamily and ISA are set by buildl and cannot be written208

token names exactly one of its two keys:

KeyTypeMeaningLine
token.envstringthe environment variable holding the token216
token.filestringthe file holding the token: an absolute path, or one inside the workspace218

Every table at once

This buildl.toml writes every table, and every key but the four that fetch a plugin from git. Beside it are a build.lua declaring one target and an empty folder plugins/local. It passes buildl check:

[workspace]
name = "everything"
entry = "build.lua"
out = "out"
config = 1

[ceiling]
proc.run = ["sh"]
env.read = ["CC"]
env.unkeyed = ["CC"]
fs.read = ["."]
fs.write = ["out", ".buildl"]

[declaration]
memory = "16MB"
instructions = 10000000
walk_entries = 100000

[execution]
workers = 0
timeout = "10m"
strategy = "sandbox"

[approver]
default = "manifest"

[plugins.local]
path = "plugins/local"
proc.run = ["sh"]
env.read = ["CC"]
env.unkeyed = ["CC"]
network = false

[remote]
url = "grpcs://cache.example.com:443"
instance = "main"
ca = "certs/ca.pem"
token.env = "BUILDL_TOKEN"
header = "authorization"
timeout = "30s"
execute = false
jobs = 128
queue_timeout = "1h"
retries = 5
properties = { pool = "large" }
$ buildl check
ok: 1 declaration in 1 build file

A plugin from git is written with git or github, and rev, and with dir when the plugin is one folder of the repository:

[plugins.fromgit]
git = "https://example.com/plugins/fromgit.git"
rev = "v1.0.0"

[plugins.fromgithub]
github = "example/fromgithub"
rev = "v1.0.0"
dir = "plugins/fromgithub"

Every command that reads the workspace, check included, refuses such a plugin until buildl plugins fetch has pinned it in buildl.lock:

$ buildl check
error: plugin fromgit is not fetched: buildl.lock does not pin https://example.com/plugins/fromgit.git at v1.0.0; run `buildl plugins fetch`

Plugins from Git shows the whole round.