Skip to main content

Module paths

Module paths 

Source
Expand description

Where things live: $HOME, $CARGO_HOME, and the shared cache root.

Everything epicenter touches derives from two roots:

  • Cargo’s home ($CARGO_HOME or ~/.cargo): global config.toml, the already-shared source registry — and the shared build cache.
  • epicenter’s own dir (~/.epicenter): reserved for epicenter files.

The default cache path is expressed ONCE as a cargo template ({cargo-cache-home}/epicenter/build): cargo expands it at build time, and resolve_template expands it identically for epicenter’s own file operations — so the two mechanisms can never drift apart. Same story on WSL (ext4) and native Windows (NTFS).

Constants§

DEFAULT_BUILD_DIR
The shared-build-dir template, as written into Cargo’s global config — THE canonical value, identical on every OS, written with FORWARD slashes: it is the one form verified to work on Linux (backslash variants expand into paths whose separators cargo treats inconsistently on Linux — the artifacts never materialize on disk, basename-level listdir proves it) and forward slashes are legal path separators on Windows, too. Never write an expanded path into a config file: cargo expands {cargo-cache-home} itself at every build, per platform.

Functions§

cargo_home
Cargo’s home dir: $CARGO_HOME, or ~/.cargo. Holds the global config.toml, the already-shared source cache (registry/) — and, and the shared build cache.
default_cache_root
The canonical build-dir template, exactly as it is written into cargo’s config. This is not a filesystem path; commands that touch files use [cargo_resolved_build_dir].
epicenter_dir
epicenter’s (former) own directory — only kept for the doctor’s legacy-file advisory; the shared-cache decision lives in ~/.cargo/config.toml now.
home
The user’s home directory ($HOME, with a portable fallback).
resolve_template
Expand a cargo-style build-dir template value into a concrete path — for epicenter’s local file operations only (never for writing configs).