feat(content-hash): add blake3_file primitive for dev daemon-identity isolation (#891) - #892
Merged
Merged
Conversation
… isolation (#891) soldr-daemon, FastLED/fbuild, and standalone zccache all obtain their daemon identity/discovery through running-process, and all three hit the same dev failure: two builds sharing one home root rendezvous on the same daemon pipe + pid file, each sees the other as "stale-version" and displaces it on every invocation — a displace-stale war that wedges the compile daemon. The shims are already version-namespaced; the daemon identity is not. Provide the isolation primitive once here, the common service everyone routes through. - Add running_process::content_hash::blake3_file(&Path) -> io::Result<Hash> (re-exported at the crate root, feature `client`). Hashes the file's BYTES via blake3::Hasher::update_mmap_rayon: content-based (so same-version rebuilds isolate), mmap+multi-core (page-cache-warm, ~1-3ms for a 20MB binary), and immune to the ASLR/IAT/.data mutation that makes the loaded image a per-run nonce. - Enable blake3's `mmap` + `rayon` features (required by update_mmap_rayon). - Unit tests: hashes-bytes-not-path, path-independence, content-sensitivity, empty file, stable first-16-hex stamp, missing-file io::Error. - Regenerate docs/api_snapshot_rust.txt for the new re-export. Refs: zackees/soldr#2352 (design of record + evidence), zackees/soldr#2353 (interim soldr-side fix). Closes #891 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Aug 7, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
running_process::blake3_file(&Path) -> io::Result<Hash>(modulecontent_hash, re-exported at the crate root, featureclient) — the shared content-hash primitive requested in #891.Why
soldr-daemon,
FastLED/fbuild, and standalone zccache all obtain their daemon identity/discovery through running-process, and all three hit the same dev failure: two builds sharing one home root (e.g.~/.soldr-dev) rendezvous on the same daemon pipe + pid file, each sees the other as "stale-version" and displaces it on every invocation — adisplace-stalewar that wedges the compile daemon. The shims are already version-namespaced; the daemon identity is not. Rather than reimplement isolation in each consumer, provide it once here — the common service everyone routes through.The primitive
.data/.bss, so it differs from the file and differs every run (ASLR) → a nonce.update_mmap_rayonon the file is page-cache-warm and multi-core (~1–3 ms for a 20 MB binary).Consumers stamp dev identity as
"<version>-<first-16-hex of blake3_file(current_exe)>", computed once and propagated as a value down the process tree (see the issue for the client/daemon agreement).Changes
crates/running-process/src/content_hash.rs— the primitive +Hashre-export + 6 unit tests (hashes-bytes-not-path, path-independence, content-sensitivity, empty file, stable first-16-hex stamp, missing-fileio::Error).Cargo.toml— enable blake3'smmap+rayonfeatures (required byupdate_mmap_rayon).lib.rs—pub mod content_hash+pub use content_hash::blake3_file(both feature-gated onclient, where blake3 already lives; soldr/zccache/fbuild all consumeclient).docs/api_snapshot_rust.txt— regenerated for the new re-export.CHANGELOG.md— Unreleased entry.Validation
Local (MSVC), all via
soldr cargo:soldr cargo test -p running-process --features client --lib content_hash→ 6 passedsoldr cargo clippy -p running-process --features client --lib -- -D warnings→ cleansoldr cargo fmtcheck → cleanRefs: zackees/soldr#2352 (design of record + evidence), zackees/soldr#2353 (interim soldr-side fix).
Closes #891
🤖 Generated with Claude Code