You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/build.instructions.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,21 @@ Key ordering constraint:
44
44
## Worktrees and concurrent builds
45
45
This repo supports multiple concurrent builds across git worktrees. Prefer the scripts because they handle environment setup and avoid cross-worktree process conflicts.
46
46
47
+
### Worktree-aware process cleanup
48
+
-`build.ps1` now scopes process cleanup to the current repository root (`$PSScriptRoot`).
49
+
- This avoids killing active `msbuild`/`dotnet`/test processes started from other worktrees.
50
+
- The same worktree is intentionally exclusive: `build.ps1`/`test.ps1` acquire a named lock and fail fast if another build/test workflow is already running in that worktree.
51
+
- Lock metadata is written to `Output/WorktreeRun.lock.json` while the workflow is active.
52
+
- Optional actor tagging: set `FW_BUILD_STARTED_BY=user|agent` (or pass `-StartedBy`) to record who owns the lock.
53
+
54
+
### MSBuild node reuse default
55
+
-`build.ps1` defaults `-NodeReuse` to `false` to reduce cross-worktree lock contention from shared MSBuild worker nodes.
56
+
- If you prefer faster local inner-loop builds and are not running concurrent worktrees, you can opt back in with:
Copy file name to clipboardExpand all lines: .github/instructions/testing.instructions.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,13 @@ The testing infrastructure relies on shared PowerShell modules for consistency:
65
65
-**`Build/scripts/Invoke-CppTest.ps1`**: Backend for native C++ tests (MSBuild/NMake).
66
66
-**`Build/Agent/FwBuildHelpers.psm1`**: Shared logic for VS environment, and process cleanup.
67
67
68
+
## Worktree-aware behavior
69
+
-`test.ps1` scopes process cleanup to the current repository root (`$PSScriptRoot`) so concurrent runs in other worktrees are not terminated.
70
+
-`build.ps1` and `test.ps1` in the same worktree both target `Output/<Configuration>/`; a same-worktree lock prevents concurrent runs and fails fast with owner details.
71
+
-`build.ps1 -RunTests` is supported in the same worktree: the child `test.ps1` run reuses the parent workflow lock.
72
+
- If you need concurrency, use separate git worktrees and run one scripted workflow per worktree.
73
+
- Optional lock ownership tagging: set `FW_BUILD_STARTED_BY=user|agent` (or pass `-StartedBy`) before running scripts.
74
+
68
75
## Debugging & Logs
69
76
-**Logs**: Build logs are written to `Output/Build.log` (if configured) or standard output.
70
77
-**Verbosity**: Use `-Verbosity detailed` with `test.ps1` for more output.
throw"$Context is already running in this worktree (ownerPid=$($ownerDetails.Pid), startedBy=$($ownerDetails.StartedBy), startedAtUtc=$($ownerDetails.StartedAtUtc), context=$($ownerDetails.Context)). Run one build/test workflow at a time per worktree."
196
+
}
197
+
198
+
throw"$Context is already running in this worktree. Run one build/test workflow at a time per worktree."
199
+
}
200
+
201
+
$outputDir=Split-Path-Parent $lockPath
202
+
if (-not (Test-Path-LiteralPath $outputDir-PathType Container)) {
0 commit comments