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
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,23 @@ 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 `auto`.
56
+
- In `auto` mode, MSBuild node reuse is enabled when the repository has a single local worktree and disabled when multiple local worktrees are detected, reducing cross-worktree lock contention from shared worker nodes.
57
+
- You can still override the policy explicitly 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."
201
+
}
202
+
203
+
throw"$Context is already running in this worktree. Run one build/test workflow at a time per worktree."
204
+
}
205
+
206
+
$outputDir=Split-Path-Parent $lockPath
207
+
if (-not (Test-Path-LiteralPath $outputDir-PathType Container)) {
Copy file name to clipboardExpand all lines: ReadMe.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,14 @@ FieldWorks uses the **MSBuild Traversal SDK** for declarative, dependency-ordere
36
36
37
37
For detailed build instructions, see [.github/instructions/build.instructions.md](.github/instructions/build.instructions.md).
38
38
39
+
### Concurrent worktree builds/tests
40
+
41
+
`build.ps1` and `test.ps1` use worktree-aware process cleanup, so running scripted builds/tests in different git worktrees does not kill each other.
42
+
43
+
Within a single worktree, builds and tests run one at a time: scripts acquire a worktree lock and fail fast if another scripted workflow is active.
44
+
45
+
You can tag lock ownership for diagnostics with `FW_BUILD_STARTED_BY=user|agent` (or `-StartedBy user|agent`).
46
+
39
47
## Building Installers (WiX 3 default, WiX 6 opt-in)
40
48
41
49
Installer builds default to **WiX 3** (legacy batch pipeline) using inputs in `FLExInstaller/` and `PatchableInstaller/`. The **Visual Studio WiX Toolset v3 extension** is required so `Wix.CA.targets` is available under the MSBuild extensions path. Use `-InstallerToolset Wix6` to opt into the WiX 6 SDK-style path (restored via NuGet).
0 commit comments