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

Fix msbuild failing when '@' is present in path (2nd attempt) #31527

Merged

Conversation

tonydnewell
Copy link
Contributor

@tonydnewell tonydnewell commented Nov 2, 2022

Fix for #30746 - "C# Protobuf msbuild task fails with glob pattern if "@" is present in the path"

After investigating there is a feature/bug with MSBuild: dotnet/msbuild#8104
where setting the Source metadata from the Identity metadata needs unescaping if the original items come from
a wildcard match and the paths contain an '@' character. See dotnet/msbuild#8104 (comment) for details.

Also as a precaution make sure no duplicate files in the list of files passed to the CSC compiler.

Tested on Linux and Windows with MSBuild versions 15, 16 and 17

@tonydnewell
Copy link
Contributor Author

@jtattermusch new fix for #30746 which should also fix the distribution tests.
I'm adding tests to Grpc.Tools.Tests separately.

@jtattermusch jtattermusch added the release notes: yes Indicates if PR needs to be in release notes label Nov 7, 2022
@jtattermusch jtattermusch self-requested a review November 7, 2022 16:14
Copy link
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

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

LGTM after there's some clarification on my question.

<!-- Adding Distinct() is just a precaution as the CSC compiler complains if there are
duplicate source files
-->
<Compile Include="@(_Protobuf_CodeCompile->Distinct())" />
Copy link
Contributor

Choose a reason for hiding this comment

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

qq: if there are duplicates, wouldn't it be fair to report that as a problem? Did this actually happen to you during testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Distinct() is just a precaution. No duplicates seen in testing with the new Unescape() fix (duplicates were seen with the old qualified Source fix).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported Specifies if the PR has been imported to the internal repository lang/C# release notes: yes Indicates if PR needs to be in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants