-
Notifications
You must be signed in to change notification settings - Fork 14
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
Extract abi from :erlang.system_info #117
Conversation
lib/bundlex.ex
Outdated
|
||
It consists of: | ||
* architecture - e.g. `x86_64` or `arm64` | ||
* vendor - e.g. `pc` | ||
* os - operating system, e.g. `linux` or `darwin20.6.0` | ||
* abi (optional) - application binary interface, e.g. `musl` or `gnu` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saying that abi
key is optional
suggests, that typespec target
looks like %{optional(:abi) => String.t(), ...}
, while it is %{abi: String.t() | nil, ...}
lib/bundlex.ex
Outdated
@spec default_os_dep_config(os_dep_name :: atom()) :: Bundlex.Project.os_dep() | ||
def default_os_dep_config(os_dep_name) do | ||
precompiled_package_url_prefix = | ||
"https://github.com/membraneframework-precompiled/precompiled_#{os_dep_name}/releases/latest/download/#{os_dep_name}" | ||
|
||
precompiled_package_url = | ||
case Bundlex.get_target() do | ||
%{os: "linux", vendor: "alpine"} -> | ||
nil | ||
|
||
%{os: "linux"} -> | ||
"#{precompiled_package_url_prefix}_linux.tar.gz" | ||
|
||
%{architecture: "x86_64", os: "darwin" <> _rest_of_os_name} -> | ||
"#{precompiled_package_url_prefix}_macos_intel.tar.gz" | ||
|
||
%{architecture: "aarch64", os: "darwin" <> _rest_of_os_name} -> | ||
"#{precompiled_package_url_prefix}_macos_arm.tar.gz" | ||
|
||
_other -> | ||
nil | ||
end | ||
|
||
if precompiled_package_url != nil do | ||
{os_dep_name, [{:precompiled, precompiled_package_url}, :pkg_config]} | ||
else | ||
{os_dep_name, [:pkg_config]} | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this functions? It is not used anywhere
No description provided.