godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Create the macOS export template structure on the fly when exporting the project #1459

Open Calinou opened 4 years ago

Calinou commented 4 years ago

See also https://github.com/godotengine/godot/issues/10913, which is an older approach to the same issue (but it's less consistent with how exporting to Windows and Linux works).

Describe the project you are working on:

The Godot editor :slightly_smiling_face:

Describe the problem or limitation you are having in your project:

Users who build their own export templates are often confused as to the exact steps required to package export templates for all platforms.

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

We can simplify this process by making the editor do more work on its side. This in turn makes the build process more "fault-tolerant" since it will be harder for users to make mistakes.

@bruvzg suggested doing the following in https://github.com/godotengine/godot/pull/36332#issuecomment-652428695:

Do we need to ship macOS export templates as ZIP at all? It's just folder structure and two text files (Info.plist and PkgInfo), .plist is modified on export anyway, PkgInfo contains static "APPL????" string. Export process can be easily changed to generate them in place.

This way, we can simplify the export template building process by simply adding a macOS binary to the export templates TPZ. Users building their own export templates won't have to create an export template structure based on the files in misc/dist/osx_template.app anymore.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

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

No, as this is related to the editor's export functionality.

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

This is related to the editor's export functionality.

bruvzg commented 4 years ago

How will this work with Apple Silicon?

Probably ship single fat binary with both x86-64 and arm code, it's gonna be twice in size, but at least for the next 3-4 years it's the most reasonable thing to do.

bruvzg commented 4 years ago

Another question, how to ship MoltenVK: as the separate .dylib file or link it statically.

AFAIK, the only negative effect of static linking, it doesn't support validation layers (in addition to default validation layer for the renderer debugging this includes things like RenderDoc and Steam overlay for example).

Calinou commented 4 years ago

@bruvzg We can probably link MoltenVK statically in release builds at least, since we generally don't expect to use validation layers there. The question remains for debug builds though.

snoopdouglas commented 3 years ago

This is the only mention I can find of Apple Silicon in both the engine and proposals repos. Can anyone estimate how much work will be needed to build Godot for Apple Silicon? (we already have ARM builds for mobile, but presumably it's nowhere near that simple)

bruvzg commented 3 years ago

Can anyone estimate how much work will be needed to build Godot for Apple Silicon?

It is building already, both 3.2 and master branches (use Xcode 12.2 RC, use arch=arm64 scons command line argument), but it's not tested on real hardware. Change for Apple Silicon build support for the reference: https://github.com/godotengine/godot/pull/39788, https://github.com/godotengine/godot/pull/39943