FYI [wasm] the name of your rust library MUST be different than the godot project name
I tried to get wasm export to work but would always get the error
Can't resolve symbol gdext_rust_init. Error: Tried to lookup unknown symbol "gdext_rust_init" in dynamic lib: game.wasm
That is, until I stumbled upon someone having the same issue and posting the solution: https://discord.com/channels/723850269347283004/1288906885746917447
Turns out, godot itself exports a file named <projectname>.wasm, so if you have named your rust library the same as your godot project, they will overwrite each other!
We should add this to the book page, maybe among other similar things to keep in mind 🤔
Also, we can probably validate that they're not equal:
application/config/nameis theProjectSettingskey for the project name- from Cargo env, we can get the library name
I think this can either be part of the existing web PR (https://github.com/godot-rust/book/pull/56) or I can create a new PR after that one is merged, I'd just rather not mess around with the same article and cause merge conflicts
We added a different validation regarding naming in https://github.com/godot-rust/gdext/pull/799, might be possible to extend that to also cover the project name.
The Godot project name can be obtained via ProjectSetting.get_setting("application/config/name").
@PgBiel do you think that makes sense?
This validation can't be done at runtime if I understood correctly, since the problem here is that our binary is overwritten and so never runs. It would have to be done within the editor, before exporting, in principle.
If we can do that, then it might make sense.
Regarding docs, even though we already mention this problem in "Troubleshooting", we could consider adding that particular error to "Understanding common errors" as well.
I assume most people test natively and then export for web, so the verification could be done in the windows/macos/linux build(s).