Repository navigation
Enable the task authoring analyzer and migrate the tasks that need no code changes - #17491
Conversation
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It updates core MSBuild dependencies and expands multithreaded task routing/analyzer enforcement across many tasks, warranting final human verification of build/runtime impacts.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… |
What changed in this PR
Enables MSBuild task multithreading validation and opts a set of tasks into MSBuild’s in-proc multithreaded execution model, primarily by adding [MSBuildMultiThreadableTask], updating MSBuild package versions, and introducing a scoped task authoring analyzer configuration to act as a regression guard.
Changes:
- Updated
Microsoft.Build.*dependencies from17.12.50to18.8.2and introducedMicrosoft.Build.TaskAuthoring.Analyzer(analyzers-only, private assets). - Added
[MSBuildMultiThreadableTask]to a set of tasks across Arcade SDK, Helix SDK, XliffTasks, Packaging, Installers, and Links tasks. - Adjusted
WixToolTaskBaseto resolve tool paths viaTaskEnvironment.GetAbsolutePathto satisfy analyzer expectations and multi-threaded execution semantics.
| File | Description |
|---|---|
| src/Microsoft.DotNet.XliffTasks/Tasks/GatherXlf.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/WaitForHelixJobCompletion.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/StopAzurePipelinesTestRun.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/StartAzurePipelinesTestRun.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/GetHelixWorkItems.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/CreateXUnitWorkItems.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/CreateMTPWorkItems.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/CreateFailedTestsForFailedWorkItems.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/CheckHelixJobStatus.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/CheckAzurePipelinesTestResults.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/CancelHelixJob.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Helix/Sdk/AzureDevOpsTask.cs | Implements IMultiThreadableTask and switches env-var reads to TaskEnvironment. |
| src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs | Resolves tool path using TaskEnvironment.GetAbsolutePath before existence checks / parsing. |
| src/Microsoft.DotNet.Build.Tasks.VisualStudio/Vsix/GetPkgDefAssemblyDependencyGuid.cs | Marks task as multi-threadable; switches base type reference to Task. |
| src/Microsoft.DotNet.Build.Tasks.Packaging/src/SplitDependenciesBySupport.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Packaging/src/GetPackageVersion.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Packaging/src/GetPackageDestination.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Packaging/src/GetMinimumNETStandard.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateMsiVersion.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateGuidFromName.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Build.Tasks.Installers/src/GenerateCurrentVersion.cs | Marks task as multi-threadable. |
| src/Microsoft.DotNet.Arcade.Sdk/src/GroupItemsBy.cs | Marks task as multi-threadable; switches base type reference to Task. |
| src/Microsoft.DotNet.Arcade.Sdk/src/CompareVersions.cs | Marks task as multi-threadable; switches base type reference to Task. |
| src/Microsoft.DotNet.Arcade.Sdk/src/CalculateAssemblyAndFileVersions.cs | Marks task as multi-threadable; switches base type reference to Task. |
| eng/Version.Details.xml | Bumps MSBuild dependency versions and adds analyzer dependency entry. |
| eng/Version.Details.props | Updates MSBuild version properties and introduces analyzer version property. |
| eng/MultiThreadableTaskAnalyzer.globalconfig | Adds scoped configuration for Microsoft.Build.TaskAuthoring.Analyzer and disables selected rules. |
| eng/BuildTask.targets | References analyzer package and wires in the global analyzer config under conditions. |
| Directory.Packages.props | Adds central package version entry for Microsoft.Build.TaskAuthoring.Analyzer. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
aa0b92d to
87a4d00
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Some tasks are opted into multithreaded execution without the TaskEnvironment/IMultiThreadableTask migration needed to ensure path-sensitive operations behave correctly under -mt.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 3
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — TaskEnvironment.GetAbsolutePath(toolPath) will throw if toolPath is null/empty, whereas the… |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… |
Pre-existing issues (1)
| Severity | Finding |
|---|---|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… View comment |
Suppressed comments (1)
eng/BuildTask.targets:45
- This comment says the analyzer is scoped via ".editorconfig", but the scoping is actually done by eng/MultiThreadableTaskAnalyzer.globalconfig (added below via EditorConfigFiles). Updating the comment will avoid confusion when someone tries to adjust analyzer scope/severities.
Analyzer that validates tasks opting into MSBuild's multithreaded execution model via
[MSBuildMultiThreadableTask]. Scoped to those tasks only (see .editorconfig), so it acts as a
regression guard for already-migrated tasks without flagging the ones still to be migrated.
Not available when building from source, where the package feeds aren't reachable.
87a4d00 to
60c8f02
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Several newly-annotated tasks still use raw/relative file paths (e.g., Xliff and aka.ms link tasks) without TaskEnvironment-based path resolution, which can break correctness under in-proc multithreaded execution.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 6
New issues introduced by this change (3)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… |
|
src/Microsoft.DotNet.XliffTasks/Tasks/GatherXlf.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but it… |
Pre-existing issues (4)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — TaskEnvironment.GetAbsolutePath(toolPath) will throw if toolPath is null/empty, whereas the… View comment |
|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… View comment |
Suppressed comments (1)
eng/BuildTask.targets:46
- The analyzer scope note here references ".editorconfig", but the analyzer is actually configured via eng/MultiThreadableTaskAnalyzer.globalconfig (added to EditorConfigFiles below). Updating this comment avoids confusion for future maintainers when they try to adjust analyzer settings.
Analyzer that validates tasks opting into MSBuild's multithreaded execution model via
[MSBuildMultiThreadableTask]. Scoped to those tasks only (see .editorconfig), so it acts as a
regression guard for already-migrated tasks without flagging the ones still to be migrated.
Not available when building from source, where the package feeds aren't reachable.
-->
60c8f02 to
e77d380
Compare
e77d380 to
7031b7b
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It updates core MSBuild dependency versions and changes task execution mode/analyzer enforcement across the repo, which is high-impact and warrants final human validation.
Review tier: Lite
Findings: 6
Pre-existing issues (7)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.XliffTasks/Tasks/GatherXlf.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but it… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — TaskEnvironment.GetAbsolutePath(toolPath) will throw if toolPath is null/empty, whereas the… View comment |
|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… View comment |
Suppressed comments (1)
eng/BuildTask.targets:44
- The comment mentions scoping via ".editorconfig", but this PR actually scopes the analyzer via eng/MultiThreadableTaskAnalyzer.globalconfig (added to EditorConfigFiles below). Updating the comment avoids confusion for future maintainers.
Analyzer that validates tasks opting into MSBuild's multithreaded execution model via
[MSBuildMultiThreadableTask]. Scoped to those tasks only (see .editorconfig), so it acts as a
regression guard for already-migrated tasks without flagging the ones still to be migrated.
7031b7b to
753b263
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It updates core MSBuild dependencies and opt-in multithreaded execution across many tasks, which is broad enough that it warrants final human validation despite only a small number of local review findings.
Review tier: Lite
Findings: 6
Pre-existing issues (7)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.XliffTasks/Tasks/GatherXlf.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but it… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — TaskEnvironment.GetAbsolutePath(toolPath) will throw if toolPath is null/empty, whereas the… View comment |
|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… View comment |
Suppressed comments (1)
eng/BuildTask.targets:44
- The comment says the analyzer is scoped "(see .editorconfig)", but the scoping is actually defined in eng/MultiThreadableTaskAnalyzer.globalconfig (added below and included via EditorConfigFiles). Updating this avoids confusion for future changes to the analyzer scope/settings.
Analyzer that validates tasks opting into MSBuild's multithreaded execution model via
[MSBuildMultiThreadableTask]. Scoped to those tasks only (see .editorconfig), so it acts as a
regression guard for already-migrated tasks without flagging the ones still to be migrated.
753b263 to
df4cbf6
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It changes core build/task infrastructure (MSBuild version bump + new analyzer + multithreaded task opt-in), which has broad ecosystem impact and warrants final human verification.
Review tier: Lite
Findings: 6
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — The constructor XML doc says toolPath is "fully qualified", but the implementation now explicitly… |
|
src/Microsoft.DotNet.Helix/Sdk/AzureDevOpsTask.cs — The TaskEnvironment injection isn’t limited to multithreaded builds; it’s assigned whenever the… |
Pre-existing issues (7)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.XliffTasks/Tasks/GatherXlf.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but it… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View comment |
|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — TaskEnvironment.GetAbsolutePath(toolPath) will throw if toolPath is null/empty, whereas the… View comment |
|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… View comment |
Suppressed comments (1)
eng/BuildTask.targets:45
- The comment says the analyzer is scoped via ".editorconfig", but this PR wires it up using eng/MultiThreadableTaskAnalyzer.globalconfig (added to EditorConfigFiles). Updating the comment would avoid confusion when someone needs to adjust scope/severities later.
Analyzer that validates tasks opting into MSBuild's multithreaded execution model via
[MSBuildMultiThreadableTask]. Scoped to those tasks only (see .editorconfig), so it acts as a
regression guard for already-migrated tasks without flagging the ones still to be migrated.
Not available when building from source, where the package feeds aren't reachable.
df4cbf6 to
b140114
Compare
b140114 to
13c885d
Compare
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The changes are primarily opt-in annotations plus a small, targeted migration to TaskEnvironment, with only a minor documentation clarification recommended.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
eng/BuildTask.targets — The comment says the analyzer is scoped only to tasks opting in via [MSBuildMultiThreadableTask],… |
Issues resolved since last review (9)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Helix/Sdk/AzureDevOpsTask.cs — The TaskEnvironment injection isn’t limited to multithreaded builds; it’s assigned whenever the… View resolved comment |
|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — The constructor XML doc says toolPath is "fully qualified", but the implementation now explicitly… View resolved comment |
|
src/Microsoft.DotNet.XliffTasks/Tasks/GatherXlf.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but it… View resolved comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View resolved comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — These tasks are now annotated as [MSBuildMultiThreadableTask], but AkaMSLinksBase reads… View resolved comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/DeleteAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View resolved comment |
|
src/Microsoft.DotNet.Deployment.Tasks.Links/src/CreateAkaMSLinks.cs — Adding [MSBuildMultiThreadableTask] opts this task into in-proc multithreaded execution, but… View resolved comment |
|
src/Microsoft.DotNet.Build.Tasks.Workloads/src/Wix/WixToolTaskBase.cs — TaskEnvironment.GetAbsolutePath(toolPath) will throw if toolPath is null/empty, whereas the… View resolved comment |
|
eng/BuildTask.targets — The comment says the analyzer scope is configured via ".editorconfig", but this PR wires up… View resolved comment |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It upgrades core MSBuild dependencies and changes execution semantics for multiple tasks, so it warrants final human validation despite the changes being largely mechanical.
Review tier: Lite
Findings: 1
Pre-existing issues (1)
| Severity | Finding |
|---|---|
eng/BuildTask.targets — The comment says the analyzer is scoped only to tasks opting in via [MSBuildMultiThreadableTask],… View comment |
Suppressed comments (1)
eng/BuildTask.targets:46
- The comment says the analyzer is scoped to tasks annotated with [MSBuildMultiThreadableTask], but the globalconfig only scopes rules 0002/0003/0005; other rules (e.g., 0001/0004/0009/0010/0012-0014) still apply to all ITask implementations. Updating the wording avoids implying that non-migrated tasks can never produce analyzer diagnostics.
Analyzer that validates tasks opting into MSBuild's multithreaded execution model via
[MSBuildMultiThreadableTask]. Scoped to those tasks only (see MultiThreadableTaskAnalyzer.globalconfig,
which also pins each rule's severity), so it acts as a regression guard for already-migrated tasks
without flagging the ones still to be migrated.
Not available when building from source, where the package feeds aren't reachable.
Updates Microsoft.Build.* from 17.12.50 to 18.8.2 and references Microsoft.Build.TaskAuthoring.Analyzer, scoped via eng/MultiThreadableTaskAnalyzer.globalconfig to tasks that opt into multithreaded execution. Note that the scope is not limited to tasks carrying [MSBuildMultiThreadableTask]: the analyzer also treats anything implementing IMultiThreadableTask as in scope, and ToolTask implements that interface. Every ToolTask-derived task in the repo is therefore analyzed as of this change, which is why WixToolTaskBase needs to resolve its tool path up front. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: be19d794-fe4f-43fe-9e6e-f6e6b13ec6e7
Annotates the tasks whose migration required no behavioral change: the diff is the [MSBuildMultiThreadableTask] attribute, IMultiThreadableTask, and the injected TaskEnvironment property. The analyzer enabled in the previous commit verifies each of them reads no ambient process state. AzureDevOpsTask is the one exception to annotation-only. It is the base of the annotated Azure Pipelines tasks and reads BUILD_BUILDNUMBER and friends straight off the process, so those reads move to TaskEnvironment. The analyzer does not catch this on its own, since it does not resolve the virtual dispatch from Execute into the base. Excluded from this change are the tasks whose migration replaced Path.GetFullPath with TaskEnvironment.GetAbsolutePath. AbsolutePath does not normalize, so those are behavior changes in classic mode too and are tracked separately. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: be19d794-fe4f-43fe-9e6e-f6e6b13ec6e7
13c885d to
3351e76
Compare
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It upgrades core MSBuild dependencies and introduces new analyzer enforcement that can have broad build impact across task projects and build environments.
Review tier: Lite
Findings: None
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
eng/BuildTask.targets — The comment says the analyzer is scoped only to tasks opting in via [MSBuildMultiThreadableTask],… View resolved comment |
The merge picks up analyzer 18.12 and the globalconfig from dotnet#17491, which enables MSBuildTask0013 and deepens the MSBuildTask0005 call-chain analysis. Both report on tasks this branch deliberately leaves out of the migration. MSBuildTask0013 flags a task that declares IMultiThreadableTask without [MSBuildMultiThreadableTask]. That combination is intentional here and each class already documents why: the interface is what makes MSBuild assign TaskEnvironment (TaskExecutionHost only tests the interface, so it is assigned in the task host too), while the attribute alone decides routing. Suppressed at each of the 13 declarations rather than in the globalconfig, so the rule keeps guarding against an accidental half-migration everywhere else. MSBuildTask0005 reports 150 file system calls reached through the SignTool and Workloads helper chains. Those chains are the documented reason SignToolTask and CreateVisualStudioWorkload are not opted in, so the tasks stay out-of-proc and the calls remain correct. Neither project contains a task carrying the attribute, so the rule has nothing in scope there today; suppressed per project with a pointer to the class comments and issue dotnet#17378. Verified the rule still fires elsewhere by temporarily reintroducing a violation in Arcade.Sdk. Also extends the existing NuGetVersionUpdater suppression to 0005, which now reports the same already-justified Path.GetTempPath call transitively. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: be19d794-fe4f-43fe-9e6e-f6e6b13ec6e7


Extracted from #17381 to reduce that PR's diff and isolate risk.
Two commits:
Enable the MSBuild task authoring analyzer — bumps
Microsoft.Build.*17.12.50 → 18.8.2 and addsMicrosoft.Build.TaskAuthoring.Analyzer, scoped viaeng/MultiThreadableTaskAnalyzer.globalconfigto tasks that opt into multithreaded execution.Worth calling out: the scope is not limited to tasks carrying
[MSBuildMultiThreadableTask]. The analyzer also treats anything implementingIMultiThreadableTaskas in scope, andToolTaskimplements it — so everyToolTask-derived task in the repo is analyzed as of this change.WixToolTaskBaseis the only one that trips it today, hence the tool path resolution there.Opt tasks that need no code changes into multithreaded execution — 24 tasks whose migration required no behavioral change. The diff per file is the attribute, the interface, and the injected
TaskEnvironmentproperty.AzureDevOpsTaskis the one exception to annotation-only. It is the base of the annotated Azure Pipelines tasks and readsBUILD_BUILDNUMBERand friends straight off the process, so those reads move toTaskEnvironment. The analyzer does not catch this by itself — it does not resolve the virtual dispatch fromExecuteinto the base — so it was found by inspection rather than by the build.What was deliberately left out
Every task whose migration replaced
Path.GetFullPathwithTaskEnvironment.GetAbsolutePath, per #17381 (comment).AbsolutePathdoes not normalize, so those are behavior changes in classic mode too, not just under-mt. That rules outLocateDotNet,PackageIndex,GenerateFileFromTemplate,GetCMakeArtifactsFromFileApi,GenPartialFacadeSourceGenerator,SignToolTask,GatherTranslatedSourceandTranslateSource— three more than the comment named.ValidateFrameworkPackageis annotation-only on its own but reachesPackageIndex.Load, so it drops out withPackageIndexand the analyzer confirms it.Local
build.cmdis clean with the analyzer enforcing.