cotag / http-parser

A super fast http parser for ruby
MIT License
18 stars 17 forks source link

Support installing on Apple Silicon Macs #10

Closed crafterm closed 3 years ago

crafterm commented 3 years ago

Hi Team,

Hope all is going well.

The ext Rakefile currently assumes an x86 architecture for mac targets which prevents building an arm64 native bundle on an Apple Silicon Mac.

This PR removes that assumption - building for either platform now uses the right architecture:

ie. Intel Mac:

➜  http-parser git:(feature/remove-explicit-x86) ✗ file /Users/crafterm/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/x86_64-darwin/libhttp-parser-ext.bundle
/Users/crafterm/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/x86_64-darwin/libhttp-parser-ext.bundle: Mach-O 64-bit bundle x86_64

ie. Apple Silicon Mac

➜  http-parser git:(feature/remove-explicit-x86) ✗ file /Users/crafterm/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle
/Users/crafterm/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/http-parser-1.2.2/ext/arm-darwin/libhttp-parser-ext.bundle: Mach-O 64-bit bundle arm64

Cheers,

M!

MCarroll commented 3 years ago

/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/http-parser-1.2.2/ext/aarch64-darwin/libhttp-parser-ext.bundle: mach-o, but wrong architecture