View Source mix fennec.precompile (fennec_precompile v0.1.2)
Download and use precompiled NIFs safely with checksums.
Fennec Precompile is a tool for library maintainers that use :elixir_make
and wish to ship precompiled binaries. This tool aims to be a drop-in
replacement for :elixir_make
.
It helps by removing the need to have the C/C++ compiler and other dependencies installed in the user's machine.
Check the Precompilation Guide for details.
options-to-set-in-the-project-function-of-the-mix-exs-file
Options to set in the project
function of the mix.exs
file.
:fennec_base_url
. Required.Specifies the base download URL of the precompiled binaries.
:fennec_nif_filename
. Optional.Specifies the name of the precompiled binary file, excluding the file extension.
:fennec_force_build
. Optional.Indicates whether to force the app to be built.
The value of this option will always be
true
for pre-releases (like "2.1.0-dev").When this value is
false
and there are no local or remote precompiled binaries, a compilation error will be raised.:fennec_force_build_args
. Optional.Defaults to
[]
.This option will be used when
:force_build
istrue
. The optional compiliation args will be forwarded to:elixir_make
.:fennec_force_build_using_zig
. Optional.Defaults to
false
.This option will be used when
:force_build
istrue
. Set this option totrue
to always usingzig
as the C/C++ compiler.:fennec_targets
. Optional.A list of targets supported by Zig for which precompiled assets are avilable. By default the following targets are configured:
on-macos
on macOSx86_64-macos
x86_64-linux-gnu
x86_64-linux-musl
x86_64-windows-gnu
aarch64-macos
aarch64-linux-gnu
aarch64-linux-musl
riscv64-linux-musl
on-linux
on Linuxx86_64-linux-gnu
x86_64-linux-musl
x86_64-windows-gnu
aarch64-linux-gnu
aarch64-linux-musl
riscv64-linux-musl
:fennec_targets
in theproject
will only be used in the following cases:- When
:fennec_force_build
is set totrue
. In this case, the:targets
acts as a list of compatible targets in terms of the source code. For example, NIFs that are specifically written for ARM64 Linux will fail to compile for other OS or CPU architeture. If the source code is not compatible with the current node, the build will fail. - When
:fennec_force_build
is set tofalse
. In this case, the:targets
acts as a list of available targets of the precompiled binaries. If there is no match with the current node, no precompiled NIF will be downloaded and the app will fail to start.