RPCS3 / rpcs3

PlayStation 3 emulator and debugger
https://rpcs3.net/
GNU General Public License v2.0
15.42k stars 1.92k forks source link

[Feature request] Add macOS arm64 to CI #12599

Open shinra-electric opened 2 years ago

shinra-electric commented 2 years ago

Quick summary

Add macOS arm64 to Cirrus CI

Details

Cirrus CI currently only provides x86_64 macOS builds.

As of writing, compilation for arm64 is broken (not just on Macs). See #12577 Edit: fixed

There are occasionally regressions that are introduced that go unnoticed since there are no Arm CI builds. This can be prevented with a Cirrus test build.

One argument that may be given for not doing this is that arm64 support on macOS is not fully implemented. However several 2D games such as Dragon's Crown and some of the Arkedo series do actually work.

Edit: Cirrus CI now builds the x86 macOS artefacts using an Arm64 VM, so cross-compilation is not an issue.

clienthax commented 2 years ago

Cirrus does not have arm64 vms for macOS yet from what I can see. In theory we could work around this by making a fairly hacky docker container but that's unideal

shinra-electric commented 2 years ago

I think it does:

https://cirrus-ci.org/guide/macOS/

It's probably new though.

clienthax commented 2 years ago

Messing around with it here https://github.com/clienthax/rpcs3/tree/arm64-tests

shinra-electric commented 2 years ago

Bear in mind it should fail because of #12577

~~Also the arm building instructions from #12115 requires this change in hidapi: sed -i '' "s/extern const double NSAppKitVersionNumber;/const double NSAppKitVersionNumber = 1343;/g" 3rdparty/hidapi/hidapi/mac/hid.c~~ Edit: Nevermind, this is already in the build script

Another known issue to be aware of is that it won’t build if qt@6 is installed. See #12477 ~

shinra-electric commented 2 years ago

@clienthax I was having a look at your branch, and there are a few points about the build script I noticed. (I was going to do a PR but I suddenly realised I don't know how Cirrus works, so I thought I'd just comment here)

When building for Arm on macOS there are a few CMake commands that are different than for x86:

-DPNG_ARM_NEON=ON <-- This is the Arm SIMD instruction set and should be on -DCMAKE_OSX_ARCHITECTURES="arm64" <--This option is missing from the build script -DLLVM_TARGETS_TO_BUILD="X86;AArch64;ARM" <-- I'm not sure why X86 is there, but it's on the Arm build instructions -DUSE_SYSTEM_MVK=ON <-- I don't know if this is required when building on Cirrus -DUSE_SYSTEM_FFMPEG=ON <-- Same

shinra-electric commented 1 year ago

Just bumping this since Cirrus CI now builds the macOS artefacts using an Arm64 VM. It should be easier to implement now than before.

DarthMDev commented 1 year ago

I wonder if arm64 compilation is possible now and if it is could a universal2 build be done

DarthMDev commented 1 year ago

ill also look into building separately

AniLeo commented 1 year ago

For now it's best to just have arm64 separately in CI, universal2 build is not really interesting to spend time building on CI until the arm64 build works properly

AniLeo commented 2 months ago

Updated title, since this should be for Azure CI now