AFS_AETHER_CACHE_DIR
Deep-dive reference for:
AFS_AETHER_CACHE_DIR
Status
active
Audience
production/user
Type and Default
- Type: filesystem path (
PathBuf). - Default:
$XDG_CACHE_HOME/aetherfs-aetherwhenXDG_CACHE_HOMEis set.- Otherwise
$HOME/.cache/aetherfs-aetherwhenHOMEis set. - Otherwise
$TMPDIR/aetherfs-aether(std::env::temp_dir()fallback).
What It Does
Sets the base cache root for Aether local cache state.
For a given session ID, Aether materializes cache content under:
<cache>/<session>/content/
with these subdirectories:
blobs/staging/dirty/index/shared/locks/
On Unix, startup ensures these directories exist with 0700 permissions before mount
work proceeds.
Input Surfaces
- Env:
AFS_AETHER_CACHE_DIR=/path/to/cache-root - Config file (
aether.toml):cache_dir = "/path/to/cache-root" - CLI override:
--cache-dir /path/to/cache-root(on commands that expose it, including mount/journal/cache flows)
Resolution and Override Order
- Defaults <
aether.toml< environment < CLI overrides.
Related Behavior
- Default control socket path is derived from cache layout locks:
<cache>/<session>/content/locks/control.sock
- If file logging is enabled and no explicit log path is set, log path defaults to:
<cache>/logs/aether.log
AFS_AETHER_CACHE_SHARED_ROOTis separate:AFS_AETHER_CACHE_DIRcontrols per-session cache roots.AFS_AETHER_CACHE_SHARED_ROOTcontrols the host-wide shared blob root and defaults to<cache_dir>/shared(set tooff/none/disabled/false/0to disable).
Path Handling Notes
- The value is taken as provided (no canonicalization/normalization in config load).
- Relative paths are allowed and resolve relative to the process working directory.
- Mount startup fails if required directories cannot be created or permissioned.
Example
If:
AFS_AETHER_CACHE_DIR=/var/lib/aetherfs/cachesession_id=abc123
then Aether uses:
/var/lib/aetherfs/cache/abc123/content/blobs/var/lib/aetherfs/cache/abc123/content/staging/var/lib/aetherfs/cache/abc123/content/dirty/var/lib/aetherfs/cache/abc123/content/index/var/lib/aetherfs/cache/abc123/content/shared/var/lib/aetherfs/cache/abc123/content/locks
Primary Implementation Sources
packages/aether/src/config/types/model_defaults.rspackages/aether/src/config/types/file_config_loader.rspackages/aether/src/config/types/config_resolution.rspackages/aether/src/config/types/apply_env.rspackages/aether/src/cache/mod.rspackages/aether-cli/src/app/dispatch_and_runtime.rspackages/aether-cli/src/cli/args/cli_option_args.rspackages/aether/src/core/control/control_client.rs