You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mac: Provide universal binaries for x86_64 & arm64e #2790
What is the current behaviour and why should it be changed?
#2357 introduced native M1 releases. It would be more user-friendly if we packaged both x86_64 and arm64e builds into a single universal binary. This is possible using lipo, but the details have to be figured out.
A first attempt of putting both archs into QMAKE_APPLE_DEVICE_ARCHS has been done in #2357, but it failed due to arch-specific code paths.
If we can't get that to work, it will either need moving both build runs into a single CI job or will require another CI job which takes the artifacts from the previous steps and combines them. The former sounds more realistical, especially considerung the .dmg generation.
Has this feature been discussed and generally agreed?
opus doesn't know about QMAKE_* variables. The issue is that we sneak in the bundled opus compilation via our qmake build system. Part of this is the decision to include platform-specific performance improvements for opus. The issue is that this detection works once and decides to include certain things (i.e. the x86_64 opus optimizations). This makes the compiler fail when doing the arm compilation, as those headers are not supported there.
For testing if this path is usable at all, it might make sense to drop the opus performance improvements. If this works, we could look at finding a way to include those properly for such multi-arch builds. I don't think qmake has any features for that ("arm-only source files"), but we might be able to come up with something.
After having a closer look, I don't see a sane way of passing certain flags/defines for specific archs only (well, clang supports -Xarch_foo, but... we would have to sneak that in via qmake) or specific source or header files for specific archs only.
I suspect the better way forward would be running two standard builds. This could be done in a single CI job which would save all the resources for preparation steps.
I've manually (via SSH) done the following and the resulting binary looks correct:
The final step would be to move it to jamulus.app again and ensure that the plist file is correct (it references the binary name). It should be trivial to modify that manually, but maybe we can find a nicer way to do that via Qt tools.
Hi Christian. I can confirm:
M1 native execution
macOS Monterey
Did require allowing both applications to execute via System Preferences | Security & Privacy
On initial no noticeable issues
Client tested briefly without issue
Activity
ann0see commentedon Aug 22, 2022
So is opus the problem? We should understand if it's a Qt bug or opus doesn't support the config option.
hoffie commentedon Aug 22, 2022
opus doesn't know about
QMAKE_*variables. The issue is that we sneak in the bundled opus compilation via ourqmakebuild system. Part of this is the decision to include platform-specific performance improvements for opus. The issue is that this detection works once and decides to include certain things (i.e. the x86_64 opus optimizations). This makes the compiler fail when doing the arm compilation, as those headers are not supported there.For testing if this path is usable at all, it might make sense to drop the opus performance improvements. If this works, we could look at finding a way to include those properly for such multi-arch builds. I don't think
qmakehas any features for that ("arm-only source files"), but we might be able to come up with something.hoffie commentedon Aug 23, 2022
After having a closer look, I don't see a sane way of passing certain flags/defines for specific archs only (well, clang supports
-Xarch_foo, but... we would have to sneak that in viaqmake) or specific source or header files for specific archs only.I suspect the better way forward would be running two standard builds. This could be done in a single CI job which would save all the resources for preparation steps.
I've manually (via SSH) done the following and the resulting binary looks correct:
/usr/local/opt/qt/6.3.1/macos/bin/qmake QMAKE_APPLE_DEVICE_ARCHS=x86_64 QT_ARCH=x86_64 TARGET=jamulus.x86_64/usr/local/opt/qt/6.3.1/macos/bin/qmake QMAKE_APPLE_DEVICE_ARCHS=arm64 QT_ARCH=arm64 TARGET=jamulus.arm64lipo -create -output jamulus.universal jamulus.*.app/Contents/MacOS/jamulus.*Result:
The final step would be to move it to
jamulus.appagain and ensure that the plist file is correct (it references the binary name). It should be trivial to modify that manually, but maybe we can find a nicer way to do that via Qt tools.hoffie commentedon Aug 24, 2022
The following build is supposed to contain a universal binary which runs both on Intel and M1 Macs:
jamulus_3.9.0dev-26b8fe3_mac.dmg
Could someone please test that build?
Pinging @ashstrahle @PeRAux @josephschito for M1
Pinging @ann0see for Intel
Please report back the following details:
If we have positive feedback, I'll submit a (cleaned up) PR based on hoffie@autobuild/mac-universal-arm64.
Thanks in advance!
ashstrahle commentedon Aug 24, 2022
Hi Christian. I can confirm:
M1 native execution
macOS Monterey
Did require allowing both applications to execute via System Preferences | Security & Privacy
On initial no noticeable issues
Client tested briefly without issue
hoffie commentedon Aug 24, 2022
@ashstrahle Thanks!
Do you remember if this is just as bad or better compared to previous M1 -dev releases?
ashstrahle commentedon Aug 24, 2022
Much easier - less hackery.
Build: Mac: Add universal binary support
Build: Mac: Add universal binary support
Build: Mac: Add universal binary support