[precompilation] add support for multiple NIF versions #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously the NIF version is hard-coded as
:erlang.system_info(:nif_version)
inElixirMake.Artefact.archive_filename/2
, which would only generate archive filenames for the current NIF version (whichever value the current Erlang/OTP happens to be).This PR adds an optional config key
make_precompiler_nif_versions
that allows users to set all available NIF versions for their precompiled artefacts in theversions
sub-key.Furthermore, an
availability
sub-key is introduced to tell if the current combination oftarget
andnif_version
is available. Adding this sub-key solves an issue that for some platforms, maybe we only have precompiled artefacts after a certain NIF version, say for x86_64 Windows we have precompiled artefacts available when NIF version >=2.16
while other platforms have precompiled artefacts available from NIF version >=2.15
.In such case, we can inform
:elixir_make
that Windows targets don't have precompiled artefacts available except for NIF version2.16
by passing a function to theavailability
sub-key.After applying these changes, we can download all available precompiled artefacts.
Testing project cocoa-xu/exqlite