-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Implement out-of-proc RAR node lifecycle #11383
base: main
Are you sure you want to change the base?
Conversation
Would you be able to separate the pure code moves and actual code changes? It's fine to keep all in a single PR, but separate commits would be great. It'll help speed up and focus the reviews. |
5223113
to
e41a063
Compare
e41a063
to
4ba973c
Compare
FYI I'm separating the code moves (named pipe / IPC stuff) into another PR since I've been further consolidating the IPC code that's duplicated across all node implementations, and that's a bit more risk given the different code paths for the APM and TPL-based versions due to .NET 3.5 compat for the TaskHost. Will be updating the main work item with the overall design / ordering of PRs so it helps to see where this is going, since there's still ~5 or so main components after this. But that should be the only real code move / refactoring required for the whole project. |
Context
This implements the node lifecycle for an out-of-proc RAR node via an additional
nodemode
. This is effectively the minimal implementation for the node server, aka only the setup and connection flow. Next PR will plumb the out-of-proc flag through to the actual RAR task and set up the real pipe client.Changes Made
3 main parts to this:
RarNodeLauncher
to run a single instance ofmsbuild.exe /nodemode:3
and validate the node connection.OutOfProcRarNode
as the node implementation backed via named pipes. It 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`).