Expand description
Packaging slice 2b (#2240): fetching git dependencies and writing
bynk.lock — the one place the toolchain touches the network (track
design/tracks/packaging.md §6.4, decision A).
Before check, test, dev or deploy compiles, prepare resolves
the project’s (or its workspace’s) dependencies against bynk.lock:
- a locked git dependency whose manifest entry is unchanged keeps its locked commit; one missing from the store is fetched at that commit;
- a new or changed one (or every one named by
bynk update) is resolved from itsrev, fetched, and hashed; - every git package’s store entry is re-hashed against the lock, so a
tampered or corrupted entry fails the build (
checksum_mismatch); - the lock is rewritten when the graph changed — or, under
--locked, the command fails instead (lock_out_of_date). Under--offline, any needed fetch fails.
Git runs as the user’s own git, hardened per track §6.3 (decision B):
only https and ssh transports (plus file from the project’s own
manifests), no hooks, no submodules, -- before positional arguments,
and no URL or revision that looks like an option. Bynk passes no
credentials: a private repository works through the user’s git setup.
The compile never fetches: bynkc, the language server and the
playground read the lock and the store ([bynk_emit::project]’s graph
resolution reports not_fetched for a missing entry).
Structs§
- Fetch
Error - A failure, as one diagnostic line: its code and message.
- Fetch
Options - How a
bynkcommand may change the lock and the store. - Prepared
- What
preparedid.
Functions§
- prepare
- Resolve, fetch and lock the dependencies of the project at
project_dir(and of every member of its workspace, which shares one lock). A project with no dependencies and no lock is untouched. - store_
hex - The checksum’s store directory name, for messages and tests.
- tree_
checksum - The canonical-tree checksum (decision C): every regular file under
direxcept.git, in byte-wise sorted/-separated path order, each contributingpath \0 length \0 bytes. Symbolic links aren’t files and contribute nothing.