Skip to content
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

RAR as a service - Node startup #5613

Merged
merged 75 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b487366
Adding MSBuild.Tasks to MSBuild
Jul 30, 2020
b7a7943
RAR node provider
Aug 5, 2020
58e07d7
RAR controller and client
Aug 5, 2020
5dc0367
References
Aug 5, 2020
3865c75
Merge remote-tracking branch 'ms/master' into rarAsService/node
Aug 5, 2020
55268c1
Chganes based on comment in PR review
Aug 6, 2020
e65c3f3
Merge remote-tracking branch 'ms/master' into rarAsService/node
Aug 6, 2020
5ebe6f7
PR comments
Aug 6, 2020
de63fce
Update src/Shared/CommunicationsUtilities.cs
ostorc Aug 6, 2020
ba9af0a
PR comments
Aug 6, 2020
331f113
Merge branch 'rarAsService/node' of https://github.com/ostorc/msbuild…
Aug 6, 2020
268b4d7
PR comments
Aug 10, 2020
332a5af
StremJsonRpc upgrade and json fix
Aug 12, 2020
be02cdf
Worker to Special (rename)
Aug 12, 2020
23cd78c
Merge remote-tracking branch 'ms/master' into rarAsService/node
Aug 12, 2020
356a33a
Build fix
Aug 12, 2020
f543437
Handshake validation
Aug 12, 2020
bd0a663
RAR shutdown on its own
Aug 12, 2020
d4a7d4f
Node startup reworked
Aug 13, 2020
80a9364
Small fixes
Aug 13, 2020
95bd354
PR comments
Aug 14, 2020
e0b4033
Merge branch 'master' into rarAsService/node
Aug 14, 2020
ef6555e
PR Comments
Aug 14, 2020
42d330a
extra commit
Forgind Aug 14, 2020
59a5df0
Typo
Aug 14, 2020
fd54e2e
Remove dummy method
Aug 14, 2020
6e16aef
ref
Aug 14, 2020
a64202a
Apply suggestions from code review
ostorc Aug 15, 2020
3b98023
Update src/Tasks/ResolveAssemblyReferences/RpcUtils.cs
ostorc Aug 15, 2020
bf74722
PR Comments
Aug 15, 2020
dfdd2d3
PR Comments
Aug 17, 2020
f940974
Merge branch 'master' into rarAsService/node
Aug 17, 2020
1836057
Version change
Aug 18, 2020
639cd58
Merge branch 'exp/rarAsService' of https://github.com/dotnet/msbuild …
Aug 18, 2020
55ad2b3
Missing dlls fix
Aug 20, 2020
5e13ec5
Merge branch 'rarAsService/node' into exp/rarAsService
Aug 20, 2020
8640658
FIX typo
Aug 20, 2020
d15f6bf
Signing
Aug 20, 2020
3dbeee1
Triger commit
Aug 20, 2020
c325a1f
extra commit
Aug 20, 2020
1ca36f2
Merge 'master' into 'rarAsService/node'
Aug 21, 2020
a0c2fc8
GetRarPipeName fix
Aug 21, 2020
0abc9cc
Fixes from exp branch
Aug 21, 2020
7c9379d
Missing files
Aug 21, 2020
9ab82b9
Merge branch 'rarAsService/node' into exp/rarAsService
Aug 21, 2020
d48a5a9
MessagePack signing
Aug 22, 2020
bf9abf8
Ngen priority
Aug 22, 2020
d26b3d2
Merge branch 'master' into rarAsService/node
Aug 24, 2020
28228cc
Remove Newtonsoft.Json dll
Aug 24, 2020
af35387
Remove binding redirect
Aug 24, 2020
192e0a2
Remove Tasks.Core dependency
Aug 26, 2020
93bfc4b
Fixed constructor
Aug 26, 2020
a305e82
Remove exe location from OutOfProcNode
Aug 26, 2020
9a27bb7
Logging
Aug 26, 2020
35e07f6
Small improvements
Aug 27, 2020
fe27706
Merge branch 'exp/rarInsertionTest' into rarAsService/node
Aug 27, 2020
326297f
Merge branch 'master' into rarAsService/node
Aug 27, 2020
438af4e
Whitespace fix
Aug 27, 2020
3880271
Apply suggestions from code review
ostorc Aug 30, 2020
7121093
Merge branch 'master' into rarAsService/node
Aug 30, 2020
7d615b0
PR comments fix
Aug 30, 2020
eed1b17
PR comments fix - method const to class constant
Aug 30, 2020
0a83e1d
PR comments
Aug 30, 2020
4500803
Moved string to resources
Aug 30, 2020
bb31424
Apply suggestions from code review
ostorc Aug 31, 2020
7fdac1b
Localization files
Aug 31, 2020
e08cbb8
Resources
Aug 31, 2020
5372f22
PR comments
Aug 31, 2020
f789e02
Build fix
Aug 31, 2020
4957c45
Add handshake validation to the RAR connection
Aug 31, 2020
0adb1cf
Add node expiration timeout
Aug 31, 2020
a5ac717
Missing ref files
Sep 1, 2020
3bceb4d
Apply suggestions from code review
ostorc Sep 1, 2020
c4e41e9
xlf files
Sep 1, 2020
d82b3f3
Typos and small refactoring
Sep 1, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
NU5125: Arcade uses licenseUrl when doing pack, which now causes NU5125 warning. This disables that warning until arcade can switch over.
-->

<NoWarn>$(NoWarn);NU1603;NU5105;NU5125;1701;1702</NoWarn>
<NoWarn>$(NoWarn);NU1603;NU5105;NU5125;1701;1702;VSTHRD002;VSTHRD105;VSTHRD110;VSTHRD200</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug-MONO'">
Expand Down
4 changes: 3 additions & 1 deletion eng/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<PackageReference Update="Microsoft.Net.Compilers.Toolset" Version="$(MicrosoftNetCompilersToolsetVersion)" />
<PackageReference Update="Microsoft.VisualStudio.SDK.EmbedInteropTypes" Version="15.0.15" />
<PackageReference Update="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="1.16.30" />
<PackageReference Update="Microsoft.Win32.Registry" Version="4.3.0" />
<PackageReference Update="Microsoft.Win32.Registry" Version="4.6.0" />
ostorc marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Update="NuGet.Build.Tasks" Version="$(NuGetBuildTasksVersion)" />
<PackageReference Update="NuGet.Frameworks" Version="$(NuGetBuildTasksVersion)" />
<PackageReference Update="PdbGit" Version="3.0.41" />
Expand Down Expand Up @@ -52,6 +52,8 @@
<PackageReference Update="xunit.assert" Version="$(XUnitVersion)" />
<PackageReference Update="xunit.console" Version="$(XUnitVersion)" />
<PackageReference Update="xunit.core" Version="$(XUnitVersion)" />
<PackageReference Update="StreamJsonRpc" Version="2.4.48" />
<PackageReference Update="Newtonsoft.Json" Version="12.*" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
Expand Down
3 changes: 3 additions & 0 deletions eng/Signing.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<Project>
<ItemGroup>
<FileSignInfo Include="Nerdbank.Streams.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="MessagePack.dll" CertificateName="3PartySHA2" />
<FileSignInfo Include="MessagePack.Annotations.dll" CertificateName="3PartySHA2" />
<ItemsToSign Include="$(VisualStudioSetupOutputPath)DevDivPackages\*.nupkg" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,7 @@ public ResolveAssemblyReference() { }
public string TargetFrameworkVersion { get { throw null; } set { } }
public string TargetProcessorArchitecture { get { throw null; } set { } }
public bool UnresolveFrameworkAssembliesFromHigherFrameworks { get { throw null; } set { } }
public bool UseResolveAssemblyReferenceService { get { throw null; } set { } }
public string WarnOrErrorOnTargetArchitectureMismatch { get { throw null; } set { } }
public override bool Execute() { throw null; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ public ResolveAssemblyReference() { }
public string TargetFrameworkVersion { get { throw null; } set { } }
public string TargetProcessorArchitecture { get { throw null; } set { } }
public bool UnresolveFrameworkAssembliesFromHigherFrameworks { get { throw null; } set { } }
public bool UseResolveAssemblyReferenceService { get { throw null; } set { } }
public string WarnOrErrorOnTargetArchitectureMismatch { get { throw null; } set { } }
public override bool Execute() { throw null; }
}
Expand Down
6 changes: 6 additions & 0 deletions ref/Microsoft.Build/net/Microsoft.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,6 +1382,12 @@ internal ProjectTaskOutputPropertyInstance() { }
public string TaskParameter { get { throw null; } }
public override Microsoft.Build.Construction.ElementLocation TaskParameterLocation { get { throw null; } }
}
public sealed partial class RarNode
{
public RarNode() { }
public Microsoft.Build.Execution.NodeEngineShutdownReason Run(bool nodeReuse, bool lowPriority, out System.Exception shutdownException) { shutdownException = default(System.Exception); throw null; }
ostorc marked this conversation as resolved.
Show resolved Hide resolved
public Microsoft.Build.Execution.NodeEngineShutdownReason Run(out System.Exception shutdownException) { shutdownException = default(System.Exception); throw null; }
}
public partial class RequestedProjectState
{
public RequestedProjectState() { }
Expand Down
6 changes: 6 additions & 0 deletions ref/Microsoft.Build/netstandard/Microsoft.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,12 @@ internal ProjectTaskOutputPropertyInstance() { }
public string TaskParameter { get { throw null; } }
public override Microsoft.Build.Construction.ElementLocation TaskParameterLocation { get { throw null; } }
}
public sealed partial class RarNode
{
public RarNode() { }
public Microsoft.Build.Execution.NodeEngineShutdownReason Run(bool nodeReuse, bool lowPriority, out System.Exception shutdownException) { shutdownException = default(System.Exception); throw null; }
ostorc marked this conversation as resolved.
Show resolved Hide resolved
ostorc marked this conversation as resolved.
Show resolved Hide resolved
public Microsoft.Build.Execution.NodeEngineShutdownReason Run(out System.Exception shutdownException) { shutdownException = default(System.Exception); throw null; }
}
public partial class RequestedProjectState
{
public RequestedProjectState() { }
Expand Down
24 changes: 24 additions & 0 deletions src/Build/BackEnd/BuildManager/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,30 @@ private void PerformSchedulingActions(IEnumerable<ScheduleResponse> responses)
}
}

internal int CreateRarNode()
ostorc marked this conversation as resolved.
Show resolved Hide resolved
{
string nodeLocation = _buildParameters?.NodeExeLocation ?? BuildEnvironmentHelper.Instance.CurrentMSBuildExePath;
if (string.IsNullOrEmpty(nodeLocation))
{
// Couldn't find any path to MsBuild, not creating new node.
ostorc marked this conversation as resolved.
Show resolved Hide resolved
return -1;
ostorc marked this conversation as resolved.
Show resolved Hide resolved
}

bool nodeReuse = _buildParameters?.EnableNodeReuse ?? true;
bool lowPriority = _buildParameters?.LowPriority ?? false;
string commandLineArgs = $"/nologo /nodemode:3 /nodeReuse:{nodeReuse.ToString().ToLower()} /low:{lowPriority.ToString().ToLower()}";
ostorc marked this conversation as resolved.
Show resolved Hide resolved
try
{
int nodeId = NodeProviderOutOfProcBase.LaunchNode(nodeLocation, commandLineArgs);
ostorc marked this conversation as resolved.
Show resolved Hide resolved
return nodeId;
}
catch (Exception)
{
ostorc marked this conversation as resolved.
Show resolved Hide resolved
// Fail silently
return -1;
}
}

/// <summary>
/// Completes a submission using the specified overall results.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ internal NodeEndpointOutOfProc(
/// </summary>
protected override Handshake GetHandshake()
{
return new Handshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, is64Bit: EnvironmentUtilities.Is64BitProcess, nodeReuse: _enableReuse, lowPriority: _lowPriority));
return new Handshake(CommunicationsUtilities.GetHandshakeOptions(
taskHost: false,
is64Bit: EnvironmentUtilities.Is64BitProcess,
nodeReuse: _enableReuse,
lowPriority: _lowPriority));
}

#region Structs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ public int AvailableNodes
/// </summary>
/// <param name="enableNodeReuse">Is reuse of build nodes allowed?</param>
/// <param name="enableLowPriority">Is the build running at low priority?</param>
internal static Handshake GetHandshake(bool enableNodeReuse, bool enableLowPriority)
/// <param name="specialNode">/Indicates if node can not accept standard MSBuild work</param>
internal static Handshake GetHandshake(bool enableNodeReuse, bool enableLowPriority, bool specialNode)
ostorc marked this conversation as resolved.
Show resolved Hide resolved
{
CommunicationsUtilities.Trace("MSBUILDNODEHANDSHAKESALT=\"{0}\", msbuildDirectory=\"{1}\", enableNodeReuse={2}, enableLowPriority={3}", Traits.MSBuildNodeHandshakeSalt, BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, enableNodeReuse, enableLowPriority);
return new Handshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, nodeReuse: enableNodeReuse, lowPriority: enableLowPriority, is64Bit: EnvironmentUtilities.Is64BitProcess));
return new Handshake(CommunicationsUtilities.GetHandshakeOptions(taskHost: false, nodeReuse: enableNodeReuse, lowPriority: enableLowPriority, specialNode: specialNode, is64Bit: EnvironmentUtilities.Is64BitProcess));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ protected void ShutdownAllNodes(bool nodeReuse, NodeContextTerminateDelegate ter
int timeout = 30;

// Attempt to connect to the process with the handshake without low priority.
Stream nodeStream = TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, false));
Stream nodeStream = NamedPipeUtil.TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, enableLowPriority: false, specialNode: false));
ostorc marked this conversation as resolved.
Show resolved Hide resolved

if (nodeStream == null)
{
// If we couldn't connect attempt to connect to the process with the handshake including low priority.
nodeStream = TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, true));
}
// If we couldn't connect attempt to connect to the process with the handshake including low priority.
nodeStream ??= NamedPipeUtil.TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, enableLowPriority: true, specialNode: false));

// Attempt to connect to the non-worker process
// Attempt to connect to the process with the handshake without low priority.
nodeStream ??= NamedPipeUtil.TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, enableLowPriority: false, specialNode: true));
// If we couldn't connect attempt to connect to the process with the handshake including low priority.
nodeStream ??= NamedPipeUtil.TryConnectToProcess(nodeProcess.Id, timeout, NodeProviderOutOfProc.GetHandshake(nodeReuse, enableLowPriority: true, specialNode: true));

if (nodeStream != null)
{
Expand Down Expand Up @@ -194,7 +197,7 @@ protected NodeContext GetNode(string msbuildLocation, string commandLineArgs, in
_processesToIgnore.Add(nodeLookupKey);

// Attempt to connect to each process in turn.
Stream nodeStream = TryConnectToProcess(nodeProcess.Id, 0 /* poll, don't wait for connections */, hostHandshake);
Stream nodeStream = NamedPipeUtil.TryConnectToProcess(nodeProcess.Id, 0 /* poll, don't wait for connections */, hostHandshake);
if (nodeStream != null)
{
// Connection successful, use this node.
Expand Down Expand Up @@ -245,7 +248,7 @@ protected NodeContext GetNode(string msbuildLocation, string commandLineArgs, in
// to the debugger process. Instead, use MSBUILDDEBUGONSTART=1

// Now try to connect to it.
Stream nodeStream = TryConnectToProcess(msbuildProcessId, TimeoutForNewNodeCreation, hostHandshake);
Stream nodeStream = NamedPipeUtil.TryConnectToProcess(msbuildProcessId, TimeoutForNewNodeCreation, hostHandshake);
if (nodeStream != null)
{
// Connection successful, use this node.
Expand Down Expand Up @@ -293,100 +296,10 @@ private string GetProcessesToIgnoreKey(Handshake hostHandshake, int nodeProcessI
return hostHandshake.ToString() + "|" + nodeProcessId.ToString(CultureInfo.InvariantCulture);
}

#if !FEATURE_PIPEOPTIONS_CURRENTUSERONLY
// This code needs to be in a separate method so that we don't try (and fail) to load the Windows-only APIs when JIT-ing the code
// on non-Windows operating systems
private void ValidateRemotePipeSecurityOnWindows(NamedPipeClientStream nodeStream)
ostorc marked this conversation as resolved.
Show resolved Hide resolved
{
SecurityIdentifier identifier = WindowsIdentity.GetCurrent().Owner;
#if FEATURE_PIPE_SECURITY
PipeSecurity remoteSecurity = nodeStream.GetAccessControl();
#else
var remoteSecurity = new PipeSecurity(nodeStream.SafePipeHandle, System.Security.AccessControl.AccessControlSections.Access |
System.Security.AccessControl.AccessControlSections.Owner | System.Security.AccessControl.AccessControlSections.Group);
#endif
IdentityReference remoteOwner = remoteSecurity.GetOwner(typeof(SecurityIdentifier));
if (remoteOwner != identifier)
{
CommunicationsUtilities.Trace("The remote pipe owner {0} does not match {1}", remoteOwner.Value, identifier.Value);
throw new UnauthorizedAccessException();
}
}
#endif

/// <summary>
/// Attempts to connect to the specified process.
/// </summary>
private Stream TryConnectToProcess(int nodeProcessId, int timeout, Handshake handshake)
{
// Try and connect to the process.
string pipeName = NamedPipeUtil.GetPipeNameOrPath("MSBuild" + nodeProcessId);

NamedPipeClientStream nodeStream = new NamedPipeClientStream(".", pipeName, PipeDirection.InOut, PipeOptions.Asynchronous
#if FEATURE_PIPEOPTIONS_CURRENTUSERONLY
| PipeOptions.CurrentUserOnly
#endif
);
CommunicationsUtilities.Trace("Attempting connect to PID {0} with pipe {1} with timeout {2} ms", nodeProcessId, pipeName, timeout);

try
{
nodeStream.Connect(timeout);

#if !FEATURE_PIPEOPTIONS_CURRENTUSERONLY
if (NativeMethodsShared.IsWindows && !NativeMethodsShared.IsMono)
{
// Verify that the owner of the pipe is us. This prevents a security hole where a remote node has
// been faked up with ACLs that would let us attach to it. It could then issue fake build requests back to
// us, potentially causing us to execute builds that do harmful or unexpected things. The pipe owner can
// only be set to the user's own SID by a normal, unprivileged process. The conditions where a faked up
// remote node could set the owner to something else would also let it change owners on other objects, so
// this would be a security flaw upstream of us.
ValidateRemotePipeSecurityOnWindows(nodeStream);
}
#endif

int[] handshakeComponents = handshake.RetrieveHandshakeComponents();
for (int i = 0; i < handshakeComponents.Length; i++)
{
CommunicationsUtilities.Trace("Writing handshake part {0} to pipe {1}", i, pipeName);
nodeStream.WriteIntForHandshake(handshakeComponents[i]);
}

// This indicates that we have finished all the parts of our handshake; hopefully the endpoint has as well.
nodeStream.WriteEndOfHandshakeSignal();

CommunicationsUtilities.Trace("Reading handshake from pipe {0}", pipeName);

#if NETCOREAPP2_1 || MONO
nodeStream.ReadEndOfHandshakeSignal(true, timeout);
#else
nodeStream.ReadEndOfHandshakeSignal(true);
#endif
// We got a connection.
CommunicationsUtilities.Trace("Successfully connected to pipe {0}...!", pipeName);
return nodeStream;
}
catch (Exception e) when (!ExceptionHandling.IsCriticalException(e))
{
// Can be:
// UnauthorizedAccessException -- Couldn't connect, might not be a node.
// IOException -- Couldn't connect, already in use.
// TimeoutException -- Couldn't connect, might not be a node.
// InvalidOperationException – Couldn’t connect, probably a different build
CommunicationsUtilities.Trace("Failed to connect to pipe {0}. {1}", pipeName, e.Message.TrimEnd());

// If we don't close any stream, we might hang up the child
nodeStream?.Dispose();
}

return null;
}

/// <summary>
/// Creates a new MSBuild process
/// </summary>
private int LaunchNode(string msbuildLocation, string commandLineArgs)
internal static int LaunchNode(string msbuildLocation, string commandLineArgs)
ostorc marked this conversation as resolved.
Show resolved Hide resolved
{
// Should always have been set already.
ErrorUtilities.VerifyThrowInternalLength(msbuildLocation, nameof(msbuildLocation));
Expand Down
30 changes: 29 additions & 1 deletion src/Build/BackEnd/Components/RequestBuilder/TaskHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Pipes;
#if FEATURE_APPDOMAIN
using System.Runtime.Remoting.Lifetime;
using System.Runtime.Remoting;
Expand All @@ -23,6 +24,7 @@
using Microsoft.Build.BackEnd.Components.Caching;
using System.Reflection;
using Microsoft.Build.Eventing;
using Microsoft.Build.Internal;

namespace Microsoft.Build.BackEnd
{
Expand All @@ -34,7 +36,7 @@ internal class TaskHost :
#if FEATURE_APPDOMAIN
MarshalByRefObject,
#endif
IBuildEngine7
IBuildEngine7, IRarBuildEngine
ostorc marked this conversation as resolved.
Show resolved Hide resolved
ostorc marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// True if the "secret" environment variable MSBUILDNOINPROCNODE is set.
Expand Down Expand Up @@ -983,5 +985,31 @@ private void VerifyActiveProxy()
{
ErrorUtilities.VerifyThrow(_activeProxy, "Attempted to use an inactive task host.");
}

/// <summary>
/// Inialize new RAR node
ostorc marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
bool IRarBuildEngine.CreateRarNode()
ostorc marked this conversation as resolved.
Show resolved Hide resolved
{
int nodeId = BuildManager.DefaultBuildManager.CreateRarNode();
return nodeId != -1;
}

/// <summary>
/// Provides RAR node name for current configuration
/// </summary>
string IRarBuildEngine.GetRarPipeName()
{
BuildParameters parameters = _host.BuildParameters;
return CommunicationsUtilities.GetRarPipeName(parameters.EnableNodeReuse, parameters.LowPriority);
}

/// <summary>
/// Constructs <seealso cref="NamedPipeClientStream"/>
/// </summary>
NamedPipeClientStream IRarBuildEngine.GetRarClientStream(string pipeName, int timeout)
{
return NamedPipeUtil.TryConnectToProcess(pipeName, timeout, null);
}
}
}
Loading