-
Notifications
You must be signed in to change notification settings - Fork 27
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 support for variants targets #61
Conversation
This is needed in order to load the correct variants and building the list of artifacts for download.
This makes the mix task know that needs to download the variants as well.
This is part of philss/rustler_precompiled#61
@josevalim would you mind to take a look? :) |
lib/rustler_precompiled.ex
Outdated
variants = | ||
maybe_variants_tar_gz_urls( | ||
metadata[:variants], | ||
base_url, | ||
target_triple, | ||
metadata[:lib_name] | ||
) | ||
|
||
[tar_gz_file_url(base_url, file_name) | variants] |
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.
Maybe worth encapsulating inside a tar_gz_urls
function since it is defined both here and above.
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.
Nice! I moved to a private function :)
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.
Two minor nits and ship it!
* Support building with a variant name This is part of philss/rustler_precompiled#61 * Add the "features" option and improve logging * Change the `features` input to `cargo-args` The idea is to have more flexibility, enabling more arguments to be passed. * Add a flag to enable debug mode compilation * Fix term and docs
This feature introduces variants, which are alternative versions that can be configured in compile time to
load a specific precompiled NIF depending on the result of callback functions.
This enables developers to set different versions for the same target, depending on which versions of dependencies the target machine has.
Remember that the callback will always run at compile time, in the machine that is doing the compilation.
This may be enough to fix #59 and elixir-explorer/explorer#590
TODOs