Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<MicrosoftCodeAnalysisPooledObjectsVersion>5.0.0-1.25277.114</MicrosoftCodeAnalysisPooledObjectsVersion>
</PropertyGroup>
<PropertyGroup>
<BootstrapSdkVersion>10.0.100-rc.1.25451.107</BootstrapSdkVersion>
<BootstrapSdkVersion>10.0.100-rc.2.25466.101</BootstrapSdkVersion>
Copy link
Member Author

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

</PropertyGroup>
<Target Name="OverrideArcadeFileVersion" AfterTargets="_InitializeAssemblyVersion">
<!-- See https://github.com/dotnet/arcade/issues/3386
Expand Down
2 changes: 1 addition & 1 deletion src/MSBuild/XMake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)}\"");
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commandLine parameter is a string, not a collection. Using string.Join(' ', commandLine) will join individual characters with spaces instead of displaying the command line. Remove the string.Join call and use commandLine directly: CommunicationsUtilities.Trace($\"Command line parameters: \\\"{commandLine}\\\"\");

Suggested change
CommunicationsUtilities.Trace($"Command line parameters: \"{string.Join(' ', commandLine)}\"");
CommunicationsUtilities.Trace($"Command line parameters: \"{commandLine}\"");

Copilot uses AI. Check for mistakes.

bool buildCanBeInvoked = ProcessCommandLineSwitches(
switchesFromAutoResponseFile,
Expand Down
19 changes: 15 additions & 4 deletions src/Shared/CommunicationsUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

// Source options of the handshake.
internal HandshakeOptions HandshakeOptions { get; }

Expand All @@ -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");
Copy link
Member Author

Choose a reason for hiding this comment

The 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)
Expand Down
Loading