Commit 8a3ceed
build(cli): skip SignaturesGen regen in CI to break the Reactor.Localization.Generator file-lock race
Root cause of the recurring CI "Unit Tests" failure on PR #437 and
sporadically on main: `src/Reactor.Cli/Reactor.Cli.csproj` declares a
`BeforeBuild` Exec target that shells out to a nested
`dotnet build Reactor.SignaturesGen.csproj`. SignaturesGen
ProjectReferences `Reactor.csproj`, which ProjectReferences
`Reactor.Localization.Generator`. The OUTER build (`dotnet test
tests/Reactor.Tests`) already produces
`obj/x64/Debug/netstandard2.0/Reactor.Localization.Generator.dll`
because `Reactor.Tests.csproj` directly references that project too.
The outer and nested `dotnet build` processes have their own
VBCSCompiler instances and don't coordinate — they race on the same
output dll. The second writer hits CSC error CS2012 ("Cannot open ...
for writing -- file may be locked by 'VBCSCompiler'"). The race window
scales with project size, which is why PR #437's increased compile
load triggers it consistently.
The committed `skills/reactor.api.txt` is what pack
(`Reactor.csproj:134`) and embed (`Reactor.Cli.csproj:84`) consume,
both gated `Condition="Exists(...)"`. CI never actually needs to regen
api.txt — it's a dev-machine convenience step.
Fix: add `and '$(CI)' != 'true'` to the RunSignaturesGen Target's
Condition. GitHub Actions sets `CI=true` as an env var; MSBuild picks
it up as `$(CI)`. Verified locally:
- `unset CI; dotnet build src/Reactor.Cli` — RunSignaturesGen fires
(nested build runs, fast-up-to-date-checks skip everything since
outputs are current).
- `CI=true dotnet build src/Reactor.Cli` — RunSignaturesGen fully
skipped (zero "RunSignaturesGen" / "SignaturesGen.csproj" mentions
in verbose log).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 122e839 commit 8a3ceed
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
113 | 125 | | |
114 | | - | |
| 126 | + | |
115 | 127 | | |
116 | 128 | | |
117 | 129 | | |
| |||
0 commit comments