-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make some of the node-level communication logging more clear to readers #12719
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -659,7 +659,7 @@ public static ExitType Execute(string commandLine) | |||||
|
|
||||||
| GatherAllSwitches(commandLine, out var switchesFromAutoResponseFile, out var switchesNotFromAutoResponseFile, out _); | ||||||
|
|
||||||
| CommunicationsUtilities.Trace($"Command line parameters: {commandLine}"); | ||||||
| CommunicationsUtilities.Trace($"Command line parameters: \"{string.Join(' ', commandLine)}\""); | ||||||
|
||||||
| CommunicationsUtilities.Trace($"Command line parameters: \"{string.Join(' ', commandLine)}\""); | |
| CommunicationsUtilities.Trace($"Command line parameters: \"{commandLine}\""); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,6 +189,17 @@ internal Handshake(HandshakeOptions nodeType, string predefinedToolsDirectory = | |
| // Helper method to validate handshake option presence | ||
| internal static bool IsHandshakeOptionEnabled(HandshakeOptions hostContext, HandshakeOptions option) => (hostContext & option) == option; | ||
|
|
||
| internal static IEnumerable<HandshakeOptions> GetIndividualHandshakeOptions(HandshakeOptions options) | ||
| { | ||
| foreach (HandshakeOptions option in Enum.GetValues(typeof(HandshakeOptions))) | ||
| { | ||
| if (option != HandshakeOptions.None && IsHandshakeOptionEnabled(options, option)) | ||
| { | ||
| yield return option; | ||
| } | ||
| } | ||
| } | ||
baronfel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // Source options of the handshake. | ||
| internal HandshakeOptions HandshakeOptions { get; } | ||
|
|
||
|
|
@@ -199,15 +210,15 @@ protected Handshake(HandshakeOptions nodeType, bool includeSessionId, string pre | |
| // Build handshake options with version in upper bits | ||
| const int handshakeVersion = (int)CommunicationsUtilities.handshakeVersion; | ||
| var options = (int)nodeType | (handshakeVersion << 24); | ||
| CommunicationsUtilities.Trace("Building handshake for node type {0}, (version {1}): options {2}.", nodeType, handshakeVersion, options); | ||
| CommunicationsUtilities.Trace("Building handshake for node type {0}, (version {1}): options {2}.", nodeType, handshakeVersion, string.Join(",", GetIndividualHandshakeOptions(nodeType))); | ||
|
|
||
| // Calculate salt from environment and tools directory | ||
| bool isNetTaskHost = IsHandshakeOptionEnabled(nodeType, NetTaskHostFlags); | ||
| string handshakeSalt = Environment.GetEnvironmentVariable("MSBUILDNODEHANDSHAKESALT") ?? ""; | ||
| string handshakeSalt = Environment.GetEnvironmentVariable("MSBUILDNODEHANDSHAKESALT"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. coalescing to empty string here makes it more annoying to do a clearer message string later, so let's leave it null for just a couple more lines. |
||
| string toolsDirectory = GetToolsDirectory(isNetTaskHost, predefinedToolsDirectory); | ||
| int salt = CommunicationsUtilities.GetHashCode($"{handshakeSalt}{toolsDirectory}"); | ||
| int salt = CommunicationsUtilities.GetHashCode($"{handshakeSalt ?? ""}{toolsDirectory}"); | ||
|
|
||
| CommunicationsUtilities.Trace("Handshake salt is {0}", handshakeSalt); | ||
| CommunicationsUtilities.Trace("Handshake salt is {0}", handshakeSalt ?? "<not specified>"); | ||
| CommunicationsUtilities.Trace("Tools directory root is {0}", toolsDirectory); | ||
|
|
||
| // Get session ID if needed (expensive call) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strictly speaking this is not necessary