-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
On windows there can be problems with Tools that do not support Unicode #9232
Conversation
On Linux, you have to include the user name or something equally unique. Otherwise, MSBuild processes of a different user could attempt to use the same directory in tmp and fail because they don't have access to the directory. Omit the user name only on Windows where the Unicode problem occurs. On macOS, I think it could be implemented either way, but I'd prefer keeping the current behavior if no actual problem has been reported with it. |
@KalleOlaviNiemitalo is it Runtime check for windows are used on MsBuild or do we have preprocessors for it? |
There is a msbuild/src/Shared/TempFileUtilities.cs Line 41 in 1b84c9b
msbuild/src/Tasks/AssemblyInfo.cs Line 4 in 1b84c9b
I expect that Windows would be checked in a similar way. There is already a property for that. msbuild/src/Framework/NativeMethods.cs Line 702 in 1b84c9b
|
…de, and Username containing Unicode chars. dotnet#9229
c760662
to
7b36917
Compare
@KalleOlaviNiemitalo pushed new change, thanks! |
I think this is a reasonable approach, and we'll check with security folks. Another option would be "on Windows, coerce the username to ANSI". That said, I think there's room for #9229 to be fixed in |
Sound good, let me know. we can do the conversion to ANSI or use
I agree :) Lets discuss possible solutions on that Issue. |
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.
Looks good to me! Approval is pending security review as rainersigwald mentioned.
by review cleanup Co-authored-by: Forgind <12969783+Forgind@users.noreply.github.com>
The following do not mention "MSBuildTemp" and thus would not need to be updated for this change:
|
Using none ASCII chars for protoc on Windows are not handled well. This adresses argument file at a location where either directory, or filename contains Unicode chars. Specifically because MsBuild tool saves argument file in with the UserName appended to the .rsp file. dotnet/msbuild#9232 But in general we should really handle if none ascii chars are in the path. Closes #14197 COPYBARA_INTEGRATE_REVIEW=#14197 from hknielsen:support-non-ascii-commandline-args 673d575 PiperOrigin-RevId: 568722987
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
On windows there can be problems with Tools that do not support Unicode
Having a Username containing unicode chars, and tools that does not handle that well, makes it difficult when ToolTask are defined from NuGet Packages.
Fixes #9229
Context
Tmp folder can be changed by updating the User env vars, but Username are not possible. Not prepending the Username makes it possible for Users to handle these rare cases.
Changes Made
Changed to not append Username on Windows to tmp rsp file location.
Testing
Tests already for ToolTasks using this.
Notes