Skip to main content

Module lockfile

Module lockfile 

Source
Expand description

On-disk I/O for the toolchain lockfile (zlayer-toolchains.lock).

The lockfile shapes (ToolchainLockfile, LockedTool) are pure serde types in zlayer-types; this module adds the TOML load/save, the (tool, platform, arch) lookup/upsert, and the sha256 recomputation helper. The provisioning crate only ever consumes a lock (verifying downloads against pinned digests) — it never writes one. The writer is the CLI (zlayer toolchains lock).

A ToolchainLockfile is stored as TOML with a stable [[tool]] ordering (sorted by (tool, platform, arch)), so the file is diff-friendly across regenerations.

Structs§

LockedTool
One pinned toolchain entry: an exact, integrity-checked resolution.
ToolchainLockfile
The parsed toolchain lockfile: a schema tag, a generation timestamp, and the set of pinned tools (serialized as a TOML [[tool]] array of tables).

Constants§

LOCKFILE_NAME
Canonical file name for the toolchain lockfile.
TOOLCHAIN_LOCK_SCHEMA
Current on-disk schema version for ToolchainLockfile.

Traits§

ToolchainLockfileExt
I/O + query extension methods for the pure-serde ToolchainLockfile.

Functions§

compute_sha256
Compute the sha256 (bare lowercase hex) of the file at path, streaming it in chunks so a large artifact never has to be fully buffered.