Skip to main content

Module water_dir

Module water_dir 

Source
Expand description

Management of the global Water home and per-project managed backend build cache.

Playground projects store generated backends under ~/.water/build_cache/<absolute-project-path>/managed_backends/ instead of scattering .water directories into user projects. Compiled Cargo artifacts live in the sibling ~/.water/build_cache/target/ — one directory shared by every project, so a machine compiles each dependency revision once no matter how many projects use it. The price of that sharing is serialization: Cargo takes one build-directory lock per target, so concurrent water invocations on different projects build one at a time — the second reports Blocking waiting for file lock on build directory, which the piped progress render surfaces rather than swallowing — instead of each compiling the same dependency graph in parallel. Sharing wins overall for the workflows the CLI targets, where the alternative is N cold framework compiles.

Structs§

BuildCacheConfig
Cleanup policy for the global managed build cache.
BuildCacheEntryUsage
On-disk usage of one managed build-cache entry.
BuildCacheGcSummary
Summary of one managed build-cache garbage-collection pass.
BuildCacheUsageReport
What the managed build cache is currently spending disk on.
HomeDirError
The current user’s home directory could not be determined.
WaterConfig
Global Water CLI configuration persisted to ~/.water/config.toml.

Enums§

BuildCacheGcOutcome
Result of attempting to garbage-collect stale managed build-cache entries.

Constants§

CLI_COMMIT
The CLI commit hash embedded at build time.

Functions§

build_cache_container_for
Return the whole managed cache container for a project directory, which need not exist.
build_cache_root
Return the global managed build-cache root at ~/.water/build_cache.
cleanup_stale_build_caches_for_project
Garbage-collect stale managed build-cache entries while preserving the current project’s cache.
ensure_global_config
Ensure ~/.water/config.toml exists and return the parsed configuration.
ensure_project_build_cache
Ensure the managed build-cache directory exists for a project and return it.
project_build_cache_dir
Return the managed build-cache directory for a project.
remove_project_build_cache
Remove the managed build cache for a project.
remove_shared_target_dir
Remove the shared Cargo target directory every project’s builds write into, returning the disk space it held — None when no shared target exists.
shared_host_target_dir
Return the shared target directory host-side rlib builds use.
shared_target_dir
Return the Cargo target directory every project’s CLI-managed builds share, creating it if needed.
survey_build_cache_usage
Survey the managed build cache without removing anything.
water_home_dir
Return the Water home directory root at ~/.water.
water_home_dir_in
Return the Water home directory root at ~/.water for host.
write_global_config
Persist config to ~/.water/config.toml.