Skip to main content

Module install

Module install 

Source
Expand description

assay install — fetch + verify + extract the binaries and Lua libraries declared in a Manifest.lua.

See .claude/plans/21-libs-folder-and-install.md.

§Pipeline

  1. Read Manifest.lua, parse in a sandboxed mlua VM (manifest).
  2. Resolve dirs (cache / bin / lib) from CLI flags + per-user XDG fallbacks (root falls back to /var/cache/assay, /usr/local/bin, /opt/assay/libs).
  3. Build a fetch::FetchPlan per declared dep.
  4. With --dry-run: print the resolved plan and exit.
  5. Otherwise: fetch all deps in parallel via tokio::spawn (cache hits skip HTTP; sha256 verified for every artifact).
  6. Extract sequentially: extension binaries via extract::install_extension_binary; lib trees via extract::install_lib_tree.
  7. Write Manifest.lock next to the input manifest.

Failures abort early. Cached entries from successful fetches are preserved; bin / lib trees from earlier extractions are NOT rolled back (matching plan 21’s design, finalised treatment in phase 5).

Modules§

extract
Extract .tar.gz artifacts from the cache into the destination filesystem paths.
fetch
Fetch + cache + sha256-verify for declared deps.
lock
Manifest.lock writer.
manifest
Manifest.lua parser. Reads a Lua return-table declaring extension binaries + Lua libraries to install.

Structs§

InstallArgs

Enums§

InstallError

Functions§

execute
Run the install pipeline, returning a typed result. Useful for tests that need to inspect the error path; the CLI entry run converts this into an ExitCode.
run
Top-level entry point invoked by the Install clap subcommand.