-
Notifications
You must be signed in to change notification settings - Fork 450
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
Assets beginning with a number cause compilation error on windows #1796
Comments
There seem to be two things necessary to reproduce this:
This is interesting because this should never get through to the C++ compiler, but instead fail during Haxe compilation (which it does, if you reference the variable directly: So there's really two different bugs here, the first one being a Haxe bug (seems like macro-created variables can get around some checks) and the second one an issue with |
Thanks! I'm glad you teased apart the two bugs! The issue of flattening filename data with underscores would already be an issue, though...i.e. if you have "file.a.wav" and "file_a.wav" there would be a conflict. And don't other characters get replaced too, like space, parentheses, etc.? In any case it should be possible to check for conflicts, I think... |
The escaping currently looks like this: value.split("-").join("_").split(".").join("__"); Not very robust. |
Reported the Haxe issue here: HaxeFoundation/haxe#5002 |
For now, we simply ignore assets that would produce invalid identifiers to avoid the compilation errors on native targets. You can still reference those assets using their string path of course, as Long-term, we might want a better solution with proper escaping, but perhaps that's not worth the hassle (there's a lot of ways in which a file name could produce an invalid identifer, just think Unicode...). Closing for now. |
Code snippet reproducing the issue:
Name an asset "2p0.wav". The fact that it starts with a number seems to break compilation.
Observed behavior:
Expected behavior: Normal compilation.
The text was updated successfully, but these errors were encountered: