I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily driver.
Wondering if anyone out there has had any luck installing elixir and Erlang using a version manager like asdf? I’ve been trying but getting a few build errors. If it takes considerable effort I’ll probably remote into a server to do whatever elixir development I need to until its more documented and better supported.
Try compiling it from the GitHub repo, in particular, the maint branch, as there have been some fixes related to BigSur recently: https://github.com/erlang/otp/pull/2865
I plan to buy an M1 Pro. My development is now pretty much only Elixir (Phoenix/LiveView etc). So if I can install Elixir using Homebrew (with Rosetta2), it seems I can push the Order button.
The script simply downloads precompiled OTP & Elixir releases. See https://github.com/wojtekmach/beamup. Currently the only available OTP release is 23.1.4 on , darwin-x86_64, darwin-arm64, linux-x86_64, and linux-armv7l (built on rpi4).
If you have a Mac with M1, this should work out of the box natively as well as via Rosetta 2.
As I mentioned initially, this is just a proof of concept. I had brief discussion with members of OTP team on attaching pre-compiled builds to new OTP releases, for macOS in particular. If GitHub ever exposes darwin-amd64 as a target, we’d definitely take advantage of that too.
That being said, you’d most likely want to use Homebrew for other things so it might make sense to use the unofficial support or wait for the official one. I’m personally trying out MacPorts this time around and it seems to work pretty well though it can’t install erlang yet.
I just used Migration Assistant to transfer everything from my 2017 MBP to my new Mac mini. Whatever I had running with Elixir on the old system just works for me. I presume this is Rosetta 2 magic.
I had to launch VSCode twice. The first time the Elixir LS plugin crashed. Second time, no issues.
I’ve not tried to recompile or install the latest version yet. Was holding off for official main branch support because what I have works just fine for now.
However, asdf doesn’t work. There are two issues, at least:
It requires brew install curl, but it failed currently because installing sphinx-doc failed.
asdf install erlang 23.1.4 raises an error while configure. To fix it according to https://github.com/asdf-vm/asdf-erlang/issues/161 , tar czvf OTP-23.1.4.tar.gz otp-OTP-23.1.4 doesn’t work due to an error: tar: Failed to clean up compressor
I can confirm that installing elixir “just works” on a new Macbook Air M1 with a single brew install elixir for me when installing brew in /opt/homebrew (as advised by homebrew).