fix(hooks): keep pre-commit working tree host-owned #282
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/dev-371-precommit-host-owned-target"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Mount the pre-commit cargo target cache at
/cargo-target(outside the/buildbind mount) and setCARGO_TARGET_DIR=/cargo-target, instead of nesting the named volume at/build/target. The volume name (dev-mokosh-apps-target-${USER}) is unchanged, so the cache still persists and is shared withjust dev.Why (DEV-371)
Nesting the named
targetvolume under the/buildbind mount makes the Docker daemon materialize a root-owned./target/directory on the host, which then needssudoto remove and dirties the working tree. Pointing cargo at a sibling mount keeps the host working tree fully owned by the developer. This aligns with the governance Option A standard (target cache lives outside the source bind mount).