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

Extract abi from :erlang.system_info #117

Merged
merged 5 commits into from
Dec 12, 2023
Merged

Extract abi from :erlang.system_info #117

merged 5 commits into from
Dec 12, 2023

Conversation

Noarkhh
Copy link
Contributor

@Noarkhh Noarkhh commented Dec 11, 2023

No description provided.

@Noarkhh Noarkhh changed the title Extract abi from :erlang.system_info and add it to target spec Extract abi from :erlang.system_info Dec 11, 2023
@Noarkhh Noarkhh requested a review from mat-hek December 11, 2023 14:27
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`
Copy link
Member

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
Comment on lines 62 to 90
@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
Copy link
Member

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

@Noarkhh Noarkhh merged commit e58796f into master Dec 12, 2023
3 checks passed
@Noarkhh Noarkhh deleted the expand-get-target branch December 12, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants