Skip to content

Use template_release on linux to fix a crash with release exports#43

Merged
unvermuthet merged 2 commits into
unvermuthet:mainfrom
guillaumeriousat:add-linux-release-build
Mar 25, 2026
Merged

Use template_release on linux to fix a crash with release exports#43
unvermuthet merged 2 commits into
unvermuthet:mainfrom
guillaumeriousat:add-linux-release-build

Conversation

@guillaumeriousat

Copy link
Copy Markdown
Contributor

Fixes issue this issue #42

Modifies the .gdextension file to use template_release when exporting a project in release mode on linux.

Also adds linux template_release builds to the CI.

The sample app now displays an image in release mode before crashing. It also crashes in debug mode so I think its a separate issue.

@unvermuthet

unvermuthet commented Mar 21, 2026

Copy link
Copy Markdown
Owner

Thanks for catching this!

If I remember correctly, the only reason I even have the CI build target_debug is so that I don't have to change the .gdextension during testing. The CI builds them with debug_symbols=no optimize=speed lto=auto, so it's probably very close to a target_release binary.

Is the issue caused by loading a target_debug binary for release, or by not specifying a specific binary for to use for linux.release?

I'd say, let's take it opportunity and do it proper for all platforms!

@unvermuthet unvermuthet left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

perhaps like so?

Comment thread .github/workflows/builds.yml Outdated
@@ -48,6 +48,21 @@ jobs:
]
target-type: [template_debug]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
target-type: [template_debug]
target-type: [template_release, template_debug]

Comment thread .github/workflows/builds.yml Outdated
Comment on lines +51 to +65
# Only build template_release on linux. release mode template exports can't use
# template_debug on linux but can on other platforms.
include:
- target:
platform: linux
arch: x86_64
os: ubuntu-22.04
target-type: template_release
float-precision: single
- target:
platform: linux
arch: arm64
os: ubuntu-22.04-arm
target-type: template_release
float-precision: single

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
# Only build template_release on linux. release mode template exports can't use
# template_debug on linux but can on other platforms.
include:
- target:
platform: linux
arch: x86_64
os: ubuntu-22.04
target-type: template_release
float-precision: single
- target:
platform: linux
arch: arm64
os: ubuntu-22.04-arm
target-type: template_release
float-precision: single

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This would be covered by adding template_release to the matrix. Results in template_release and template_debug being built for all platforms.

Comment on lines 14 to 15
windows.x86_64.single = "bin/windows/libgodot-ndi.windows.template_debug.x86_64.dll"
macos.single = "bin/macos/libgodot-ndi.macos.template_debug.universal.dylib"

@unvermuthet unvermuthet Mar 21, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
windows.x86_64.single = "bin/windows/libgodot-ndi.windows.template_debug.x86_64.dll"
macos.single = "bin/macos/libgodot-ndi.macos.template_debug.universal.dylib"
windows.x86_64.single.debug = "bin/windows/libgodot-ndi.windows.template_debug.x86_64.dll"
windows.x86_64.single.release = "bin/windows/libgodot-ndi.windows.template_release.x86_64.dll"
macos.single.debug = "bin/macos/libgodot-ndi.macos.template_debug.universal.dylib"
macos.single.release = "bin/macos/libgodot-ndi.macos.template_release.universal.dylib"

@guillaumeriousat

Copy link
Copy Markdown
Contributor Author

My understanding is that the issue is caused by loading a target_debug binary with a release export on linux. The .so file seems to be found when executing the export but it then crashes.

My changes were targeted to linux only because I assumed you would want to leave the other platforms as is but I agree that the changes you have proposed are more straightforward. I'll update my PR later today !

@unvermuthet
unvermuthet merged commit d99e749 into unvermuthet:main Mar 25, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants