Skip to content

Commit e58796f

Browse files
authored
Extract abi from :erlang.system_info (#117)
* Extract abi from :erlang.system_info and add it to target spec * Bump version to 1.4.1
1 parent 19a5cca commit e58796f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/bundlex.ex

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,29 @@ defmodule Bundlex do
99
@type platform_t :: :linux | :macosx | :windows32 | :windows64 | :nerves
1010

1111
@typedoc """
12-
A map containing three fields that describe the platform.
12+
A map containing four fields that describe the platform.
1313
1414
It consists of:
1515
* architecture - e.g. `x86_64` or `arm64`
1616
* vendor - e.g. `pc`
1717
* os - operating system, e.g. `linux` or `darwin20.6.0`
18+
* abi - application binary interface, e.g. `musl` or `gnu` (nil if unknown / non-existent)
1819
"""
1920
@type target ::
20-
%{architecture: String.t(), vendor: String.t(), os: String.t()}
21+
%{architecture: String.t(), vendor: String.t(), os: String.t(), abi: String.t() | nil}
2122
@doc """
2223
A function returning a target triplet for the environment on which it is run.
2324
"""
2425
@spec get_target() :: target()
2526
def get_target() do
26-
[architecture, vendor, os | _rest] =
27+
[architecture, vendor, os | maybe_abi] =
2728
:erlang.system_info(:system_architecture) |> List.to_string() |> String.split("-")
2829

2930
%{
3031
architecture: architecture,
3132
vendor: vendor,
32-
os: os
33+
os: os,
34+
abi: List.first(maybe_abi)
3335
}
3436
end
3537

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Bundlex.Mixfile do
22
use Mix.Project
33

4-
@version "1.4.0"
4+
@version "1.4.1"
55
@github_url "https://github.com/membraneframework/bundlex"
66

77
def project do

0 commit comments

Comments
 (0)