-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[WIP-FEATURE] MSBuild server node #7489
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
Merged
MichalPavlik
merged 16 commits into
dotnet:feature/msbuild-server
from
MichalPavlik:dev/mipavlik/msbuild-server-node
Apr 21, 2022
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
afb6e91
Initial commit
MichalPavlik 9ccca49
Fixed problem with handshake
MichalPavlik 50aafb9
Refactoring and removing colors from console write packet
MichalPavlik 44fa2c8
Moving server handshake to shared file so it can be used by client
MichalPavlik a329046
Resolving comments
MichalPavlik 8f17d63
Resolving comments
MichalPavlik f01d0ad
Force ANSI espace codes for console logger and disable lowering prior…
MichalPavlik 55f28e1
Improved flushing logic of console writer
MichalPavlik 015952e
Improved server related packets serialization/deserialization
MichalPavlik 069ce84
Resolving comments
MichalPavlik af559ad
Resolving comments
MichalPavlik 3995cfb
Resolving comments
MichalPavlik e12b50b
Resolving comments (removed low prio and node reuse part in hash comp…
MichalPavlik cb4dea3
Resolving comments
MichalPavlik cce64ba
Resolving conflicts
MichalPavlik 82caefd
Fixed error caused by changed API. Extracted ServerNamedMutex.
MichalPavlik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/Build.UnitTests/BackEnd/RedirectConsoleWriter_Tests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // | ||
|
|
||
| using System; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using Microsoft.Build.Execution; | ||
| using Xunit; | ||
|
|
||
| namespace Microsoft.Build.Engine.UnitTests.BackEnd | ||
| { | ||
| public class RedirectConsoleWriter_Tests | ||
| { | ||
| [Fact] | ||
| public async Task EmitConsoleMessages() | ||
| { | ||
| StringBuilder sb = new StringBuilder(); | ||
| var writer = OutOfProcServerNode.RedirectConsoleWriter.Create(text => sb.Append(text)); | ||
|
|
||
| writer.WriteLine("Line 1"); | ||
| await Task.Delay(300); | ||
| writer.Write("Line 2"); | ||
| writer.Dispose(); | ||
|
|
||
| Assert.Equal($"Line 1{Environment.NewLine}Line 2", sb.ToString()); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/Build/BackEnd/Components/Communications/ServerNodeEndpointOutOfProc.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // | ||
|
|
||
| using Microsoft.Build.Internal; | ||
|
|
||
| namespace Microsoft.Build.BackEnd | ||
| { | ||
| /// <summary> | ||
| /// This is an implementation of INodeEndpoint for the out-of-proc nodes. It acts only as a client. | ||
| /// </summary> | ||
| internal sealed class ServerNodeEndpointOutOfProc : NodeEndpointOutOfProcBase | ||
| { | ||
| private readonly IHandshake _handshake; | ||
|
|
||
| /// <summary> | ||
| /// Instantiates an endpoint to act as a client | ||
| /// </summary> | ||
| /// <param name="pipeName">The name of the pipe to which we should connect.</param> | ||
| /// <param name="handshake"></param> | ||
| internal ServerNodeEndpointOutOfProc( | ||
| string pipeName, | ||
| IHandshake handshake) | ||
| { | ||
| _handshake = handshake; | ||
|
|
||
| InternalConstruct(pipeName); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Returns the host handshake for this node endpoint | ||
| /// </summary> | ||
| protected override IHandshake GetHandshake() | ||
| { | ||
| return _handshake; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // | ||
|
|
||
| namespace Microsoft.Build.BackEnd | ||
| { | ||
| internal enum ConsoleOutput | ||
| { | ||
| Standard = 1, | ||
| Error | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.