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

Ditch .framework folders and let the export plugin copy and sign .dylib files #78

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

unvermuthet
Copy link
Contributor

@unvermuthet unvermuthet commented Feb 19, 2025

This is a draft PR for removal of .framework folders.

At the last GDExtension meeting we discussed the possibility of ditching the use of framework folders for MacOS and iOS and letting Godot's export plugin handle the code signing. This simplifies the directory structure, the library paths in the .gdextension file and the builds.yml workflow.

MacOS and iOS binaries ...

Before we can consider this it needs to be verified that the export plugin's codesigning of shared objects is functional.

Here are the logs of the export on MacOS:
https://pastebin.com/EB1Pj5B5 (built-in signing)
https://pastebin.com/8qYa1sf4 (xcode signing)

You can see on line 18 that the .dylib file was copied to Contents/Framework/ without a .framework folder. The resulting project is functional so I can confirm that the .framework folder doesn't seem to be required. I can't however speak on the code signing since I don't have an Apple Developer Account.

If you want to reproduce you can export a project on MacOS with this artifact.

Use matrix notation to reduce clutter and update Ubuntu runner image
@Ivorforce
Copy link
Contributor

You can see on line 18 that the .dylib file was copied to Contents/Framework/ without a .framework folder. The resulting project is functional so I can confirm that the .framework folder doesn't seem to be required.

Unfortunately, .framework is required on iOS because otherwise, you won't be accepted into the app store. Here's an article that goes into this.

I haven't been able to successfully export an iOS project so far, so I can't confirm whether it creates .framework or not. The cpp code certainly seems to think so: https://github.com/godotengine/godot/blob/e567f49cbb292dd6bb628348e67c1f3c2a3a5f99/platform/ios/export/export_plugin.cpp#L1484

@unvermuthet
Copy link
Contributor Author

In that case we could either upgrade the export plugins to create the folders or keep the .framework folders and just get rid of the signing.

@Ivorforce
Copy link
Contributor

Ivorforce commented Feb 19, 2025

If I'm seeing it correctly, you tested macOS export. I think only the iOS godot exporter upgrades to .framework. So it could still be that it already does it and we don't need to touch it.

@unvermuthet
Copy link
Contributor Author

unvermuthet commented Feb 19, 2025

I tried my luck at exporting an iOS build but didn't get far. The macOS VM I'm running on my Proxmox server is very laggy. I'm going mental trying to make it work. It would be neat if someone could go metal instead - haha - and try exporting a project with the artifact for iOS and post the --verbose logs here.

@Ivorforce
Copy link
Contributor

I'm on mac and I've been trying, but I'm not sure its possible without a dev account. Certainly complained every time so far.

@unvermuthet
Copy link
Contributor Author

unvermuthet commented Feb 20, 2025

I tried exporting the project for iOS. It didn't succeed but there are interesting errors before the critical failure. Only happens with the GDExtension installed. Here are the full logs: https://pastebin.com/xBZru8VH. No mention of the extension's dylib.

Exporting additional assets
ERROR: Condition "err != OK" is true. Returning: err
   at: _export_additional_assets (platform/ios/export/export_plugin.cpp:1853)
ERROR: Condition "err" is true. Returning: err
   at: _export_additional_assets (platform/ios/export/export_plugin.cpp:1895)

The dylibs should be processed in _export_additional_assets. The two errors could be traced like this:

export_plugin.cpp:1853
export_plugin.cpp:1895
=> _copy_asset L1759
=> some return in _convert_to_framework

@unvermuthet
Copy link
Contributor Author

Since bruvzg confirmed on RocketChat that the iOS exporter should convert the raw dylibs to frameworks we should keep pursuing this.

Godot iOS exporter should support any of the options, dynamic Framework, static or dynamic Framework, raw dylibs should also be auto-converted to Frameworks.

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