Repository navigation
Reject file-access reporting with multithreaded builds - #14871
Merged
JanProvaznik merged 4 commits intoSep 21, 2026
Merged
Conversation
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 85b185e7-08c7-4a95-aa04-d674ec05a321
Member
Author
|
/review |
JanProvaznik
marked this pull request as ready for review
September 8, 2026 15:35
JanProvaznik
temporarily deployed
to
copilot-pat-pool
September 8, 2026 15:35 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It changes wire protocol/versioning and TaskHost/engine execution behavior in a broad, compatibility-sensitive area that warrants final human review.
Pull request overview
This PR improves compatibility and correctness of file-access reporting when tasks execute in out-of-proc TaskHosts, especially under experimental multi-threaded (-mt) builds, while preserving backward-compatible TaskHost packet behavior.
Changes:
- Fixes
FileAccessDataround-tripping by avoiding struct boxing during TaskHost completion packet deserialization. - Propagates and gates
ReportFileAccessesacross TaskHost configuration + replay, and rejects-mtcombined with-reportFileAccesses(CLI +BuildManager). - Updates protocol versioning, resources/localization, unit tests, and multithreading spec documentation accordingly.
File summaries
| File | Description |
|---|---|
| src/Shared/TaskHostTaskComplete.cs | Fix struct translation to preserve FileAccessData through deserialization. |
| src/Shared/TaskHostConfiguration.cs | Add versioned ReportFileAccesses flag to TaskHost configuration packet. |
| src/MSBuild/XMake.cs | Reject incompatible -mt + -reportFileAccesses at command-line parsing. |
| src/MSBuild/TaskExecutionContext.cs | Add per-task file-access collection gated by configuration. |
| src/MSBuild/OutOfProcTaskHostNode.cs | Collect file accesses per task execution context and serialize per-task results. |
| src/MSBuild/Resources/Strings.resx | Add MSB1073 message for incompatible switch combination. |
| src/MSBuild/Resources/xlf/Strings.zh-Hant.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.zh-Hans.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.tr.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.ru.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.pt-BR.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.pl.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.ko.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.ja.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.it.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.fr.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.es.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.de.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild/Resources/xlf/Strings.cs.xlf | Localized resource entry for MSB1073 (new string). |
| src/MSBuild.UnitTests/XMake_Tests.cs | Add CLI and TaskHost behavior regression coverage (incompatibility + file access transport). |
| src/Framework/BackEnd/NodePacketTypeExtensions.cs | Bump packet version and define min version for new TaskHostConfiguration field. |
| src/Build/Instance/TaskFactories/TaskHostTask.cs | Propagate ReportFileAccesses into TaskHost config; gate replay on build parameters. |
| src/Build/BackEnd/BuildManager/BuildParameters.cs | Document incompatibility between MultiThreaded and ReportFileAccesses. |
| src/Build/BackEnd/BuildManager/BuildManager.cs | Reject incompatible combination for programmatic callers at BeginBuild. |
| src/Build/Resources/Strings.resx | Add engine-level error string for incompatible configuration. |
| src/Build/Resources/xlf/Strings.zh-Hant.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.zh-Hans.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.tr.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.ru.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.pt-BR.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.pl.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.ko.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.ja.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.it.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.fr.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.es.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.de.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build/Resources/xlf/Strings.cs.xlf | Localized resource entry for engine-level incompatible configuration (new string). |
| src/Build.UnitTests/BackEnd/TaskHostTaskComplete_Tests.cs | Add regression test ensuring FileAccessData round-trips correctly. |
| src/Build.UnitTests/BackEnd/TaskHostFactory_Tests.cs | Add regression tests for TaskHost gating + replay logic. |
| src/Build.UnitTests/BackEnd/TaskHostConfiguration_Tests.cs | Add regression tests for protocol-version-gated ReportFileAccesses. |
| src/Build.UnitTests/BackEnd/BuildManager_Tests.cs | Add regression test for programmatic incompatibility rejection pre-build. |
| documentation/specs/multithreading/multithreaded-msbuild.md | Document /reportfileaccesses incompatibility with current MT implementation. |
Review details
- Files reviewed: 43/43 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
dfederm
approved these changes
Sep 8, 2026
Keep this PR focused on rejecting multithreaded builds with file-access reporting. Defer the TaskHost transport, collection, and replay repairs, leaving its protocol version and implementation identical to main. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 85b185e7-08c7-4a95-aa04-d674ec05a321
AR-May
approved these changes
Sep 17, 2026
AR-May
left a comment
Member
There was a problem hiding this comment.
Overall looks good to me. We probably should keep an open issue for fixing incompatibility of those two features to the backlog?
Move file-access reporting into a known-incompatibilities section. Clear deferred build messages in a finally block when BeginBuild throws, with regression coverage to prevent leaking messages into later builds. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 85b185e7-08c7-4a95-aa04-d674ec05a321
Member
Author
JanProvaznik
enabled auto-merge (squash)
September 17, 2026 14:24
AR-May
approved these changes
Sep 21, 2026
JanProvaznik
deleted the
janprovaznik-fix-mt-project-cache-compatibility
branch
September 21, 2026 10:09
This was referenced Sep 21, 2026
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #14825
Summary
-mttogether with-reportFileAccessesusing actionableMSB1073, rather than failing later with an internal node-allocation error.BuildManagercallers.Compatibility and scope
Project-cache lookup/materialization remains compatible with MT. Only the unsupported combination of MT and Detours-based file-access reporting is rejected. Either mode remains available individually.
TaskHost supplemental file-access reporting repairs for #14824 and #14826 are deferred. This PR no longer changes TaskHost transport, collection, replay, or deserialization, and does not bump the packet protocol version. Ordinary native Detours tracking is separate from those supplemental reports.
Merged current
main, preserving its TaskHost ownership, cancellation, and console-forwarding changes.Validation