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

Support long path in file access on Windows #76739

Merged
merged 1 commit into from
May 5, 2023

Conversation

spanzeri
Copy link
Contributor

@spanzeri spanzeri commented May 5, 2023

Tentative fix for some of the issues with long paths on windows (in particular with shader cache).
Fixes: #73583
Should fix most of the cases for this: #52799
Note that dir_access already uses the \?\ format for long paths.
My understanding from the microsoft docs is that unicode version of the file functions all support this format.
However, I haven't tested it on older windows versions and there might be some good reasons to not do this

@spanzeri spanzeri requested review from a team as code owners May 5, 2023 00:38
Changed windows file access file to check for path length and use the \\?\ long format when needed
@spanzeri spanzeri force-pushed the fix-long-path-windows branch from 7bb5925 to 59f04e1 Compare May 5, 2023 08:04
@spanzeri
Copy link
Contributor Author

spanzeri commented May 5, 2023

Made the same changes to dir_access and tested more thoroughly with totally sensible file names in the editor:
image

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Have not extensively tested it, but look fine to me. As a follow up, we probably should clean up / \ replacement and do it only once in the fix path for all types of names.

@mhilbrunner mhilbrunner merged commit a7fe5b0 into godotengine:master May 5, 2023
@mhilbrunner
Copy link
Member

Thanks! Merged.

@spanzeri spanzeri deleted the fix-long-path-windows branch May 5, 2023 12:08
@akien-mga akien-mga changed the title Support long path in file access on windows Support long path in file access on Windows May 10, 2023
@akien-mga
Copy link
Member

Cherry-picked for 4.0.3.

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.

Condition "f.is_null()" is true at shader_rd.cpp:454
5 participants