decisions DECIDED

240. §46 (thin primitives or whole subsystems): toml in xtask

Section number provisional until the merge queue lands it.

Raised on pull request #1405, milestone 611 (every program and crate belongs to a package, and every package has a home). It is built as the follow-up to #1396 that moves packages/*.package, packages/homes and packages/*.recipe to TOML. It needs a §46 dependency, which the maintainer mints here, per the ruling of §239 (four package kinds, and TOML for package declarations and recipes) that package declarations and recipes are written in TOML.

The dependency

toml 1.1.6, in xtask only, default-features = false, features std, parse and serde (the last brings in serde_core for toml::Table, not the derive macro or a proc-macro dependency). The crate is host-only and never ships: xtask is the build tool, not part of any image, so this never reaches the shipping graph §46 is written to gate.

Built dependency graph, six crates: toml, serde_core, serde_spanned, toml_datetime, toml_parser, winnow. cargo deny check licenses bans sources passes.

Why (§46's test)

§46 (thin primitives or whole subsystems) asks whether correctness here is won by reading the spec or by exposure. A TOML parser is the second case. TOML's grammar has enough edge cases (multiline strings, datetime literals, table/array-of-tables nesting) that a hand-rolled parser earns correctness the slow way, one bug report at a time, where toml has already taken that exposure across its ecosystem. The rule is the same one §196 (nife carries TLS) used for rustls: write the calendar, take the crypto; here, take the parser for the format calef chose.

Two clauses keep this from being the general case §46 warns against:

The dependency and its reason are recorded a second time, beside the dependency itself in xtask/Cargo.toml, and in notes/packages.md.

Checked

Reversibility

Host-only tooling dependencies are the cheap end of §46's ladder: nothing outside xtask depends on toml's presence, and swapping parsers would touch one module. What is not cheap is the format choice underneath it (§239), which this dependency merely serves.