-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
[Windows] Always use absolute UNC paths and long path aware APIs, add "long path aware" flag to the application manifest. #91902
Conversation
815a0b4
to
10b5308
Compare
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.
Tested locally (rebased on top of master
8e36f98), it works as expected on Windows 11 23H2.
Testing projects:
- Long folder names with Unicode: (requires 7-zip to extract, Windows extractor won't work): The project with an unnecessarily long path name, also featuring Unicode characters such as é € τ.zip
- This one used to spew constant reimport errors with
icon.svg
in 4.2.2.stable. This PR fixes those errors entirely.
- This one used to spew constant reimport errors with
- Heavily nested folder (requires 7-zip to extract, Windows extractor won't work): 1.zip
- This PR doesn't appear to affect behavior much in this situation (compared to 4.2.2.stable).
- Project folder from the above nested folder, but not nested: 60.zip
However, shader compilation fails multiple times when opening the editor using the Compatibility rendering method on a project with a very long nested path. This issue also occurred in 4.2.2.stable under the same conditions. This leads to 3D materials not showing up:
Editing project: C:/Users/Hugo/Documents/Godot/1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29/30/31/32/33/34/35/36/37/38/39/40/41/42/43/44/45/46/47/48/49/50/51/52/53/54/55/56/57/58/59/60
Godot Engine v4.3.beta.custom_build.33dd4c218 (2024-07-24 00:54:50 UTC) - https://godotengine.org
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
ERROR: Condition "err != OK" is true.
at: ShaderGLES3::initialize (drivers\gles3\shader_gles3.cpp:798)
OpenGL API 3.3.0 NVIDIA 560.70 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce RTX 4090
This does not occur when the same project is edited in a shorter path.
The running project renders correctly though. This visual issue does not occur when using Forward+, but another set of errors is visible instead:
ERROR: Condition "f.is_null()" is true.
at: ShaderRD::_save_to_cache (servers\rendering\renderer_rd\shader_rd.cpp:474)
ERROR: Condition "f.is_null()" is true.
at: ShaderRD::_save_to_cache (servers\rendering\renderer_rd\shader_rd.cpp:474)
On a similarly long path on a SMB network drive (tested by running the editor using PowerShell when Shift + right-clicking empty space in Explorer), the editor opens correctly but all resources fail to import:
ERROR: Condition "err != OK" is true.
at: ShaderRD::_initialize_cache (servers\rendering\renderer_rd\shader_rd.cpp:771)
ERROR:ERROR:ERROR: Condition "f.is_null()" is true.
Condition "f.is_null()" is true.
at: at: ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
Condition "f.is_null()" is true.
at: ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon_outlined - Copy.png-83bc8bcbaecd26b9592143e9fe20290c.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Unable to open file: res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.s3tc.ctex.
at: (scene\resources\compressed_texture.cpp:41)
ERROR: Failed loading resource: res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.s3tc.ctex. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Failed loading resource: res://icon_outlined.png. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Unable to open file: res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex.
at: (scene\resources\compressed_texture.cpp:41)
ERROR: Failed loading resource: res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Failed loading resource: res://icon.svg. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Unable to open file: res://.godot/imported/icon_outlined - Copy.png-83bc8bcbaecd26b9592143e9fe20290c.ctex.
at: (scene\resources\compressed_texture.cpp:41)
ERROR: Failed loading resource: res://.godot/imported/icon_outlined - Copy.png-83bc8bcbaecd26b9592143e9fe20290c.ctex. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Failed loading resource: res://icon_outlined - Copy.png. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Unable to open file: res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.s3tc.ctex.
at: (scene\resources\compressed_texture.cpp:41)
ERROR: Failed loading resource: res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.s3tc.ctex. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Failed loading resource: res://icon_outlined.png. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Unable to open file: res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.s3tc.ctex.
at: (scene\resources\compressed_texture.cpp:41)
ERROR: Failed loading resource: res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.s3tc.ctex. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Failed loading resource: res://icon_outlined.png. Make sure resources have been imported by opening the project in the editor at least once.
at: (core\io\resource_loader.cpp:284)
ERROR: Cannot save config file to 'res://.godot/editor/node_3d.tscn-editstate-14584830dbc22d3f76a596eed5f4948e.cfg'.
at: (editor\editor_node.cpp:1546)
Godot Engine v4.3.beta.custom_build.33dd4c218 (2024-07-24 00:54:50 UTC) - https://godotengine.org
Vulkan 1.3.280 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 4090
ERROR:ERROR:ERROR: Condition "f.is_null()" is true.
Condition "f.is_null()" is true.
Condition "f.is_null()" is true.
at: at: ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
at: ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon_outlined - Copy.png-83bc8bcbaecd26b9592143e9fe20290c.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot save config file to 'res://.godot/editor/node_3d.tscn-editstate-14584830dbc22d3f76a596eed5f4948e.cfg'.
at: (editor\editor_node.cpp:1546)
Godot Engine v4.3.beta.custom_build.33dd4c218 (2024-07-24 00:54:50 UTC) - https://godotengine.org
Vulkan 1.3.280 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 4090
ERROR:ERROR: Condition "f.is_null()" is true.
Condition "f.is_null()" is true.
at: at: ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ERROR: Condition "f.is_null()" is true.
at: ResourceImporterTexture::_save_ctex (editor\import\resource_importer_texture.cpp:347)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon_outlined - Copy.png-83bc8bcbaecd26b9592143e9fe20290c.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon_outlined.png-be09dc71a0cb04701900baffec3ab610.md5'.
at: (editor\editor_file_system.cpp:2544)
ERROR: Cannot open MD5 file 'res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.md5'.
at: (editor\editor_file_system.cpp:2544)
Either way, this seems like an improvement overall so I'll approve.
It's worth testing this on Windows 7/8.1 just in case, especially if this is intended to be cherry-picked to 4.3.x. It's fine for this feature to not work there, but it should avoid breaking Windows 7/8.1 support entirely (unless it was decided to drop it by then).
Needs rebase. |
Needs another rebase after #96192. |
… "long path aware" flag to the application manifest.
Thanks! |
Fixes #91413
Some function line
CreateProcessW
seems to have issues if current working directory name is longer thanMAX_PATH
, I have added a workaround, but for some extra long paths it still might fail.