Implement out-of-proc RAR node lifecycle #11383
Open
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.
Context
This implements the node lifecycle for an out-of-proc RAR node via an additional
nodemode
.Changes Made
RarNodeLauncher
to run a single instance ofmsbuild.exe /nodemode:3
and validate the node connection.OutOfProcRarNode
as the node implementation backed via named pipes. At the point, the server does not receive or process messages apart from the handshake to validate the connection. The handshake is based on the MSBuild Server handshake implementation, as it avoids baking the process information into the hash.CommunicationUtilities
. This is needed since the RAR node implementation must live inMicrosoft.Build.Tasks
, and either does not have access to specific types, or runs into compile issues due to duplicated types fromMicrosoft.Build.Shared
once referenced inMSBuild
.Testing
New code is largely IO / glue, so I haven't added new UTs. Let me know if anything sticks out to be tested (will likely need to dep inject in next PRs for testing anyways).
You can validate the server, handshake, and exclusivity are working by setting
$env:MSBUILDOUTOFPROCRARNODE=1
and checking tracing logs + active processes.Notes
Microsoft.Build
types, and avoid explicitly using node interfaces. For consistency I'm matching function signatures / types as close as possible in case a future refactor can resolve this (seeOutOfProcRarNode
vsINodeEndpoint,
RarNodeShutdownReasonvs
NodeEngineShutdownReason`).Next PRs will implement the client connection from the RAR task and serialization format.