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

[4.0] Add GDNative Framework support for macOS, add Unix symlink API. #46866

Merged

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Mar 10, 2021

Adds ability to select, load and export (both .dmg and .zip) macOS ".frameworks" as GDNative libraries.
Adds minimal symlink API to DirAccess (frameworks usually contain multiple relative symlinks).

Framework export won't work from Windows (If there are symlinks in the framework). NTFS have support for symlinks, but I do not see any way to get relative symlink target path, all functions seems to return full path. And creating symlinks seems to require privilege elevation. Not sure what to do with it (currently it will print a warning).

Edit: Relative symlinks are supported and DeviceIoControl(FSCTL_GET_REPARSE_POINT) function can get correct relative path, but none of Windows apps seems to use them and all Windows ZIP software extract symlinks as text files with the target path. Even if working readlink equivalent is added, Windows users won't be able to acquire macOS framework with correct structure in the first place.

Version for 3.2 - #46860

@bruvzg bruvzg force-pushed the symlinks_and_macos_gdn_framework_export_4 branch from 080d4a3 to bedb40c Compare May 22, 2021 14:34
@bruvzg bruvzg marked this pull request as draft May 22, 2021 14:53
@bruvzg
Copy link
Member Author

bruvzg commented May 22, 2021

Actually, just renaming 64 to universal probably won't work and need a bit more changes to the GDNative loading (OS features).

@bruvzg bruvzg force-pushed the symlinks_and_macos_gdn_framework_export_4 branch 3 times, most recently from 90d316a to c06afe8 Compare May 24, 2021 07:09
@bruvzg
Copy link
Member Author

bruvzg commented May 24, 2021

Removed separate x86_64 and arm64, it's just an unnecessary complication, default export template is universal and there's no way to determine architecture of the custom export template (implementing MachO header reader is easy, but I do not see any benefits of doing it).

@bruvzg bruvzg marked this pull request as ready for review May 24, 2021 07:59
@akien-mga
Copy link
Member

Removed separate x86_64 and arm64, it's just an unnecessary complication, default export template is universal and there's no way to determine architecture of the custom export template (implementing MachO header reader is easy, but I do not see any benefits of doing it).

I guess we'll need to clarify the documentation so users know they can put either a universal binary, an x86_64 or an arm64 binary for the single 64 entry (matching their export template).

@bruvzg bruvzg force-pushed the symlinks_and_macos_gdn_framework_export_4 branch from c06afe8 to a1cb6f0 Compare May 24, 2021 09:49
@akien-mga akien-mga merged commit 65eff1c into godotengine:master May 24, 2021
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the symlinks_and_macos_gdn_framework_export_4 branch November 5, 2021 12:57
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.

None yet

2 participants