godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.04k stars 20.19k forks source link

Problem adding folder structure containing dylibs to OSX exported app using `EditorExportPlugin`. #52184

Closed piiertho closed 2 years ago

piiertho commented 3 years ago

Godot version

3.3.3-stable (from source, with kotlin support)

System information

OSX arm64

Issue description

I don't know if it is a bug, but did not see any category that fits better. It is not really a bug IMO, but more a corner case. I'm currently working on OSX exports for godot-kotlin.
We currently have troubles making OSX export because we have to embed the JRE the user wants (Note that embedding the jre in the template we will provide is not an option as the user should be able to select its JVM version).

In case of graalvm native image we have a simple dylib at the end, so this will be easy to add it to app, sign it and use it, by using EditorExportPlugin::add_shared_object method.

The troubles start when we want to use a classic JVM (like OpenJDK).
We have to load the jvm using libjvm.dylib, which is located in : jre-folder/lib/{client|server|hotspot}/libjvm.dylib.
The thing is JVM needs also to load some other libraries, but to do so JVM will look at libjvm.dylib path to get where are those libraries, look here.

So to sum up, in export plugin I need:

For now it seems I just have two ways to add files to the export:

Did I missed something about how to add files to OSX app from export plugin ?

Steps to reproduce

Pretty hard to provide as I'm working on fixing the OSX export on our side.

Minimal reproduction project

No response

piiertho commented 3 years ago

@Calinou not sure about gdnative topic, since we're not using it with kotlin module.

akien-mga commented 3 years ago

CC @godotengine/macos