Expand description
zelkova.toml, the package manifest.
docs/spec/packages.md is the normative
shape: six fields, five of them required. This module reads the file, deserializes it
with serde/toml, and validates each field on its own terms — a legal package
name, a three-integer version, and each
dependencies/test-dependencies entry naming exactly one source. private_modules is
checked against the modules the package actually holds by check_package,
once source loading has produced that list — this module only knows the manifest, never
the package’s files, so load returns the names as written.
Reading a manifest is where a build starts and not what it is:
resolve is what follows both dependency maps to the other packages
and decides what each module is called in each of them. main is validated here as a
module name, and what it names is checked once the package’s src/ has checked — see
program.
Structs§
- Dependency
- One entry of
dependenciesortest-dependencies: a source, and whether this package sees it wrapped (the default) or unwrapped. - Manifest
- A validated
zelkova.toml. - Version
- Three non-negative integers, with no pre-release suffix and no build metadata —
docs/spec/packages.md’s whole rule forversion.
Enums§
- GitPin
- A
gitsource asks for a version, by way of the tag it was published under, or pins one commit in full — never both, and never neither. - Manifest
Error - Every way reading a manifest can fail.
- Source
- Where a dependency comes from — exactly one of the two, per
docs/spec/packages.md#where-a-dependency-comes-from.
Constants§
- MANIFEST_
FILE_ NAME - The file every package directory must hold, beside
src/.
Functions§
- load
- Read and validate the manifest of the package rooted at
package_dir.