The manifest reference
axle.toml sits at a project’s root. Every table is optional except [package], and an absent key falls back to a default rather than an
error. Projects and dependencies is the
guided version; this page is the lookup table.
[package]
name = "smalt"
version = "0.1.0"
targets = ["x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu"]
[workspace]
members = ["app", "core"]
[dependencies]
mathx = { path = "../mathx", features = ["wayland"] }
[features]
wayland = false
[port.win32]
when = { os = "windows" }
dirs = ["win32"]
[link]
libs = ["SDL2"]
paths = ["C:/SDL2/lib"]
[fmt]
max_line_width = 100 [package]
| Key | Type | Default | Meaning |
|---|---|---|---|
name | string | required | the package name, and the artefact’s name in target/ |
version | string | "" | free-form; nothing derives from it yet |
kind | "bin" or "lib" | inferred | what the crate builds to |
entry | path, relative to the project | inferred | the crate’s entry source |
targets | list of triples | [] | the targets this project promises to serve |
kind and entry are inferred from the source layout when omitted:
| Layout | kind | entry |
|---|---|---|
src/main.axle present | bin | src/main.axle |
only src/lib.axle | lib | src/lib.axle |
If both files exist, the crate is a bin. A lib exports pub items
for dependents to import and is never a build’s entry point.
targets is a promise, not a build setting: listing a triple is what
makes the port checks enforce it. List none and you have promised
nothing, which is what lets a port be written one module at a time. A
triple the compiler does not recognise is refused rather than skipped.
[workspace]
| Key | Type | Default | Meaning |
|---|---|---|---|
members | list of directories | [] | crates compiled alongside this one |
A manifest carrying [workspace] is both a crate and the root of a
workspace: members are extra graph roots, compiled whether or not the
root depends on them. Cross-crate use edges still come from each
crate’s own [dependencies] — [workspace] members decides what is
built, never what is visible.
[dependencies]
[dependencies]
mathx = { path = "../mathx", features = ["wayland"] } | Key | Type | Default | Meaning |
|---|---|---|---|
path | path, relative to this manifest | required | the dependency’s directory |
features | list of names | [] | features to turn on in that dependency |
Only path dependencies exist: no registry, no git source, no lockfile.
features only ever enables. That is what makes the request safe to
union — two crates asking for different features of one library both get
theirs, in any order, and neither takes anything away from the other. A
feature the dependency defaults to on is that crate’s own decision
about itself.
[features]
[features]
wayland = false A name and its default state. Two things turn a feature on: the default
here, or a request — --features from the command line for the root
crate, a [dependencies] edge for everything else. Nothing turns one
off. A name a [port]’s when asks for but this table never declared is
refused: it could never be on, so the port could never apply.
--features reaches the root crate and stops there, because two crates
may spell the same name while meaning different things.
[port.<name>]
A port is one backend of a piece of code: a condition, and the
directories that carry it. Nothing is reserved — a crate with no [port] table has no port directories, so a probes/linux/ is an ordinary
directory.
| Key | Type | Default | Meaning |
|---|---|---|---|
when | table | {} (applies everywhere) | the condition under which this port is the active one |
dirs | list of directory names | required, non-empty | this port’s code, at any depth under src/ |
A port with no directory is refused: nothing could ever select it.
The when axes
| Axis | Values |
|---|---|
os | windows, linux, macos |
arch | x86_64, aarch64 |
feature | any name declared in [features] |
Every axis takes one value or a list:
when = { os = "linux" }
when = { os = ["linux", "macos"] }
when = { os = "linux", feature = "wayland" } Several axes in one when must all hold. A value no axis has is refused
with the list of valid ones, and a feature no [features] table
declares is refused too — the alternative is a port that is silently
never active.
{ os = "linux", feature = "wayland" } is narrower than { os = "linux" }, so it wins when the feature is on and the plain Linux
port serves when it is off. Exactly one port is active for any target: a
target left uncovered, or two ports applying with neither narrower, is
refused rather than resolved by declaration order.
[link]
| Key | Type | Default | Meaning |
|---|---|---|---|
libs | list of names | [] | native libraries to link |
paths | list of directories | [] | where to find them |
On Windows these become /DEFAULTLIB:<name>.lib and /LIBPATH:<dir>; on
Unix, -l<name> and -L<dir>. The flags patch the same list ad hoc: axle build --link-lib SDL2 --lib-path C:/SDL2/lib.
[fmt]
Overrides for axle fmt and the language server’s formatter. Every key
is optional; an absent one uses the formatter’s default.
| Key | Type | Meaning |
|---|---|---|
max_line_width | integer | width before a breakable construct wraps |
indent_width | integer | columns of indentation per nesting level |
use_tabs | bool | indent with hard tabs instead of spaces |
brace_on_same_line | bool | keep { on the construct’s line, or move it down |
trailing_comma | bool | trailing comma on a broken brace-delimited list |
max_blank_lines | integer | blank lines preserved between items |
single_line_if_max_width | integer | column ceiling under which a single-statement if with no else stays on one line; 0 disables the rule |
A key the parser does not know
Unrecognised keys are ignored, not reported, so a misspelled one is a setting that silently does nothing. When a table seems to have no effect, check the spelling first.
See also
- Projects and dependencies — dependencies, ports and the checks around them, by example
- Command-line reference — the flags that override these tables