fix(hooks): mount cargo target outside bind mount via CARGO_TARGET_DIR #16
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
Move the
dev-youtrack-mcp-cargo-targetnamed volume in thejust pre-commitrecipe from/build/targetto/cargo-target(outside the/buildbind mount) and point cargo at it with--env CARGO_TARGET_DIR=/cargo-targeton each of the four cargo steps. The volume name is unchanged, so the cache still persists.Why (DEV-371)
Nesting the named volume at
/build/targetinside the/buildhost bind mount makes the Docker daemon materialize a root-owned./targetdirectory on the host, which then needssudoto remove. Mounting the cache outside the bind mount keeps the host working tree clean.Governance
Implements Option A from the governance standard: relocate the target cache off the bind mount and select it via
CARGO_TARGET_DIR.