fix(hooks): mount cargo target outside bind mount via CARGO_TARGET_DIR #18
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
Change the
pre-commitjustfile recipe to mount thedev-forgejo-mcp-cargo-targetnamed volume at/cargo-target(outside the/buildbind mount) and point cargo at it with--env CARGO_TARGET_DIR=/cargo-target, instead of nesting it at/build/target. The volume name is unchanged, so the build cache still persists.Why (DEV-371)
Mounting the named volume at
/build/targetnests it inside the/buildhost bind mount. The Docker daemon then materializes a root-ownedtarget/directory on the host, which requires sudo to remove and leaves stray files after runningjust pre-commit. Moving the mount path off the bind mount stops the daemon from creating any host-sidetarget/.Governance note
Applies the governance Option A standard: mount the cargo target cache outside the bind mount and select it via
CARGO_TARGET_DIR.