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. - Lock
Error - Why a
bynk.lockcouldn’t be read. - Locked
Npm - #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. - Locked
Package - One locked package.
- Locked
Registry - #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:Nonewhen 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;Nonewhen 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_rootlives: 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 gitsource, orNonefor 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>.