Expand description
The program store, ~/.murmur/programs/: the pinned downloads a tool’s programs: block names
(murmur_artifact::parse_program_downloads), fetched once by mur install, and which copy of
each pinned program a session runs.
~/.murmur/programs/
<sha256>/ content-addressed by the declared sha256, shared by every artifact
record.json PinnedRecord
files/ the unpacked zip, or the single downloaded file
bin/<program> relative symlink to ../files/<run>, one per program name
.partial-<random>/ an install in flight; never read, removed on any failureEvery directory is 0700; every file 0700 when it is executable and 0600 otherwise. An
entry is assembled in a .partial-* folder and moved into place by one rename, so a reader
sees a whole entry or none.
The store is written by mur install alone (commit_download). Staging only reads it
(resolve_pinned_programs): a host program of the same name on PATH wins; otherwise a
copy whose record.json pins the declared sha256 and whose bin/<program> resolves to an
executable file is used, without re-hashing the tree, so launch time does not grow with the
download. mur install and mur doctor verify the whole tree (verify_entry).
Structs§
- Committed
Entry - What
commit_downloadleft in the store. - Declared
Tool Downloads - One staged tool’s pinned downloads, with the lock origin of its pin.
- Partial
Download - An install in flight:
~/.murmur/programs/.partial-<random>/, removed when dropped uncommitted. - Pinned
Record record.json: what an entry was fetched from, and the digest of what it holds.- Resolved
Pinned Program - One gated program’s source choice.
- Tree
File - One regular file under an entry’s
files/.
Enums§
- Entry
State - What the store holds for one download.
- Pinned
Source - Which copy of a pinned program a session runs.
- Pinned
Store Error - Why committing a download failed.
Constants§
- BIN_DIR
- The folder of an entry holding one link per program name, appended to a session’s
PATH. - EXECUTABLE_
FILE_ MODE - The mode of an executable file in the store; every other file is
crate::murmur_home::PRIVATE_FILE_MODEand every directorycrate::murmur_home::MURMUR_HOME_DIR_MODE. - FILES_
DIR - The folder of an entry holding the downloaded program.
- MAX_
PINNED_ DOWNLOAD_ BYTES - The most bytes a download, and the tree unpacked from it, may hold: 2 GiB.
- PARTIAL_
PREFIX - The name prefix of an install in flight.
- PROGRAMS_
DIR - The store’s name under
~/.murmur. - RECORD_
FILE - An entry’s record of what was fetched.
Functions§
- commit_
download - Unpacks a download whose bytes already hash to
download.sha256and moves it into<store_root>/<sha256>/with its record andbin/<program>link. - derive_
pinned_ programs - The source of each program
toolspin a download of for this host, for the programsshell_allowgrants, against mur’s ownPATHand~/.murmur/programs. - ensure_
bin_ link - Adds
bin/<program>to the verified entry fordownloadwhen it is missing or points elsewhere.Ok(true)when a link was written. - ensure_
program_ store ~/.murmur/programs, created owner-only (and~/.murmurwith it) when missing.- gated_
programs - The programs of
toolsa session may run a pinned copy of, whatever the platform: only from a tool whoseoriginisLockOrigin::Operator, and only for a program key equal to an entry ofshell_allow. Tools in the order given, programs in declaration order. - host_
path_ dirs - mur’s own
PATH, split. - host_
program - The first executable named
programinpath_dirs, canonical: the oneexecvpwould run. - pinned_
bin_ dirs - The
bin/folder of everyPinnedSource::Pinnedchoice, distinct, in order. - pinned_
trees - The entry of every
PinnedSource::Pinnedchoice, distinct, in order. - program_
store_ root ~/.murmur/programs, whether or not it exists. Creates nothing.- read_
record - Reads an entry’s
record.json. - remove_
entry - Removes the entry for
sha256, whatever state it is in. - resolve_
pinned_ programs derive_pinned_programswith the host injected.- tree_
digest - The SHA-256 over
filesas sorted<path>\t<x|->\t<sha256>\nlines. - verify_
entry - Verifies the entry for
download.sha256in full: reads its record, re-hashes every file underfiles/and compares. Reads only.