View Source mix fennec.precompile (fennec_precompile v0.1.3)
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
truefor pre-releases (like "2.1.0-dev").When this value is
falseand 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_buildistrue. 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_buildistrue. Set this option totrueto always usingzigas 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-macosx86_64-linux-gnux86_64-linux-muslx86_64-windows-gnuaarch64-macosaarch64-linux-gnuaarch64-linux-muslriscv64-linux-musl
on-linux
on Linuxx86_64-linux-gnux86_64-linux-muslx86_64-windows-gnuaarch64-linux-gnuaarch64-linux-muslriscv64-linux-musl
:fennec_targetsin theprojectwill only be used in the following cases:- When
:fennec_force_buildis set totrue. In this case, the:targetsacts 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_buildis set tofalse. In this case, the:targetsacts 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.