Support launching net taskhost - initial implementation#11393
Conversation
2d1cd86 to
9b892e9
Compare
baronfel
left a comment
There was a problem hiding this comment.
Some general questions as I was idly looking at the work so far :) Happy to see this start!
ad14fb9 to
65691df
Compare
32d4391 to
17589bb
Compare
rainersigwald
left a comment
There was a problem hiding this comment.
Blocking things:
- breaking net-taskhost-on-net-msbuild
- me understanding the "find dotnet & msbuild.exe" plumbing plan.
1cd482f to
8d5449d
Compare
fd6a1c7 to
f50e7de
Compare
JanProvaznik
left a comment
There was a problem hiding this comment.
looks good, adding some comments
hopefully my comment on netcore-launching-netcore helps
6f29a34 to
d68e199
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR implements initial support for launching the .NET task host by updating the handshake mechanism and environment variable handling. Key changes include refactoring handshake data handling (migrating from raw int arrays to a structured HandshakeComponents type), introducing new environment variables and constants for .NET tools and assembly directories, and updating related tests and documentation comments.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Shared/NodePipeServer.cs | Refactored the handshake loop to use the new HandshakeComponents structure and renamed index usage. |
| src/Shared/NodePipeClient.cs | Updated handshake enumeration and trace messages to reflect the new structure. |
| src/Shared/NodePipeBase.cs | Changed HandshakeComponents type from int[] to a structured type. |
| src/Shared/NodeEndpointOutOfProcBase.cs | Refactored handshake processing and introduced version mismatch logic for NET hosts. |
| src/Shared/CommunicationsUtilities.cs | Updated handshake component creation and introduced the new HandshakeComponents struct. |
| src/Shared/BuildEnvironmentHelper.cs | Added environment variable support for MSBuildToolsDirectoryNET and MSBuildAssemblyDirectory. |
| src/MSBuild/MSBuild/Microsoft.Build.Core.xsd | Updated supported runtime enumeration to include NET. |
| src/Build/Resources/Constants.cs | Introduced new constant definitions for dotnet process and MSBuild assembly/executable names. |
| src/Build/Instance/TaskFactories/TaskHostTask.cs | Updated task host creation to include a new runtime parameter. |
| src/Build/Evaluation/IntrinsicFunctions.cs | Simplified dictionary initialization for handshake parameter creation. |
| src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs | Fixed variable naming in assembly location checks and streamlined comment formatting. |
| src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcTaskHost.cs | Enhanced MSBuild location resolution for both NET and non-NET contexts. |
| src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs | Refactored handshake writing to use the new structured components in node connections. |
| src/Build/BackEnd/Components/Communications/NodeLauncher.cs | Minor comment fixes regarding recursion wording. |
| src/Build/BackEnd/Components/Communications/DetouredNodeLauncher.cs | Updated use of constants for dotnet process name in breakaway child process definitions. |
| src/Build/BackEnd/Components/Communications/CurrentHost.cs | Updated dotnet executable resolution to use newly defined constant names. |
| src/Build.UnitTests/BackEnd/TaskHostConfiguration_Tests.cs | Updated test parameters to use a literal "TaskHost" runtime string. |
| .editorconfig | Inadvertent BOM character appears to be introduced in the file. |
cb1760c to
03360e0
Compare
JanProvaznik
left a comment
There was a problem hiding this comment.
See question. Otherwise LGTM as a big step forward in this epic.
Though, I'd appreciate if this PR or the subsequent connected ones added some e2e-ish tests - run framework msbuild on a realistic projectfile which requires net taskhost. This will also uncover other unexpected cases which might require nicer error messages.
…//github.com/YuliiaKovalova/msbuild into dev/ykovalova/support_launching_net_taskhost
Partially Fixes #11331
To test the feature, setup these env variables:
MSBuildToolsDirectoryNET= e.g. "C:\msbuild\msbuild_yk\msbuild\artifacts\bin\bootstrap\core"MSBuildAssemblyDirectory= e.g. "C:\msbuild\msbuild_yk\msbuild\artifacts\bin\bootstrap\core\sdk\9.0.203"Keep in mind, due to current handshake mechanism, only matching (or adjusted with this change) version of sdk can be launched.