BarredEwe / Prefire

🔥 A library based on SwiftUI Preview, for easy generation: Playbook view, Snapshot and Accessibility tests
Apache License 2.0
290 stars 18 forks source link

Update binary to support Intel machines #40

Closed stefanceriu closed 8 months ago

stefanceriu commented 8 months ago

With Prefire itself now being a binary distributed through an artifact bundle we now need to cater for Intel machines separately (like Github runners). I've updated the binary and the makefile to take care of that.

Otherwise, we get problems like: Prefire/Binaries/PrefireBinary.artifactbundle/prefire-2.0.0-macos/bin/prefire' failed: Bad CPU type in executable - https://github.com/element-hq/compound-ios/actions/runs/8140423466/job/22245584993

Passing in --arch arm64 --arch x86_64 at compile time will do the right thing and generate a fat binary like so:

file prefire

prefire: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
prefire (for architecture x86_64):  Mach-O 64-bit executable x86_64
prefire (for architecture arm64):   Mach-O 64-bit executable arm64

This will add 1.55MB to the binary so I guess the other option would be to split the artifact bundle into its individual slices.

BarredEwe commented 8 months ago

Thanks for the Pull Request! I checked, it works fine. As for the fact that the size has increased, I think it is not critical now and is generally solvable. It will be possible to finalize it separately later.