Skip to main content

cached_sibling_binary

Function cached_sibling_binary 

Source
pub fn cached_sibling_binary(
    sibling: &str,
    revision: &str,
    bin: &str,
    builder: impl FnOnce(&Path),
) -> PathBuf
Expand description

Resolve an immutable executable, building only on a cache miss. revision may be an explicit pin rather than the live checkout’s HEAD. The builder receives a staging Cargo target directory and must produce debug/<bin>. A sibling-wide OS lock covers publication and pruning, including across processes; dropping the file releases it even when a builder panics.