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

Fix release builds for new GDExtension developers by fixing release identifiers in .gdextension #8526

Conversation

MoralCode
Copy link

@MoralCode MoralCode commented Nov 24, 2023

In working on my own GDExtension as a first-time godot developer, I have discovered (while debugging a performance related issue) that the example of a .gdextension In the tutorial (the C++ example) is incorrect.

When using scons to build my extension in release mode (scons target=template_release) my demo project would fail to open in godot without loading errors. it was only after I saw this comment and tried changing the release identifier to linux.x86_64 (from linux.release.x86_64) that godot successfully loaded with the release version of my extension.

godot 4.1

@MoralCode MoralCode changed the title remove .release from release identifiers Fix release builds for new GDExtension developers by fixing release identifiers in .gdextension Nov 24, 2023
@AThousandShips
Copy link
Member

If this is incorrect then the code in godot-cpp is also incorrect

@bruvzg
Copy link
Member

bruvzg commented Nov 24, 2023

This is not an intended way to do it, target tag probably should be template_release, template_debug and editor, but definitely not empty. If it's not working, it's a bug in the engine, not a documentation issue.

@AThousandShips
Copy link
Member

AThousandShips commented Nov 24, 2023

It also seems to work for godot Jolt, and the standards, it uses the tag not the suffix, it should be debug and release respectively AFAIK, it searches for the feature tags, which for release builds is release, using no tag works, but could probably break with picking it for other ones as it doesn't check any tag

Edit: both release and template_release are valid, but it should be one of those

@AThousandShips
Copy link
Member

Assuming this is verified by the gdextension team by the above, I think this can be closed, based on my analysis of the code

@dsnopek
Copy link
Contributor

dsnopek commented Nov 24, 2023

@AThousandShips Yes, you are correct!

I think what we have already in the docs represents how it should work. If the OP is having issues, it's either (a) something in their setup, or (b) a bug in Godot.

@MoralCode
Copy link
Author

so if scons is building using the template_release configuration, should the values in .gdextension be linux.template_release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"?

@dsnopek
Copy link
Contributor

dsnopek commented Nov 24, 2023

so if scons is building using the template_release configuration, should the values in .gdextension be linux.template_release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"?

That should work, but so should:

linux.release.arm64 = "res://bin/libgdexample.linux.template_release.arm64.so"

The parts of the linux.release.arm64 are feature tags, so linux, release and arm64. All feature tags must be present in the Godot build for a particular GDExtension to be selected. And both release and template_release are valid feature tags that are present in target=template_release builds of Godot.

See here for more information about feature tags:

https://docs.godotengine.org/en/stable/tutorials/export/feature_tags.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants