158 references to CommunicationsUtilities
Microsoft.Build (149)
BackEnd\BuildManager\BuildParameters.cs (7)
283
?
CommunicationsUtilities
.GetEnvironmentVariables()
623
internal static int ThreadStackSize =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
629
internal static int EndpointShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
635
internal static int EngineShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
647
internal static int LoggingThreadShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
653
internal static int RequestBuilderShutdownTimeout =>
CommunicationsUtilities
.GetIntegerVariableOrDefault(
1004
_buildProcessEnvironment =
CommunicationsUtilities
.GetEnvironmentVariables();
BackEnd\Client\MSBuildClient.cs (29)
172
CommunicationsUtilities
.Trace("Executing build with command line '{0}'", descriptiveCommandLine);
183
CommunicationsUtilities
.Trace("Server was not running. Starting server now.");
195
CommunicationsUtilities
.Trace("Server is busy, falling back to former behavior.");
210
CommunicationsUtilities
.Trace("Failed to obtain the current build server state: {0}", ex);
211
CommunicationsUtilities
.Trace("HResult: {0}.", ex.HResult);
229
CommunicationsUtilities
.Trace("Build finished.");
255
CommunicationsUtilities
.Trace("Trying shutdown server node.");
260
CommunicationsUtilities
.Trace("No need to shutdown server node for it is not running.");
269
CommunicationsUtilities
.Trace("Server cannot be shut down for it is not idle.");
276
CommunicationsUtilities
.Trace("Client cannot connect to idle server to shut it down.");
282
CommunicationsUtilities
.Trace("Failed to send shutdown command to the server.");
297
CommunicationsUtilities
.Trace("Wait for server to be not busy - will retry soon...");
369
CommunicationsUtilities
.Trace("MSBuild client error: problem during packet handling occurred: {0}.", ex);
394
CommunicationsUtilities
.Trace("MSBuild client warning: problem during querying console buffer width.", ex);
427
CommunicationsUtilities
.Trace("Command packet of type '{0}' sent...", packet.Type);
431
CommunicationsUtilities
.Trace("Failed to send command packet of type '{0}' to server: {1}", packet?.Type.ToString() ?? "Unknown", ex);
455
CommunicationsUtilities
.Trace("Another process launching the msbuild server, falling back to former behavior.");
462
CommunicationsUtilities
.Trace("Failed to obtain the current build server state: {0}", ex);
463
CommunicationsUtilities
.Trace("HResult: {0}.", ex.HResult);
476
CommunicationsUtilities
.Trace("Starting Server...");
478
CommunicationsUtilities
.Trace("Server started with PID: {0}", msbuildProcess?.Id);
482
CommunicationsUtilities
.Trace("Failed to launch the msbuild server: {0}", ex);
496
CommunicationsUtilities
.Trace("Sending shutdown command to server.");
539
return new ServerNodeHandshake(
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture()));
549
CommunicationsUtilities
.Trace("MSBuild client sent cancellation command.");
559
CommunicationsUtilities
.Trace("MSBuild client error: packet pump unexpectedly shut down: {0}", packetPump.PacketPumpException);
604
CommunicationsUtilities
.Trace("Build response received: exit code '{0}', exit type '{1}'", response.ExitCode, response.ExitType);
630
CommunicationsUtilities
.Trace("Retrying to connect to server after {0} ms", sw.ElapsedMilliseconds);
638
CommunicationsUtilities
.Trace("Failed to connect to server: {0}", ex);
BackEnd\Client\MSBuildClientPacketPump.cs (7)
190
CommunicationsUtilities
.Trace("Entering read loop.");
198
Task<int> readTask =
CommunicationsUtilities
.ReadAsync(localStream, headerByte, headerByte.Length);
222
CommunicationsUtilities
.Trace("Shutdown message pump thread.");
283
CommunicationsUtilities
.Trace("Packet factory failed to receive package. Exception while deserializing packet {0}.", packetType);
297
readTask =
CommunicationsUtilities
.ReadAsync(localStream, headerByte, headerByte.Length);
312
CommunicationsUtilities
.Trace("Exception occurred in the packet pump: {0}", ex);
316
CommunicationsUtilities
.Trace("Ending read loop.");
BackEnd\Components\Communications\NodeEndpointOutOfProc.cs (1)
36
HandshakeOptions handshakeOptions =
CommunicationsUtilities
.GetHandshakeOptions(
BackEnd\Components\Communications\NodeLauncher.cs (5)
92
CommunicationsUtilities
.Trace("Launching node from {0}", msbuildLocation);
125
CommunicationsUtilities
.Trace(
134
CommunicationsUtilities
.Trace("Successfully launched {1} node with PID {0}", process.Id, exeName);
167
CommunicationsUtilities
.Trace(
189
CommunicationsUtilities
.Trace("Successfully launched {1} node with PID {0}", childProcessId, exeName);
BackEnd\Components\Communications\NodeProviderInProc.cs (1)
395
int connectionTimeout =
CommunicationsUtilities
.NodeConnectionTimeout;
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (4)
72
CommunicationsUtilities
.Trace("MSBUILDNODEHANDSHAKESALT=\"{0}\", msbuildDirectory=\"{1}\", enableNodeReuse={2}, enableLowPriority={3}", Traits.MSBuildNodeHandshakeSalt, BuildEnvironmentHelper.Instance.MSBuildToolsDirectory32, enableNodeReuse, enableLowPriority);
73
return new Handshake(
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(), nodeReuse: enableNodeReuse, lowPriority: enableLowPriority));
99
CommunicationsUtilities
.Trace("Starting to acquire {1} new or existing node(s) to establish nodes from ID {0} to {2}...", nextNodeId, numberOfNodesToCreate, nextNodeId + numberOfNodesToCreate - 1);
101
Handshake hostHandshake = new(
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture(), nodeReuse: ComponentHost.BuildParameters.EnableNodeReuse, lowPriority: ComponentHost.BuildParameters.LowPriority));
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (28)
177
CommunicationsUtilities
.Trace("Shutting down node with pid = {0}", nodeProcess.Id);
236
CommunicationsUtilities
.Trace("Attempting to connect to {1} existing processes '{0}'...", expectedProcessName, possibleRunningNodesList.Count);
250
CommunicationsUtilities
.Trace("FAILED TO CONNECT TO A CHILD NODE");
270
CommunicationsUtilities
.Trace("Trying to connect to existing process {2} with id {1} to establish node {0}...", nodeId, nodeToReuse.Id, nodeToReuse.ProcessName);
291
CommunicationsUtilities
.Trace("Successfully connected to existed node {0} which is PID {1}", nodeId, nodeToReuse.Id);
309
CommunicationsUtilities
.Trace("Could not connect to existing process, now creating a process...");
351
CommunicationsUtilities
.Trace("Successfully connected to created node {0} which is PID {1}", nodeId, msbuildProcess.Id);
363
CommunicationsUtilities
.Trace("Could not connect to node with PID {0}; it has exited with exit code {1}. This can indicate a crash at startup", msbuildProcess.Id, msbuildProcess.ExitCode);
369
CommunicationsUtilities
.Trace("Could not connect to node with PID {0}; it has exited with unknown exit code. This can indicate a crash at startup", msbuildProcess.Id);
375
CommunicationsUtilities
.Trace("Could not connect to node with PID {0}; it is still running. This can occur when two multiprocess builds run in parallel and the other one 'stole' this node", msbuildProcess.Id);
462
CommunicationsUtilities
.Trace("Attempting connect to PID {0} with pipe {1} with timeout {2} ms", nodeProcessId, pipeName, timeout);
476
CommunicationsUtilities
.Trace("Failed to connect to pipe {0}. {1}", pipeName, e.Message.TrimEnd());
511
CommunicationsUtilities
.Trace("Writing handshake part {0} ({1}) to pipe {2}", i, handshakeComponents[i], pipeName);
518
CommunicationsUtilities
.Trace("Reading handshake from pipe {0}", pipeName);
526
CommunicationsUtilities
.Trace("Successfully connected to pipe {0}...!", pipeName);
652
int bytesRead = await
CommunicationsUtilities
.ReadAsync(_clientToServerStream, _headerByte, _headerByte.Length);
660
CommunicationsUtilities
.Trace(_nodeId, "EXCEPTION in RunPacketReadLoopAsync: {0}", e);
674
int bytesRead = await
CommunicationsUtilities
.ReadAsync(_clientToServerStream, packetData, packetLength);
682
CommunicationsUtilities
.Trace(_nodeId, "EXCEPTION in RunPacketReadLoopAsync (Reading): {0}", e);
787
CommunicationsUtilities
.Trace(context._nodeId, "EXCEPTION in SendData: {0}", e);
840
CommunicationsUtilities
.Trace("Waiting for node with pid = {0} to exit", _process.Id);
868
CommunicationsUtilities
.Trace("Killing node with pid = {0}", _process.Id);
894
CommunicationsUtilities
.Trace(_nodeId, "COMMUNICATIONS ERROR (HRC) Node: {0} Process: {1} Bytes Read: {2} Expected: {3}", _nodeId, _process.Id, bytesRead, _headerByte.Length);
899
CommunicationsUtilities
.Trace(_nodeId, " Child Process {0} has exited.", _process.Id);
903
CommunicationsUtilities
.Trace(_nodeId, " Child Process {0} is still running.", _process.Id);
908
CommunicationsUtilities
.Trace(_nodeId, "Unable to retrieve remote process information. {0}", e);
970
CommunicationsUtilities
.Trace(_nodeId, "Bad packet read for packet {0} - Expected {1} bytes, got {2}", packetType, packetLength, bytesRead);
992
CommunicationsUtilities
.Trace(_nodeId, "EXCEPTION in ReadAndRoutPacket: {0}", e);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
551
CommunicationsUtilities
.Trace("For a host context of {0}, spawning executable from {1}.", hostContext.ToString(), msbuildLocation ?? "MSBuild.exe");
BackEnd\Components\RequestBuilder\RequestBuilder.cs (3)
907
entryToComplete.RequestConfiguration.SavedEnvironmentVariables =
CommunicationsUtilities
.GetEnvironmentVariables();
1351
_requestEntry.RequestConfiguration.SavedEnvironmentVariables =
CommunicationsUtilities
.GetEnvironmentVariables();
1418
IDictionary<string, string> currentEnvironment =
CommunicationsUtilities
.GetEnvironmentVariables();
BackEnd\Node\InProcNode.cs (2)
339
CommunicationsUtilities
.SetEnvironment(_savedEnvironment);
465
_savedEnvironment =
CommunicationsUtilities
.GetEnvironmentVariables();
BackEnd\Node\OutOfProcNode.cs (5)
445
CommunicationsUtilities
.Trace("Shutting down with reason: {0}, and exception: {1}.", _shutdownReason, _shutdownException);
484
CommunicationsUtilities
.SetEnvironment(_savedEnvironment);
488
CommunicationsUtilities
.Trace("Failed to restore the original environment: {0}.", ex);
525
CommunicationsUtilities
.Trace("Shut down complete.");
700
_savedEnvironment =
CommunicationsUtilities
.GetEnvironmentVariables();
BackEnd\Node\OutOfProcServerNode.cs (7)
104
CommunicationsUtilities
.GetHandshakeOptions(taskHost: false, architectureFlagToSet: XMakeAttributes.GetCurrentMSBuildArchitecture()));
110
CommunicationsUtilities
.Trace("Starting new server node with handshake {0}", handshake);
248
CommunicationsUtilities
.Trace("Shutting down with reason: {0}, and exception: {1}.", _shutdownReason, _shutdownException);
259
CommunicationsUtilities
.Trace("Shut down complete.");
325
CommunicationsUtilities
.Trace("Received request to cancel build running on MSBuild Server. MSBuild server will shutdown.}");
349
CommunicationsUtilities
.Trace("Building with MSBuild server with command line {0}", command.CommandLine);
365
CommunicationsUtilities
.SetEnvironment(command.BuildProcessEnvironment);
CommunicationsUtilities.cs (21)
94
const int handshakeVersion = (int)
CommunicationsUtilities
.handshakeVersion;
99
CommunicationsUtilities
.Trace("Building handshake for node type {0}, (version {1}): options {2}.", nodeType, handshakeVersion, options);
102
CommunicationsUtilities
.Trace("Handshake salt is " + handshakeSalt);
104
CommunicationsUtilities
.Trace("Tools directory root is " + toolsDirectory);
105
salt =
CommunicationsUtilities
.GetHashCode(handshakeSalt + toolsDirectory);
125
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(options),
126
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(salt),
127
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionMajor),
128
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionMinor),
129
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionBuild),
130
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionPrivate),
131
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(sessionId)
137
public virtual byte? ExpectedVersionInFirstByte =>
CommunicationsUtilities
.handshakeVersion;
158
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(options),
159
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(salt),
160
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionMajor),
161
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionMinor),
162
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionBuild),
163
CommunicationsUtilities
.AvoidEndOfHandshakeSignal(fileVersionPrivate),
493
CommunicationsUtilities
.Trace("Handshake failed on part {0}. Probably the client is a different MSBuild build.", valueRead);
497
CommunicationsUtilities
.Trace("Expected end of handshake signal but received {0}. Probably the host is a different MSBuild build.", valueRead);
Evaluation\IntrinsicFunctions.cs (3)
444
=>
CommunicationsUtilities
.GetHashCode(toHash);
458
StringHashingAlgorithm.Legacy =>
CommunicationsUtilities
.GetHashCode(toHash),
512
HandshakeOptions desiredContext =
CommunicationsUtilities
.GetHandshakeOptions(taskHost: true, taskHostParameters: parameters);
Instance\TaskFactories\TaskHostTask.cs (3)
269
CommunicationsUtilities
.GetEnvironmentVariables(),
292
_requiredContext =
CommunicationsUtilities
.GetHandshakeOptions(taskHost: true, taskHostParameters: _taskHostParameters);
453
CommunicationsUtilities
.SetEnvironment(taskHostTaskComplete.BuildProcessEnvironment);
NodeEndpointOutOfProcBase.cs (21)
273
CommunicationsUtilities
.Trace("Changing link status from {0} to {1}", _status.ToString(), newStatus.ToString());
364
int waitTimeRemaining = Math.Max(0,
CommunicationsUtilities
.NodeConnectionTimeout - (int)usedWaitTime.TotalMilliseconds);
375
CommunicationsUtilities
.Trace("Waiting for connection {0} ms...", waitTimeRemaining);
380
CommunicationsUtilities
.Trace("Connection timed out waiting a host to contact us. Exiting comm thread.");
385
CommunicationsUtilities
.Trace("Parent started connecting. Reading handshake from parent");
401
byteToAccept: i == 0 ? (byte?)
CommunicationsUtilities
.handshakeVersion : null /* this will disconnect a < 16.8 host; it expects leading 00 or F5 or 06. 0x00 is a wildcard */
410
CommunicationsUtilities
.Trace("Handshake failed. Received {0} from host not {1}. Probably the host is a different MSBuild build.", handshakePart, handshakeComponents[i]);
425
CommunicationsUtilities
.Trace("Successfully connected to parent.");
452
CommunicationsUtilities
.Trace("Client connection failed but we will wait for another connection. Exception: {0}", e.Message);
474
CommunicationsUtilities
.Trace("Client connection failed. Exiting comm thread. {0}", e);
491
CommunicationsUtilities
.Trace("Ending read loop");
520
CommunicationsUtilities
.Trace("Entering read loop.");
525
Task<int> readTask =
CommunicationsUtilities
.ReadAsync(localReadPipe, headerByte, headerByte.Length);
563
CommunicationsUtilities
.Trace("Exception reading from server. {0}", e);
577
CommunicationsUtilities
.Trace("Parent disconnected gracefully.");
584
CommunicationsUtilities
.Trace("Parent disconnected abruptly.");
590
CommunicationsUtilities
.Trace("Incomplete header read from server. {0} of {1} bytes read", bytesRead, headerByte.Length);
607
CommunicationsUtilities
.Trace("Exception while deserializing packet {0}: {1}", packetType, e);
617
readTask =
CommunicationsUtilities
.ReadAsync(localReadPipe, headerByte, headerByte.Length);
664
CommunicationsUtilities
.Trace("Exception while serializing packets: {0}", e);
673
CommunicationsUtilities
.Trace("Disconnecting voluntarily");
Utilities\Utilities.cs (1)
470
IDictionary<string, string> environmentVariablesBag =
CommunicationsUtilities
.GetEnvironmentVariables();
Microsoft.Build.Engine.UnitTests (9)
CommunicationUtilities_Tests.cs (9)
10
using CommunicationsUtilities = Microsoft.Build.Internal.
CommunicationsUtilities
;
22
IDictionary<string, string> envVars =
CommunicationsUtilities
.GetEnvironmentVariables();
46
CommunicationsUtilities
.SetEnvironmentVariable(testName1, testValue);
49
IDictionary<string, string> envVars =
CommunicationsUtilities
.GetEnvironmentVariables();
51
CommunicationsUtilities
.SetEnvironmentVariable(testName1, null);
52
CommunicationsUtilities
.SetEnvironmentVariable(testName2, testValue);
54
CommunicationsUtilities
.SetEnvironment(envVars);
61
CommunicationsUtilities
.SetEnvironmentVariable(testName1, null);
62
CommunicationsUtilities
.SetEnvironmentVariable(testName2, null);