Is there a way to build a universal pkg (Intel + ARM64) for Mac? That is needed to be able to upload...
t
Is there a way to build a universal pkg (Intel + ARM64) for Mac? That is needed to be able to upload it to the Apple AppStore.
👀 1
a
You can try to add both MacOS dependencies instead of
Copy code
implementation(compose.desktop.currentOs)
use
Copy code
implementation(compose.desktop.macos_arm64)
implementation(compose.desktop.macos_x64)
In my undestanding it should include both platform binaries into the bundle
t
Thanks, I gave it a try but when doing a right click and get info on the produced
.app
it still shows
Apple Silicon
instead of
Universal
. I am building the project on an M1 Mac with an ARM64 JDK. I am not sure what to do about the bundled JRE. Would I need to include it twice (for Intel and for ARM64) or so?
a
That is a good question. Could I ask you to create an issue on github, since the topic seems to be an important one
t
Sure. Should I create a single issue for all Apple AppStore related issues and feature requests?
I noticed some stuff that is missing in the jpackage task etc
a
Let’s start with a single issue. We can always split it later
👍 1
@Alexander Kurasov[JB] I have been working on some fixes for the jpackage command, which is required for the App Store. Could you maybe take a look? https://github.com/JetBrains/compose-jb/pull/1613
j
@Thomas how far did you get with this? it would be great to not have to switch between an M1 and an Intel mac just to build two different builds of our CfD applications I also noticed this issue which appears stale, and I am wondering if there is some way we can contribute?: https://github.com/JetBrains/compose-jb/issues/518 cc: @Igor Demin
t
Have not looked further into this yet. For now I am just uploading an Intel-only build. I think the solution would be: 1. build a universal intel/arm64 jar; 2. merge intel/arm64 JREs into one JRE at build time.
For now I am quite busy with Windows but I plan to pick up the macOS issues in the coming months.
There is an open issue about universal Mac build here: https://github.com/JetBrains/compose-jb/issues/1599
Unfortunately it is not as easy as just building a universal jar, as the jre is not universal.
@james if you have any ideas please share them
To build a universal JRE, I think the way to go would be to use
jlink
twice. One time with an Arm64 JDK, second time with an Intel JDK. Then you have two JREs. Must be the exact same JDK version. Then merge the JREs manually using the Apple tools for this into a universal JDK. Then pass that universal JDK to
jpackage
. At least that is what I am going to try when I look into it again.
I have not had the time to look into this further yet, it is not a priority for me at the moment.