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

Allow a way to exclude GDExtensions from exports #9322

Open
AdriaandeJongh opened this issue Mar 18, 2024 · 5 comments
Open

Allow a way to exclude GDExtensions from exports #9322

AdriaandeJongh opened this issue Mar 18, 2024 · 5 comments

Comments

@AdriaandeJongh
Copy link

Describe the project you are working on

A multi-platform game for multiple storefronts, requiring multiple storefront SDKs.

Describe the problem or limitation you are having in your project

I'm using the excellent GodotSteam GDExtension (link) to integrate Steamworks into my game on desktop platforms (Windows, macOS, Linux). However, I will also be releasing the game in other storefronts with their own SDKs (GoG, Itch) on those same platforms, as well as on iOS and Android, and it appears there is currently no way to properly exclude the GodotSteam GDExtension and the binaries that it puts in the export. This adds MBs to the export on every platform, regardless of whether I need those binaries on that platform and in that particular export. As I integrate more and more services and SDKs in my game, this is going to become a problem down the line.

Or perhaps there is a way, but both the creator of GodotSteam and I couldn't find a reliable way without silly hacks. Such hacks included:

  • making wrappers that check for the existence of singletons
  • excluding binary files using the export exclusion settings
  • modifying the extension_list.cfg

When I initially thought I found a way, I asked the GodotSteam team to include it in their docs, but upon further investigation my method turned out to be unreliable. You can read through that process here: GodotSteam/GodotSteam#407

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Ideally, I am able to tell Godot on an export level or through an export template to not include a certain GDExtension. That will mean that the GDExtension and all its binaries are not included for that particular export.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I truly don't know how this should work as I know nothing of the inner workings of plugins, GDExtensions, and exports. I presume the system of enabling / disabling plugins was precisely made for cases like this, but I can't speculate on why GodotSteam was made as a GDExtension as opposed to a plugin.

If this enhancement will not be used often, can it be worked around with a few lines of script?

If there is a workaround, I'd love to hear it.

Is there a reason why this should be core and not an add-on in the asset library?

I don't know.

@AdriaandeJongh
Copy link
Author

I'm sorry if this is such a weak proposal in terms of technical implementation! I'm hoping people smarter than me and with more insight into the engine's inner workings – engine contributors as opposed to game developers / simple users like myself – read this and immediately know how to do this!

@KoBeWi
Copy link
Member

KoBeWi commented Mar 18, 2024

Seems like exporting without the library and then not using the extension is currently the way to go. It causes errors, because extension_list.cfg is force-included in the PCK file, but they are harmless and don't crash even in release build.

AFAIK disabling extensions is already a planned feature, but there is no ETA for when it's implemented.

@AdriaandeJongh
Copy link
Author

Seems like exporting without the library and then not using the extension is currently the way to go. It causes errors, because extension_list.cfg is force-included in the PCK file, but they are harmless and don't crash even in release build.

That is my experience indeed. It just feels incredibly dangerous / YOLO to release a game with startup errors like these.

AFAIK disabling extensions is already a planned feature, but there is no ETA for when it's implemented.

I couldn't find a PR / proposal for that disabling extensions functionality, but good to hear. I'd love to follow the progress on this.

@FireCatMagic
Copy link

I feel like exporting should only export the gdextension stuff if the .gdextension Resource file is included in the export

@xynanlee
Copy link

xynanlee commented Apr 5, 2024

Was looking into this issue as well. I tried to point to different extension_list.cfg file in EditorExportPlatform::get_forced_export_files but it doesn't seem to work. AFAIK, I could see potential solution in:

  1. Allowing extension_list.cfg overrides in the Export Presets.
  2. Allowing GDExtension::get_extension_list_config_file to point other files, so we can have multiple copies of extension_list.cfg for different reasons.
  3. Using sections in extension_list.cfg to categorize what platforms can build what GDExtensions.

All of these suggestions are based on my very very limited knowledge on the codebase so far. Would like to hear more from the devs.

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

No branches or pull requests

5 participants