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

Normalize paths when generating pipe names #8504

Merged
merged 1 commit into from
Feb 12, 2016
Merged

Conversation

jaredpar
Copy link
Member

@jaredpar jaredpar commented Feb 9, 2016

It turns out APIs are very inconsistent in whether they leave a trailing directory separator on path names. This caused the client and server code to generate different pipe names for the same file location. Hence VbcsCompiler -shutdown was failing because it used the wrong pipe name. Fix this by normalizing path names.

@jaredpar
Copy link
Member Author

jaredpar commented Feb 9, 2016

CC @dotnet/roslyn-compiler

@jaredpar
Copy link
Member Author

@dotnet/roslyn-compiler please review. Small change. Promise :)

internal static string GetBasePipeName(string compilerExeDirectory)
{
// Normalize away trailing slashes. File APIs include / exclude this with no
// discernable pattern. Easiest to normalize it here vs. auditing every inputt
Copy link
Member

Choose a reason for hiding this comment

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

Typo at input. But perhaps change to every caller of this method instead.

@jaredpar
Copy link
Member Author

Updated to address feedback

@cston
Copy link
Member

cston commented Feb 11, 2016

LGTM

@agocke
Copy link
Member

agocke commented Feb 11, 2016

👍

[Fact]
public void GetBasePipeNameSlashes()
{
var path = @"q:\the\path";
Copy link
Contributor

Choose a reason for hiding this comment

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

What about separators here?

It turns out APIs are very inconsistent in whether they leave a trailing
directory separator on path names. This caused the client and server
code to generate different pipe names for the same file location. Hence
VbcsCompiler -shutdown was failing because it used the wrong pipe name.
Fix this by normalizing path names.
jaredpar added a commit that referenced this pull request Feb 12, 2016
Normalize paths when generating pipe names
@jaredpar jaredpar merged commit 4ca9367 into dotnet:master Feb 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants