-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Use TaskHostFactory to resolve file lock issues and simplify tasks build #122525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR resolves file locking issues with MSBuild tasks by adopting TaskHostFactory and simplifies the tasks build process by removing .NET Framework support and custom incremental build logic.
- Removes complex incremental build logic that used synthetic inputs/outputs to avoid file locks
- Standardizes all MSBuild task invocations to use TaskHostFactory with Runtime="NET"
- Simplifies task projects to only target .NET Core (removing .NET Framework multi-targeting)
- Removes the RegenerateDownloadTable task and associated infrastructure which was no longer needed
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tasks/tasks.proj | Removed the BuildIncrementally target and GetTasksSrc logic that implemented custom incremental build behavior |
| src/tasks/installer.tasks/installer.tasks.csproj | Changed to target only NetCoreAppToolCurrent, reverted NuGet.Packaging to use PackageDownloadAndReference for net8.0 |
| src/tasks/installer.tasks/RegenerateDownloadTable.cs | Deleted entire RegenerateDownloadTable task class (198 lines) |
| src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | Updated to target only NetCoreAppToolCurrent, changed UsingTask to use $(TargetPath) and added Runtime="NET" with TaskHostFactory |
| src/tasks/Directory.Build.targets | Added condition to exclude 'tasks' project from package references, reordered condition clauses |
| src/tasks/Crossgen2Tasks/Crossgen2Tasks.csproj | Reverted from PackageReference to PackageDownloadAndReference for NuGet packages targeting net8.0 |
| src/native/libs/build-native.proj | Changed from Traversal to NoTargets SDK, added AndroidAppBuilder project reference, updated UsingTask with TaskHostFactory and DependsOnTargets |
| src/mono/sample/Directory.Build.targets | Added Runtime="NET" attribute to GenerateRunScript UsingTask |
| src/libraries/pretest.proj | Added installer.tasks project reference and Runtime="NET" TaskFactory="TaskHostFactory" to two UsingTask declarations |
| src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj | Changed to single TargetFramework, simplified package references, updated UsingTask to use $(TargetPath) with Runtime="NET" TaskHostFactory |
| eng/testing/tests.targets | Added Runtime="NET" TaskFactory="TaskHostFactory" to GenerateRunScript UsingTask |
| eng/testing/bump-chrome-version.proj | Converted to NoTargets SDK with project reference and proper target dependencies, added TaskHostFactory |
| eng/regenerate-third-party-notices.proj | Added installer.tasks project reference, added Runtime="NET" TaskFactory="TaskHostFactory" and DependsOnTargets |
| eng/regenerate-download-table.proj | Deleted entire project file (44 lines) for regenerating the download table |
| eng/Subsets.props | Removed 'regeneratedownloadtable' from AllSubsetsExpansion and removed the entire RegenerateDownloadTable subset definition and ProjectToBuild section |
| docs/project/dogfooding.md | Removed the "Daily builds table" section with all platform download links (220 lines) |
| Directory.Build.props | Simplified InstallerTasksAssemblyPath to single line targeting only NetCoreAppToolCurrent |
| Build.proj | Moved tasks.proj to always build as ProjectReference, removed BuildLocalTasks target with custom MSBuild invocation |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| <PropertyGroup> | ||
| <TargetFrameworks>$(NetCoreAppToolCurrent);$(NetFrameworkToolCurrent)</TargetFrameworks> | ||
| <TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we apply the same change in Microsoft.NET.HostModel.csproj (for net11.0), or is it too early?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only when Microsoft.NET.Build.Tasks switched to be core only. We are investigating the perf impact of that.
| </AndroidLibBuilderTask> | ||
| </Target> | ||
|
|
||
| <Target Name="BinPlaceNative" AfterTargets="BuildNativeUnix;BuildNativeWindows"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be named GetBinPlaceItems (referenced in arcade)?
| <Target Name="BinPlaceNative" AfterTargets="BuildNativeUnix;BuildNativeWindows"> | |
| <Target Name="GetBinPlaceItems" AfterTargets="BuildNativeUnix;BuildNativeWindows"> |
Fixes dotnet/dotnet#3875