Expand description
The location of the cache directory.
The cache is KIZZ_CACHE_DIR when set, otherwise $XDG_CACHE_HOME/kizz,
otherwise ~/.cache/kizz. cache_dir computes it from the three values, so
that callers and tests never need to change the process environment;
cache_dir_from_env reads them from the environment of the process.
The rules for unusual values:
- An empty
KIZZ_CACHE_DIRcounts as unset, as an emptyXDG_CACHE_HOMEdoes. - A relative
KIZZ_CACHE_DIRis an error: the cache serves every build on the machine wherever it starts, and a relative path would name a different cache in every directory. - An empty or relative
XDG_CACHE_HOMEis ignored, as the XDG Base Directory Specification requires. - When
HOMEis needed and is unset, empty, or relative, there is no cache location, and the error says which variables can provide one.
Enums§
- Location
Error - Why the cache directory cannot be located.
Constants§
- HOME
- The variable that names the home directory of the user.
- KIZZ_
CACHE_ DIR - The variable that names the cache directory directly.
- XDG_
CACHE_ HOME - The XDG Base Directory variable for user cache files.
Functions§
- cache_
dir - The cache directory from the values of
KIZZ_CACHE_DIR,XDG_CACHE_HOME, andHOME, eachNonewhen the variable is unset. - cache_
dir_ from_ env - The cache directory from the environment of this process.