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
Fix msbuild failing when '@' is present in path (2nd attempt) #31527
Conversation
There was ambiguity in references to Source metadata on some Items. These are now qualified to remove the ambiguity.
This reverts commit bb5d5dd.
@jtattermusch new fix for #30746 which should also fix the distribution tests. |
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.
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())" /> |
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.
qq: if there are duplicates, wouldn't it be fair to report that as a problem? Did this actually happen to you during testing?
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.
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).
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 theIdentity
metadata needs unescaping if the original items come froma 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