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
Return correct casing of filesystem path during normalization #9250
Conversation
@PoshChan Please get failures |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@SteveL-MSFT, test results were not published for PowerShell-CI-static-analysis at vstfs:///Build/Build/18523 |
This comment has been minimized.
This comment has been minimized.
@PoshChan Please get failures |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@SteveL-MSFT, test results were not published for PowerShell-CI-static-analysis at vstfs:///Build/Build/18594 |
This comment has been minimized.
This comment has been minimized.
47be8a6
to
a3f80e7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@PoshChan Please retry windows |
@SteveL-MSFT, successfully started retry of |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hmmm, looks like the failures are due to handling of long path names which explains why it didn't fail on my machine. Might have to add some long path tests first. |
d2927f2
to
11f93c5
Compare
This comment has been minimized.
This comment has been minimized.
@anmenaga Please merge by "Squash and Merge" in future unless we really want to preserve the PR history (should be rare). |
@SteveL-MSFT @daxian-dbw We see a performance decreasing although overall performance of 7.0 builds is 2x better for file operations (like Also the trace shows that we call the method from some places several times. So the change slow down all file system operations without the need. From original issue:
So I hope there is another way to fix the issue without perf degradation. I look cmd.exe and don't see that it does a path case normalization but works well. It seems we did not find a root of the issue and the fix is not in right place. |
@iSazonov I see different results -- it's even slightly faster in 7.0.0-preview.5 comparing with |
@daxian-dbw I guess we use different cwd - my one is very long. |
@iSazonov I still cannot reproduce it using a long current working directory |
@daxian-dbw I tested on another system and I guess it is Kaspersky AV that slow down the CreateFileW P/Invoke. I still don't like these extra P/Invokes taking in account how cmd.exe and Windows PowerShell works. |
PR Summary
On a case-insensitive filesystem, if the path exists, we propagate the user typed casing of the path and reuse it. This causes problems with some native tools like
git
where it expects correct casing of filesystem paths. The change is to step through the path and retrieve the actual casing of the items in the path and return that during the path normalization method.PR Context
Fix #5678
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.