From 826af7818ef2e28bddfe29d20bd4e25968c0850b Mon Sep 17 00:00:00 2001 From: Hiroshi Shinaoka Date: Wed, 11 Mar 2026 17:24:58 +0900 Subject: [PATCH 1/2] docs: require local cargo target on network filesystems --- ai/common-agent-rules.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ai/common-agent-rules.md b/ai/common-agent-rules.md index a8ab251..c2df113 100644 --- a/ai/common-agent-rules.md +++ b/ai/common-agent-rules.md @@ -28,6 +28,17 @@ - Use `thiserror` for public API error types. - Use `anyhow` only for internal glue where typed errors are not part of the public contract. +## Build Environment + +- When a Rust repository is checked out on NFS or another network filesystem, + place Cargo build artifacts on local disk rather than inside the repository + checkout. +- Prefer a repo-specific local target directory such as + `CARGO_TARGET_DIR=/tmp/-target` for `cargo build`, `cargo test`, + `cargo llvm-cov`, and similar heavy commands. +- Treat this as build hygiene, not an optimization tweak: compile and link + times can degrade severely when `target/` lives on network storage. + ## File Organization Keep source files small and focused. Split by behavior or abstraction boundary, not by arbitrary line count. From 5b4ddb6504180497d92f757d05f3393ffdb59c38 Mon Sep 17 00:00:00 2001 From: Hiroshi Shinaoka Date: Wed, 11 Mar 2026 17:27:19 +0900 Subject: [PATCH 2/2] docs: discourage rust development on network filesystems --- ai/common-agent-rules.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ai/common-agent-rules.md b/ai/common-agent-rules.md index c2df113..620e096 100644 --- a/ai/common-agent-rules.md +++ b/ai/common-agent-rules.md @@ -30,14 +30,18 @@ ## Build Environment -- When a Rust repository is checked out on NFS or another network filesystem, - place Cargo build artifacts on local disk rather than inside the repository - checkout. -- Prefer a repo-specific local target directory such as +- Do not treat NFS or other network filesystems as a normal location for Rust + development worktrees. Strongly prefer putting the repository or worktree + itself on local disk. +- If a repository is on NFS or another network filesystem, explicitly warn the + user before running heavy Rust commands. State that compile and link times + can degrade severely and that local-disk worktrees are strongly preferred. +- Continue on NFS only if the user explicitly wants to proceed anyway. +- When proceeding on NFS, place Cargo build artifacts on local disk rather than + inside the repository checkout. +- Prefer a stable repo-specific local target directory such as `CARGO_TARGET_DIR=/tmp/-target` for `cargo build`, `cargo test`, `cargo llvm-cov`, and similar heavy commands. -- Treat this as build hygiene, not an optimization tweak: compile and link - times can degrade severely when `target/` lives on network storage. ## File Organization