puma / puma-dev

A tool to manage rack apps in development with puma
BSD 3-Clause "New" or "Revised" License
1.74k stars 107 forks source link

Binaries for MacOS with ARM64 #273

Closed santostiago closed 3 years ago

santostiago commented 3 years ago

I installed puma-dev using brew install puma/puma/puma-dev in a Macbook Pro M1 with the new Apple Silicon (ARM64 architecture) but when it's running I can see that it's running in x86_64 using Rosetta. Is there a way I can run it natively in ARM64?

nonrational commented 3 years ago

I'm fairly confident that gox can produce a darwin-arm build that can be distributed via Homebrew.

Will investigate this week. Are you available and willing to test an ARM release?

santostiago commented 3 years ago

@nonrational sure :) Just ping me!

santostiago commented 3 years ago

@nonrational any news on this? :)

nonrational commented 3 years ago

I upgraded to 1.16, added arm64 output to gox, and attempted to cut a binary, but launch_socket (which allows puma-dev to bind to ports <1024) imports C headers and refuses to build.

$ gox -os="darwin" -arch="amd64 arm64" -ldflags "-X main.Version=$RELEASE" ./cmd/puma-dev
Number of parallel builds: 11

-->    darwin/arm64: github.com/puma/puma-dev/cmd/puma-dev
-->    darwin/amd64: github.com/puma/puma-dev/cmd/puma-dev

1 errors occurred:
--> darwin/arm64 error: exit status 1
Stderr: package github.com/puma/puma-dev/cmd/puma-dev
    imports github.com/puma/puma-dev/dev
    imports github.com/puma/puma-dev/dev/launch: build constraints exclude all Go files in /Users/norton/src/puma-dev/dev/launch

So, need to find some time to investigate.

bjufre commented 3 years ago

@nonrational any news on this? Is there any way I can help to test things out or something?

nonrational commented 3 years ago

Not as of yet. Still haven't figured out why build constraints prevent building launch_darwin.go on darwin-arm.

WIP branch: https://github.com/puma/puma-dev/tree/darwin-arm

Edit: I suspect we may need to add flags to get it to build w/ the macOS sdk which may have the arm versions of the c libs.

nonrational commented 3 years ago

Alright, if someone on an M1 can extract the binary from https://github.com/puma/puma-dev/releases/download/v0.16.1/puma-dev-0.16.1-darwin-arm64.zip and give it a shot, that'd be helpful! 🤞

santostiago commented 3 years ago

@nonrational Thank you! I'll test it over the weekend :)

santostiago commented 3 years ago

@nonrational it all seems to work fine :) I tested all my apps and they're up and running natively. Let me know if there's something you'd like me to test or some monitoring tool that I should use to analyze it.

Thank you :)

nonrational commented 3 years ago

Great! Thanks @santostiago.

I'll get the updated binaries into the homebrew formula in the next week or so.

Edit: "next week" in this case means next few months, I guess. 😅

thomasdarde commented 3 years ago

FYI When I move the file from the zip it shows a message saying it's not verified by apple.

markjs commented 3 years ago

What's the latest on this? Installing the package from Homebrew appears to still not work on an M1 machine and the release linked in the message above on the 29th April now 404s. Thanks

nonrational commented 3 years ago

arm64 build is now available via the homebrew tap. Please give it a try and report back with any issues. 🙏