Skip to main content

cache_dir

Function cache_dir 

Source
pub fn cache_dir() -> PathBuf
Expand description

Returns the source-data cache directory, resolved at call time as the first match in this chain:

  1. $UTZ_CACHE_DIR (the μTZ workspace pins this to its cache/ via .cargo/config.toml, so in-repo builds share one cache).
  2. $XDG_CACHE_HOME/utz_build.
  3. %LOCALAPPDATA%\utz_build (Windows) or $HOME/.cache/utz_build.
  4. $OUT_DIR/utz_build-cache (the build-script last resort), and otherwise ./utz_build-cache relative to the current directory.

Config::cache_dir() overrides the chain per build. Everything inside is a re-fetchable download (TZBB zips keyed per release, the ~460 MB GHS-POP raster and its decoded sidecar), so the directory is safe to delete. Build scripts that depend on the chain should emit cargo:rerun-if-env-changed=UTZ_CACHE_DIR.