Skip to content

majordomus mesh build-cache ensure

Restore a dependency install or a cold cargo build directory from the local level or this node's store, verified by its digest; on a miss run the command and save what it left. MAJORDOMUS_BUILD_CACHE=off bypasses every level

majordomus mesh build-cache ensure

Usage

majordomus mesh build-cache ensure [OPTIONS] <KIND> [COMMAND]

Arguments

argumentvaluedefaultdescription
<KIND> cargo-build-dir | mix-deps | npm-modules required What is cached: npm-modules, mix-deps or cargo-build-dir
  • cargo-build-dir — The cargo build directory of a workspace: the dependencies compiled on the way, without incremental state. Restored only into a directory that is cold
  • mix-deps — The `deps/` directory `mix deps.get` fills
  • npm-modules — The `node_modules/` directory `npm ci` fills
--dir <DIR> — The directory holding the lockfile, relative to the repository (default: the only one, or the current one)
<COMMAND> <COMMAND> — The install or build command, after `--`: run on a miss (and for mix and cargo on every run)
--repo <PATH> — Start the search for the repository root here (default: the current directory) (accepted by every subcommand)
--discovery vcs | filesystem vcs How declarative files are enumerated (accepted by every subcommand)
  • vcs — Tracked files, through the version-control index (the layer's contract); a layer none of which is tracked is read from the work tree
  • filesystem — A walk of the work tree with the same glob semantics; untracked files included
--strict flag — Refuse to proceed when any file of the layer carries an error diagnostic (accepted by every subcommand)
--share <DIR> — The tool distribution's share directory (kinds.yaml, schemas/); default: $MAJORDOMUS_SHARE, then the repository's own share/, then the one beside the executable (accepted by every subcommand)
--format text | json text `text` for a person, `json` for a machine; both render the same answer
  • text — Lines for a person
  • json — One JSON document, deterministic

Examples

  • Run an install through the build cache

    The command after `--` is what the install would run anyway. With the lockfile's key already in place nothing runs; a hit is restored from the local level or this node's store after its SHA-256 matches, and npm's install is then not run; a miss runs the command and saves what it left. A repository that tracks no such lockfile runs the command uncached and says why, as here; MAJORDOMUS_BUILD_CACHE=off bypasses every level. The exit code is the command's.

    $ majordomus mesh build-cache ensure npm-modules -- true

    What it asserts: exits 0; prints source uncached.

    Tested by apps/majordomus-cli/tests/cli_examples.rs, which runs the command against the built executable and asserts what the page states.

Where this comes from

Declared once in apps/majordomus-cli/src/cli.rs: clap for the structure, typed Rust metadata beside it for the examples. This page, majordomus mesh build-cache ensure --help, docs/generated/cli.md and docs/generated/cli.json are projections of that one declaration.

The whole command line on one page: the registry's command-line page. The task lifecycle (init, start, finish, doctor, ...) belongs to the shell tool, a different program: Commands and its specification.

Searches the titles and descriptions of every page this site publishes.