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

Web: Catch using GDExtensions in a non-dlink build #82790

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

MarioLiebisch
Copy link
Contributor

Previously, if one would try to use GDExtensions with a web build that doesn't have dynamic loading enabled, this would simply fail with a cryptic me.rtenv.loadDynamicLibrary is not a function error message.

If it's attempted again, it will now instead error out with GDExtension libraries are not supported by this engine version.

@akien-mga
Copy link
Member

Would be good to provide information about:

  • Having to enable "Extensions Support" in the export preset
  • OR using custom built templates with dlink_enabled=yes

The UX is a bit awkward as "Extensions Support" I believe only toggles which of the official templates will be used, but if using custom built ones this logic doesn't apply.

@MarioLiebisch
Copy link
Contributor Author

MarioLiebisch commented Oct 4, 2023

Should it even be an option? I'd say the editor should know there's an GDExtension somewhere, so it could pick it automatically or warn the user if there's no matching template. Maybe one could bundle an empty text file with the template to identify build options? Edit: The editor should be able to identify this already, just checking whether there's the "Side wasm" or not.

I mostly got into this situation by using a symbolic link from web_debug.zip to the new generated zip file. The export function still insisted on using web_debug.zip after all.

@dsnopek
Copy link
Contributor

dsnopek commented Oct 6, 2023

Discussed at the GDExtension meeting, and we agree that this PR is a good idea, but also agree with @akien-mga that the message should contain some information for the developer about what to do to fix the issue.

Previously this would simply fail with a cryptic
`me.rtenv.loadDynamicLibrary is not a function` error.
@MarioLiebisch
Copy link
Contributor Author

Done. It will now read:

GDExtension libraries are not supported by this engine version. Enable "Extensions Support" for your export preset and/or build your custom template with "dlink_enabled=yes".

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

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

That message sounds good to me!

@akien-mga akien-mga modified the milestones: 4.x, 4.2 Oct 9, 2023
@akien-mga akien-mga merged commit 7c12111 into godotengine:master Oct 9, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

3 participants