Mac M1 CI build
GitHub Actions doesn't have M1 runners yet (#2187). We can either wait for that or try to have our current Mac CI build a universal build.
@tecandrew want to take a stab at a universal build?
sure. i've actually given this a try before putting up the M1 PR, but had little luck. brew installs either arm64 or x86 libs and i didn't find a way to indicate pulling universal2 brew libs (if they exist). Did find a way to pull x86 using Rosetta2 though 😅
I'll give it another whirl. Perhaps xcode+cmake would be the way to go
I looked into that briefly too. If there's a way to install the ARM libraries on the x86 runner, then this should be pretty trivial. But nothing came up with a quick google, only for the other way around (x86 libs on M1).
few findings:
-
couldn't get
-GXcodecmake builder working properly, and pointingcmakein the direction to create for bothx86_84;arm64still complains that a lib isn't it the right architecture during the linking stage -
i dont know
sconsenough to know how to cross build for x86_64 on M1 forlibcereal.-archs=and-platform=variables don't seem to do anything
however, as a sanity check, I manually linked the binaries myself from the latest plugins releases (Darwin-x86_64 & Darwin-arm64) and it amazingly works with no issue lmao. I've tested the binaries myself both on Darwin x86 and arm64.
give them a try? its super hacky, but if you wanna avoid reworking the current codebase maybe a CI machine could just manually create the universal2 plugins using lipo -create -output <lib_nameoflib.dylib> <arm64.dylib> <x86.dylib>
Ah, I forgot about building our own libraries. That indeed makes things trickier. We have a CI mac mini for agnos builds, but I'm not sure it's worth setting up Jenkins for an automatic PlotJuggler build. Let's see how often the M1 release actually needs to be updated. I'm hoping we either need to update the M1 release rarely or GitHub launches an M1 runner soonish.