Migrate Tasks in the MSbuild repo to the new Task type
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
MSBuild ships around a hundred tasks. Each one has to declare that it is safe to run on a thread node, and stop using process-wide state, before it can run in multithreaded mode. Tasks that are not migrated still work, but they run in a separate task host process, which is slower.
Most tasks are done: 67 of 82 MSBuild tasks enlightened (82%). What is left would be migrated on demand if telemetry or perf tests would show its benefit.
## Steps
- [x] Migrate the tasks that only needed the attribute [size M]
- [x] Migrate the complex tasks: RAR, Copy, Exec, ToolTask and the manifest tasks [size XL]
- [ ] Migrate the remaining tasks [size L]
## Stakeholders
Everyone building with `-mt`. Every task left unmigrated falls back to a task host process and slows the build down.
## Definition of done
Every task in the MSBuild repo either runs in multithreaded mode, or is recorded as intentionally left out.
Migration checklist and difficulty table
Checklist
## No Modifications Required (added attribute only, no IMultiThreadableTask)
- [x] AssignCulture
- [x] AssignLinkMetadata
- [ ] [CallTarget (public)](https://github.com/dotnet/msbuild/issues/13611)
- [x] CallTarget (intrinsic)
- [x] CombinePath
- [x] CombineTargetFrameworkInfoProperties
- [x] CombineXmlElements
- [x] ConvertToAbsolutePath
- [x] CreateProperty
- [x] Error
- [x] ErrorFromResources
- [x] FindAppConfigFile
- [x] FindInList
- [x] FindInvalidProjectReferences
- [x] FormatVersion
- [x] GetCompatiblePlatform
- [x] Hash
- [x] Message
- [x] MSBuildInternalMessage
- [x] RemoveDuplicates
- [x] SetRidAgnosticValueForProjects
- [x] Telemetry
- [x] Warning
## Abstract/Base Classes (no transition required)
- [x] ~~AppDomainIsolatedTaskExtension~~
- [x] ~~AxTlbBaseTask~~
- [x] ~~CreateManifestResourceName~~
- [x] ~~GenerateManifestBase~~
- [x] ~~ResolveProjectBase~~
- [x] ~~RoslynCodeTaskFactoryCompilerBase~~
- [x] ~~TaskExtension~~
- [x] ~~TaskRequiresFramework~~
- [x] ~~ToolTaskExtension~~
- [x] ~~XamlDataDrivenToolTask~~
## Complicated Tasks (might require significant refactoring)
- [x] Copy
- [x] [Exec](https://github.com/dotnet/msbuild/issues/13170)
- [ ] ResolveAssemblyReference
## Other tasks with potential issues with static caches (they use ToolLocationHelper)
- [x] ToolTask
- [x] [AddToWin32Manifest](https://github.com/dotnet/msbuild/issues/13172)
- [x] AL
- [x] AspNetCompiler
- [ ] GenerateResource.ResGen
- [x] GetFrameworkPath
- [x] GetFrameworkSdkPath
- [x] [GetInstalledSDKLocations](https://github.com/dotnet/msbuild/issues/13562)
- [x] GetReferenceAssemblyPaths
- [ ] [GetSDKReferenceFiles](https://github.com/dotnet/msbuild/issues/13663)
- [ ] ResolveComReference
- [x] RoslynCodeTaskFactoryCSharpCompiler
- [x] RoslynCodeTaskFactoryVisualBasicCompiler
- [x] SGen
## Tasks with simple transition
- [ ] MSBuild (public)
- [x] MSBuild (intrinsic)
- [x] Delete
- [x] DownloadFile
- [x] GetFileHash
- [x] ReadLinesFromFile
- [x] VerifyFileHash
- [x] WriteLinesToFile
- [x] MakeDir
- [x] Move
- [x] RemoveDir
- [x] Touch
- [x] Unzip
- [x] WriteCodeFragment
- [x] XmlPeek
- [x] XmlPoke
- [x] XslTransformation
- [x] ZipDirectory
## Other (either simple or with unknown issues)
_Difficulty: 1 = attribute-only, 2 = `IMultiThreadableTask` + a few path absolutizations, 3 = multiple inputs / batch I/O, 4 = ToolTask / `GenerateManifestBase` / static caches, 5 = AppDomain / COM / native interop. Sorted hardest-first._
| Task | PR | Difficulty | Reasoning |
|------|----|:----------:|-----------|
| [RegisterAssembly](https://github.com/dotnet/msbuild/issues/13630) | — | 5 | NETFX-only, `AppDomain`, COM, registry mutation |
| [UnregisterAssembly](https://github.com/dotnet/msbuild/issues/13634) | — | 5 | NETFX-only, `AppDomain`, COM, registry |
| [GenerateApplicationManifest](https://github.com/dotnet/msbuild/issues/13172) ✅| #13177 | 4 | `GenerateManifestBase`, many file inputs, signing |
| [GenerateBootstrapper](https://github.com/dotnet/msbuild/issues/13627) | — | 4 | Default OutputPath uses CWD; heavy `BootstrapperBuilder` I/O |
| [GenerateDeploymentManifest](https://github.com/dotnet/msbuild/issues/13172) ✅| #13177 | 4 | `GenerateManifestBase`; deployment-specific paths |
| [LC](https://github.com/dotnet/msbuild/issues/13629) ✅ | #13786 | 4 | ToolTask wrapping `lc.exe`; SDK lookup, many inputs |
| [ResolveNativeReference](https://github.com/dotnet/msbuild/issues/13631) | — | 4 | Manifest reader, many `[Output]` item groups, native interop |
| [ResolveSDKReference](https://github.com/dotnet/msbuild/issues/13632) | — | 4 | 75 KB, static caches, `ToolLocationHelper` dependencies |
| [AxImp](https://github.com/dotnet/msbuild/issues/13626) ✅| #13682 | 3 | ToolTask wrapping `AxImp.exe`; shares `AxTlbBaseTask` with TlbImp |
| [GenerateBindingRedirects](https://github.com/dotnet/msbuild/issues/13625) ✅| #13771 | 3 | `App.config` read/write, multiple path I/O, XML rewriting |
| [GenerateLauncher](https://github.com/dotnet/msbuild/issues/13628) ✅| #13699 | 3 | `LauncherBuilder` file copy/patch; few inputs |
| [ResolveManifestFiles](https://github.com/dotnet/msbuild/issues/13172) ✅| #13177 | 3 | Many file inputs; satellite/PDB resolution |
| [TlbImp](https://github.com/dotnet/msbuild/issues/13633) ✅ | #13708 | 3 | ToolTask wrapping `TlbImp.exe`; shares base with AxImp |
| [UpdateManifest](https://github.com/dotnet/msbuild/issues/13172)✅ | #13177 | 3 | XML manifest read/write |
| [WinMDExp](https://github.com/dotnet/msbuild/issues/13635) ✅| #13682 | 3 | ToolTask wrapping `winmdexp.exe`; modest path surface |
| AssignTargetPath ✅ | merged via #13415 | 2 | Already migrated |
| [CreateCSharpManifestResourceName](https://github.com/dotnet/msbuild/issues/13172) ✅| — | 2 | Subclass of `CreateManifestResourceName`; resource path manipulation |
| [CreateItem](https://github.com/dotnet/msbuild/issues/13568) | #13590 | 2 | Item shuffling with light path absolutization |
| [CreateVisualBasicManifestResourceName](https://github.com/dotnet/msbuild/issues/13172) ✅| — | 2 | Same shape as the C# variant |
| FindUnderPath ✅ | merged via #13462 | 2 | Already migrated |
| [FormatUrl](https://github.com/dotnet/msbuild/issues/13567) ✅ | #13573 | 2 | URI/path absolutization on a single input |
| [GenerateTrustInfo](https://github.com/dotnet/msbuild/issues/13619) | #13622 | 2 | NETFX-only manifest read/write; small surface |
| [GetAssembliesMetadata](https://github.com/dotnet/msbuild/issues/13570) | #13637 | 2 | `MetadataReader` over assembly list |
| [GetAssemblyIdentity](https://github.com/dotnet/msbuild/issues/13571) ✅| #13588 | 2 | `AssemblyName.GetAssemblyName` per input |
| [ResolveCodeAnalysisRuleSet](https://github.com/dotnet/msbuild/issues/13569) | #13636 | 2 | Single ruleset path resolved against include dirs |
| [ResolveKeySource](https://github.com/dotnet/msbuild/issues/13620) | #13623 | 2 | Path absolutization for key file / certificate |
| [SignFile](https://github.com/dotnet/msbuild/issues/13618) | #13621 | 2 | `signtool` wrapper; single path input |
| [AssignProjectConfiguration](https://github.com/dotnet/msbuild/issues/13613)✅ | #13615 | 1 | Attribute-only — no shared mutable state |
| [RequiresFramework35SP1Assembly](https://github.com/dotnet/msbuild/issues/13572) ✅ | merged via #13575 | 1 | Already migrated |
| [ResolveNonMSBuildProjectOutput](https://github.com/dotnet/msbuild/issues/13612) | #13614 | 1 | Attribute-only — pre-resolved paths from VS IDE |
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.