jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
10.13k stars 291 forks source link

Faster installs for erlang #2721

Open paradox460 opened 1 month ago

paradox460 commented 1 month ago

Currently, both the old ASDF erlang plugin and the built-in erlang plugin depend on kerl to build the erlang binary every single time.

This is acceptable on a dev machine, but when trying to use in CI, particularly on a slower project, where builds are infrequent, it can stretch a build to many times its length, as erlang has to be rebuilt every time.

https://github.com/erlef/setup-beam uses pre-built binaries that target various operating systems common in CI providers. It does this by sourcing them from various files on builds.hex.pm or on a mirror, as they are originally built by bob.

The logic for choosing which file to download is fairly simple, albeit long, due to the amount of things supported. But at its heart its just attempting to download https://builds.hex.pm/builds/otp/<architecture>/<versionSpec>.tar.gz for erlang versions.

There's been a discussion about this for a long time on the old asdf-erlang plugin, but it hasn't seen much traction since 2022

cw789 commented 5 days ago

Also for MacOS there are now builds available: https://elixirforum.com/t/new-community-maintained-otp-builds-for-macos/67338

jdx commented 5 days ago

I'd accept a pr but we'd probably need to retain the old behavior and have a setting like MISE_ERLANG_COMPILE similar to MISE_PYTHON_COMPILE and MISE_NODE_COMPILE