wordpress-mobile / WordPress-iOS-Shared

Shared components used in building the WordPress iOS apps and other library components
GNU General Public License v2.0
18 stars 22 forks source link

Add support for m1 machines #285

Closed jkmassel closed 3 years ago

jkmassel commented 3 years ago

This PR adds M1 machine support by taking care of a few housekeeping things:

Since I'm doing housekeeping anyway, I also tackled a couple of small things:

astralbodies commented 3 years ago

@jkmassel I bumped Ruby to 2.7.2 as 2.6.4 does not easily compile (well, compile at all) on an arm64 Mac with rbenv. 2.7.2 just works. Hopefully that's cool?

astralbodies commented 3 years ago

Of course now I'm getting a crash in Ruby... 🤦

➜  WordPress-iOS-Shared git:(add/support-for-m1-machines) bundle exec pod install
Analyzing dependencies
/Users/aarondouglas/src/WordPress-iOS-Shared/vendor/bundle/ruby/2.7.0/gems/ethon-0.12.0/lib/ethon/curls/options.rb:103: [BUG] Segmentation fault at 0x0000000000000002
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin20]

I think this is the cursed CocoaPods crash people have been talking about. I'm kind of surprised I hadn't run into this with other projects yet. How much of this PR are we assuming is running against arm64 binaries vs. in Rosetta 2? Should Ruby be x86_64?

jkmassel commented 3 years ago

I think this is the cursed CocoaPods crash people have been talking about. I'm kind of surprised I hadn't run into this with other projects yet. How much of this PR are we assuming is running against arm64 binaries vs. in Rosetta 2? Should Ruby be x86_64?

For now, I think it's reasonable to assume folks are only ever using Ruby with x86_64, yeah – it works fine and is far more stable, so for the immediate future I don't see a reason not to?

jkmassel commented 3 years ago

Hopefully that's cool?

Yes, it is very cool!