Repository navigation
Mitts 0.3.0
Mitts 0.3.0 gives every store one cache root and makes the test suite prove its own isolation. The public API changes shape (new cache_dir parameters, a new RustBuildOptions field), hence the minor bump.
One cache root for every store (d260ef2)
- A single resolver (
core::cache_root) picks the root for the artifact store, action cache, locks, jobserver, unpacked sources and the sparse-index cache:--cache-dir/RustBuildOptions::cache_dir, then$MITTS_CACHE_DIR,$XDG_CACHE_HOME/mitts,~/.cache/mitts. An empty variable counts as unset. The source store and the index cache now honourXDG_CACHE_HOMElike the other stores. - An explicit
cache_dirreaches every consumer that used to fall back to the default location:NativeResolver::for_cache_dir,SparseIndexClient::for_cache_dir,CargoLock::resolve_or_sync(.., cache_dir),RustAdapter::resolve_lockfile(.., cache_dir),RustAdapter::fetch(.., cache_dir), the rustc invocation (RustcInvocation::cache_rootreplaces theMITTS_CACHE_DIR/out_dirheuristic),mitts explain --cache-dir, build-script purity prefixes andmitts gc, which prunes only the sources of its own root. is_immutable_package_dirrecognises a source-store entry by its<root>/sources/<name>-<version>layout and.mitts-okmarker, so dependencies fetched into a custom cache keep their immutable treatment (no package-tree hashing,--cap-lints allow).RustBuildOptions::fast_lock: Option<bool>keeps the fast build lock active with an explicitcache_dirwhen set toSome(true); the default behaviour is unchanged.
Test isolation (63f8bac)
- Every test that builds uses its own cache root; tests that fake
HOMEalso clear and restoreXDG_CACHE_HOME. Run on its own with a throwawayHOME, no test target reaches~/.cache/mittsany more (169 targets probed, 0 writers). tests/cache_root_isolation_test.rsruns the binary with a throwawayHOMEand checks that--cache-dir,MITTS_CACHE_DIRandXDG_CACHE_HOMErelocate all stores together.scripts/run_tests_isolated.shruns the suite in a clean room and fails if the real~/.cache/mittschanged;scripts/probe_store_isolation.shfinds any target that still uses the default store.
Verified on Linux: 670 tests passed, 0 failed, clippy clean, line coverage 87.2 %.
Full history: v0.2.1...v0.3.0