fix(hooks): mount cargo target outside bind mount via CARGO_TARGET_DIR #25
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 cargo target cache at
/cargo-target(outside the/buildbind mount) and point cargo at it withCARGO_TARGET_DIR, instead of nesting thedev-umbra-cargo-targetnamed volume at/build/target. Applied to all four cargo steps in thepre-commitrecipe. The volume name and the registry volume are unchanged.Why (DEV-371)
Nesting a named volume under the
/buildbind mount makes the Docker daemon create a root-ownedtarget/directory on the host, which then needssudoto remove. Moving the mount path off the bind mount keeps the host working tree clean while the cache still persists in the named volume.Governance Option A
Implements the governance Option A standard: relocate the cargo target volume outside the bind mount and set
CARGO_TARGET_DIRso cargo writes into the volume at its new path.