-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
No error is reported for paths with incorrect case #70765
Comments
This looks like it's caused by the fact that paths on Windows are not case sensitive (by default) but they are in PCK files, see here |
Sorry, but I don't quite understand how this issue relates to the issue I raised... Could you please point it out? |
I'm sorry pasted the wrong link. |
|
The relevant part is "This may also apply to exported binaries, which use a compressed package to store all files.", the file path is correct on Windows and should therefore not cause an error, but some kind of warning to make it clear that the path might not work in exported project makes sense, though I'm not sure how it would work, but to be clear this isn't a bug, it's how Windows works. Also relevant is this recommendation: "One simple fool-proof convention is to only allow lowercase file and path names." |
Oh agreed, I'm sorry I missed that distinction, as your original issue didn't point out the waring I was confused. |
Sorry I didn't make it clear. I've modified the initial information so that people who fix it later can better understand what I mean |
It works in debug because Windows doesn't care about case sensitivity in file paths, by default. However, in the exported project these resources do not exist in any filesystem, they exist as a hashmap stored inside of the PCK file. So case sensitivity is respected and expected. There isn't much we can do, I don't think, because to Windows those paths are indeed absolutely identical. We can only warn where we can that you should avoid relying on case insensitivity of Windows (or other platforms configured in this way). |
I think we can merge this report in my own older issue: #52231. |
Will this (https://stackoverflow.com/questions/3644863/how-do-i-get-the-correct-case-of-a-path) helps? |
Opened a PR for this #71975 |
Godot version
3.5.1mono
System information
windows10
Issue description
See "Steps to reproduce" for details
Steps to reproduce
Create a project
Create a folder names "level" in project
Create a scene in the folder names "sce_test"
Create another scene names "sce_main"
Create a C# script names "new_script" with these code
using Godot;
using System;
public class new_script : Node
{
public override void _Ready()
{
GD.Load("res://Level/sce_test.tscn");//no mistake
}
}
Mount the "new_script" script on any node in the scene ”sce_main“
Run from the scene "sce_main" and you can see no error or warning in the console
Export it and run the exported program in CMD,and you can see error like these
Two problems can be seen:
1.The case path of the error is not prompted as an error or warning in the editor.In fact,there is a runtime warning when the case of the file name is wrong, like this:
but not when the folder name is wrongcased. I think it's better to add runtime warnings for both cases to make it easier for developers to spot such issues
2.The editor and the exprted program ran the same project but got different result.Maybe they do not use the same template when running.This can lead to debugging difficulties.I think the in-editor runtime should use the same export template as the platform the editor is on.
Minimal reproduction project
test folder.zip
The folder "Output" is exported program
The text was updated successfully, but these errors were encountered: