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

Make VBCSCompiler pipe name insensitive to casing of the path #75852

Merged
merged 3 commits into from
Nov 12, 2024
Merged
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
8 changes: 8 additions & 0 deletions src/Compilers/Server/VBCSCompilerTests/BuildClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ public void GetPipeNameForPathOptLength()
// We only have ~50 total bytes to work with on mac, so the base path must be small
Assert.Equal(43, name.Length);
}

[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/75714")]
public void GetPipeNameForPath_Casing()
{
var path1 = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar);
var path2 = string.Format(@"Q:{0}The{0}Path", Path.DirectorySeparatorChar);
Assert.Equal(BuildServerConnection.GetPipeName(path1), BuildServerConnection.GetPipeName(path2));
}
}
}
}
3 changes: 3 additions & 0 deletions src/Compilers/Shared/BuildServerConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ internal static string GetPipeName(
// of this method.
clientDirectory = clientDirectory.TrimEnd(Path.DirectorySeparatorChar);

// Similarly, we don't want multiple servers if the provided launch path differs in casing.
clientDirectory = clientDirectory.ToLowerInvariant();

var pipeNameInput = $"{userName}.{isAdmin}.{clientDirectory}";
using (var sha = SHA256.Create())
{
Expand Down