Repository navigation
[release/10.0.1xx] [build] Fix concurrent SDK version generation. Fixes #26685 - #26869
Conversation
Multi-target assembly-preparer builds can invoke the same Make recipes concurrently. Use process-specific temporary files and atomically publish completed output so one invocation cannot truncate another invocation’s temporary file or expose partially written ProductConstants.cs to a compiler. Clean up temporary files on exit while preserving the error requiring genuine SdkVersions.cs changes to be committed. Let Make own incremental dependency tracking instead of the incorrect and incomplete MSBuild input/output paths. Track the shared recipes and version configuration as Make prerequisites, and quote the project directory passed to make. Fixes #26685 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Extend the generated-source ignore rules to cover the PID-suffixed temporary files used by concurrent generation. The recipes normally remove these files on exit, but an abrupt process termination can bypass cleanup; any leftovers should remain ignored just like the previous shared temporary file. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The generated-source targets consume Make.config.inc, whose writer still used one shared temporary file and removed the published configuration before replacement. Concurrent Make invocations could therefore interfere before reaching the already-protected C# generators. Use a process-specific temporary file, clean it on exit, and preserve the published configuration until the existing atomic rename replaces it. Ignore interrupted-generation leftovers and make the configuration depend on its generator script so changes to that script trigger regeneration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add Make.versions to the Make.config.inc prerequisites because create-make-config.sh uses its history to calculate per-platform NuGet commit distances. This ensures version updates refresh the cached metadata before the generated-source recipes consume it, while unchanged builds remain incremental. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The concurrency-sensitive build changes match the merged upstream fix, but required CI validation is still in progress.
0 open findings
What changed in this PR
Backports the upstream fix for concurrent SDK/version file generation.
Changes:
- Uses process-specific temporary files with atomic publication and cleanup.
- Moves incremental dependency tracking to Make.
- Ignores temporary files left by interrupted builds.
| File | Description |
|---|---|
.gitignore |
Ignores generated configuration temporary files. |
Make.config |
Tracks configuration generator dependencies. |
create-make-config.sh |
Makes configuration generation concurrency-safe. |
tools/assembly-preparer/assembly-preparer.csproj |
Delegates incrementality to Make and quotes the project path. |
tools/common/.gitignore |
Ignores generated-source temporary files. |
tools/common/Make.common |
Atomically generates shared source files. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #180b3d5] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 200 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Multi-target assembly-preparer builds can invoke the same Make recipes concurrently. The shared SdkVersions.cs.tmp file can be truncated by another invocation, causing a false regeneration error, while writing ProductConstants.cs directly can expose incomplete source to a compiler.
Generate both files through process-specific temporary files and atomically publish completed output. Clean up temporary files on exit and ignore leftovers from interrupted builds. Genuine SdkVersions.cs changes still fail the build with the existing instruction to commit the regenerated file.
Let Make own incremental dependency tracking instead of the incorrect and incomplete MSBuild input/output paths. Track the shared recipes and version configuration as Make prerequisites, and quote the project directory passed to make.
Fixes #26685
🤖 Pull request created by Copilot
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com
Co-authored-by: Rolf Bjarne Kvinge rokvin@microsoft.com
Backport of #26687.