diff --git a/lib/rustler_precompiled.ex b/lib/rustler_precompiled.ex index 70dcb88..7b3ea27 100644 --- a/lib/rustler_precompiled.ex +++ b/lib/rustler_precompiled.ex @@ -557,7 +557,8 @@ defmodule RustlerPrecompiled do arch = normalize_arch(target_system.arch) vendor = - with vendor when vendor in ~w(pc redhat suse) <- target_system.vendor, do: "unknown" + with vendor when vendor in ~w(pc redhat suse alpine) <- target_system.vendor, + do: "unknown" %{target_system | arch: arch, vendor: vendor} diff --git a/test/rustler_precompiled_test.exs b/test/rustler_precompiled_test.exs index 9b72ea7..6e432ac 100644 --- a/test/rustler_precompiled_test.exs +++ b/test/rustler_precompiled_test.exs @@ -60,6 +60,19 @@ defmodule RustlerPrecompiledTest do RustlerPrecompiled.target(config, @available_targets, @available_nif_versions) end + test "x86_64 in a PC running Alpine Linux" do + target_system = %{arch: "x86_64", vendor: "alpine", os: "linux", abi: "musl"} + + config = %{ + target_system: target_system, + nif_version: "2.14", + os_type: {:unix, :linux} + } + + assert {:ok, "nif-2.14-x86_64-unknown-linux-musl"} = + RustlerPrecompiled.target(config, @available_targets, @available_nif_versions) + end + test "x86_64 or amd64 in a PC running Linux" do target_system = %{arch: "amd64", vendor: "pc", os: "linux", abi: "gnu"}