Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aarch64-unknown-linux-musl as a default target #36

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/rustler_precompiled/config.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ defmodule RustlerPrecompiled.Config do

@default_targets ~w(
aarch64-apple-darwin
aarch64-unknown-linux-musl
x86_64-apple-darwin
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
Expand Down Expand Up @@ -110,7 +111,5 @@ defmodule RustlerPrecompiled.Config do
raise "`#{inspect(field)}` is required for `RustlerPrecompiled`"
end

defp pre_release?(version) do
"dev" in Version.parse!(version).pre
end
defp pre_release?(version), do: "dev" in Version.parse!(version).pre
end
1 change: 1 addition & 0 deletions test/rustler_precompiled/config_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ defmodule RustlerPrecompiled.ConfigTest do

assert config.targets == [
"aarch64-apple-darwin",
"aarch64-unknown-linux-musl",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
Expand Down
15 changes: 14 additions & 1 deletion test/rustler_precompiled_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,20 @@ defmodule RustlerPrecompiledTest do
}

error_message =
"precompiled NIF is not available for this target: \"i686-unknown-linux-gnu\".\nThe available targets are:\n - aarch64-apple-darwin\n - x86_64-apple-darwin\n - x86_64-unknown-linux-gnu\n - x86_64-unknown-linux-musl\n - arm-unknown-linux-gnueabihf\n - aarch64-unknown-linux-gnu\n - x86_64-pc-windows-msvc\n - x86_64-pc-windows-gnu"
"""
precompiled NIF is not available for this target: \"i686-unknown-linux-gnu\".
The available targets are:
- aarch64-apple-darwin
- aarch64-unknown-linux-musl
- x86_64-apple-darwin
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- arm-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- x86_64-pc-windows-msvc
- x86_64-pc-windows-gnu
"""
|> String.trim()

assert {:error, ^error_message} = RustlerPrecompiled.target(config, @available_targets)
end
Expand Down