Skip to main content

Module lock

Module lock 

Source
Expand description

Packaging slice 2b (#2240, track design/tracks/packaging.md §5.2, §6.4): bynk.lock and the store.

The lock pins a project’s (or a workspace’s) resolved package graph: each git dependency’s requested revision, the commit it resolved to and the sha256 of its canonical tree, and each path dependency’s directory (never hashed — it is the author’s working copy). Only the bynk CLI writes it and fills the store; the compile, bynkc and the editor read both and never fetch (crate::resolve_graph).

The format is versioned and written in one deterministic order, and a file with no version is refused rather than read as empty, as bynk.deploy.lock refuses one: a truncated lock must not silently re-resolve every dependency.

Structs§

Lock
A parsed bynk.lock.
LockError
Why a bynk.lock couldn’t be read.
LockedNpm
#2255: one npm package a dependency’s adapters may bring into the build, at one range. Two dependencies requiring one package at two ranges are two rows; the compile refuses the conflict (bynk.requires.conflicting_range) if both are reached.
LockedPackage
One locked package.
LockedRegistry
#2274: a registry a build used, and the key first trusted for it — what makes trust on first use stick across fresh clones (track §6.2).

Constants§

FIRST_PARTY
#2274: the first-party registry’s index URL and pinned key (ed25519:<base64>), once the hosted service (packaging slice 4b) is live. Until then, an organisation no [registries] entry lists resolves nowhere (bynk.registry.unavailable).
FIRST_PARTY_REGISTRY
#2274: the first-party registry’s name in routing and in a lock source.
LOCK_FILE
The lock’s file name, beside bynk.toml (or the workspace root’s).
LOCK_VERSION
The lock format this toolchain reads and writes.

Functions§

adapter_requires
#2255: the npm packages an adapter source file’s binding … requires { … } names, with the adapter’s declared name: None when the file isn’t an adapter with a binding. Recovery-parsed, so a file with an error elsewhere still yields its clause; the compile reports the error.
base64_decode
base64_encode
bynk_home
The store’s root: $BYNK_HOME, else $XDG_CACHE_HOME/bynk, else ~/.cache/bynk; None when none can be determined.
checksum_hex
The lowercase hex of a sha256-<base64> checksum’s digest.
checksum_of
sha256-<base64> for a 32-byte digest.
git_source
A git package’s source: git+<url>?rev=<rev>#<commit>.
lock_root
Where the lock for the project at project_root lives: its workspace’s root when it is a member (one lock per workspace, track §4.2), else its own root.
parse_git_source
(url, rev, commit) of a git source, or None for any other source.
parse_lock
Parse bynk.lock’s text.
parse_registry_source
The registry name of a registry+<name> source.
path_source
A path package’s source: path+<dir>, /-separated.
read_lock
Read the lock at lock_root: the overlay first, then the disk. Ok(None) when there is none.
registry_source
#2274: a registry package’s source: registry+<name>.
store_dir
The store directory holding the tree whose checksum is checksum (sha256-<base64>): <home>/store/sha256/<hex>.