{"record":{"id":"693d83f951f66ac9","repo":"jdx/mise","slug":"precompiled-erlang-is-not-supported-on-musl-linux","errorCode":null,"errorMessage":"precompiled erlang is not supported on musl linux","messagePattern":"precompiled erlang is not supported on musl linux","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/erlang.rs","lineNumber":168,"sourceCode":"            Self::release_tag(version),\n            Self::source_asset_name(version)\n        )\n    }\n\n    fn source_archive_url(version: &str) -> String {\n        format!(\n            \"https://github.com/erlang/otp/archive/{}.tar.gz\",\n            Self::release_tag(version)\n        )\n    }\n\n    fn source_cache_name(url: &str) -> String {\n        format!(\"otp-source-{}.tar.gz\", crate::hash::hash_sha256_to_str(url))\n    }\n\n    fn linux_precompiled_base_url(target: &PlatformTarget) -> Result<String> {\n        if target.libc() == Some(\"musl\") {\n            bail!(\"precompiled erlang is not supported on musl linux\");\n        }\n        let arch = match target.arch_name() {\n            \"x64\" => \"amd64\",\n            \"arm64\" => \"arm64\",\n            other => bail!(\"unsupported architecture: {other}\"),\n        };\n        let os_ver = Self::linux_precompiled_os_version()?;\n        Ok(format!(\"https://builds.hex.pm/builds/otp/{arch}/{os_ver}\"))\n    }\n\n    async fn linux_precompiled_lock_info(\n        version: &str,\n        target: &PlatformTarget,\n    ) -> Result<PlatformInfo> {\n        let base_url = Self::linux_precompiled_base_url(target)?;\n        let release_tag = Self::release_tag(version);\n        let builds = HTTP_FETCH\n            .get_text_cached(format!(\"{base_url}/builds.txt\"))","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/plugins/core/erlang.rs#L150-L186","documentation":"mise refuses precompiled Erlang on musl libc because Bob the Builder (builds.hex.pm) publishes OTP binaries only for glibc Ubuntu. linux_precompiled_base_url bails as soon as the target's libc is musl. It only becomes a hard error when erlang.compile=false; otherwise it demotes to a fallback reason and mise compiles OTP from source with kerl (a long build requiring a C toolchain).","triggerScenarios":"`mise install erlang` on Alpine (or any musl distro — `ldd --version` reports musl), with erlang.compile unset (silent fallback into a long source build) or explicitly false (this error). Also reachable during `mise lock` with compile=false, since lock resolution calls the same base-URL helper.","commonSituations":"Teams moving CI from Debian/Ubuntu images to Alpine for smaller containers; developers on Alpine WSL or NixOS with musl shells hitting either a surprise 20-minute compile or this hard failure.","solutions":["Enable source builds: `mise settings set erlang.compile true`, and install build deps first (on Alpine: `apk add make gcc g++ ncurses-dev openssl-dev`) so kerl can build OTP","Switch to a glibc base image (debian/ubuntu) instead of Alpine if you want precompiled OTP","On Alpine specifically, consider the distro package (`apk add erlang`) and stop managing Erlang with mise there"],"exampleFix":"# before\nFROM alpine:3.20\nRUN mise install erlang@27.1   # musl → no precompiled OTP, hard error with compile=false\n\n# after\nFROM ubuntu:24.04\nRUN mise install erlang@27.1   # glibc → hex.pm precompiled build works","handlingStrategy":"validation","validationCode":"# fail fast (or switch policy) before mise touches erlang on musl\nif ldd --version 2>&1 | head -1 | grep -q musl; then\n  mise settings set erlang.compile true   # or exit with a clear message\nfi\nmise install erlang@27.1","typeGuard":"is_musl() { ldd --version 2>&1 | head -1 | grep -q musl; }","tryCatchPattern":null,"preventionTips":["Standardize CI images on glibc (debian/ubuntu) when precompiled OTP is required","In Dockerfiles, add a comment at the FROM line noting mise erlang needs glibc","If Alpine is mandatory, budget build time and install the gcc/ncurses/openssl dev packages up front"],"tags":["mise","erlang","musl","alpine","libc","precompiled"],"backgroundTag":"musl-libc-unsupported","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}