realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

unable to create a universal binary in electron

Open untoldbyte opened this issue 2 years ago • 5 comments

Realm uses prebuilt binaries, so I could not find a way to create a simple way to create a universal binary.

The only option I see is to use a x64 build (using an emulated termina) and a native arm64 build and then combine via lipos

am I missing something?

untoldbyte avatar May 27 '23 17:05 untoldbyte

@untoldbyte Which platform/OS are you attempting to target? It is possible to run npx prebuild-install within node_modules/realm and add flags to determine what arch to download and the path to save it in. From there it should be possible to create universal binary by combining the downloaded libs using something like llvm-lipo

takameyer avatar May 30 '23 09:05 takameyer

mac intel and arm

untoldbyte avatar May 30 '23 11:05 untoldbyte

@untoldbyte At the moment we do not have universal prebuilds, so currently the preferred way forward would be to create separate releases for x64 and arm. We may consider releasing universal binaries, but this will have an significant impact on the size of the downloaded prebuild.

takameyer avatar May 30 '23 15:05 takameyer

is it ok possible to combine two .node addons into a single universal build?

untoldbyte avatar May 30 '23 15:05 untoldbyte

@untoldbyte It should be possible. We just don't provide that at this time. But there nothing stopping someone from taking our prebuild and making a universal one.

takameyer avatar Jun 01 '23 13:06 takameyer