mix c3nif.precompile (C3nif v0.2.0)

View Source

Build precompiled C3 NIF artifacts for a matrix of target triples.

Maintainers run this task to produce a set of .tar.gz archives — one per target — plus a checksum-<version>.exs manifest. The archives are then uploaded to a release hosting location (typically a GitHub release), and the checksum file is committed into the repository so consumers can verify downloads.

Usage

mix c3nif.precompile
mix c3nif.precompile --target linux-x64
mix c3nif.precompile --module Elixir.MyApp.Nif --version 0.1.0

Options

  • --target — target triple to build for. May be passed multiple times. Defaults to the matrix returned by C3nif.Precompiled.default_targets/0.

  • --module — only build for a specific module. Defaults to every module in the manifest.

  • --version — override the version string used in artifact filenames. Defaults to the OTP app's Mix.Project.config()[:version].

  • --output-dir — where to write the archives and checksum file. Defaults to priv/precompiled/.

What it produces

For each target in the matrix, this task:

  1. Invokes c3c build --target <triple> via C3nif.Compiler.compile/1.
  2. Wraps the resulting shared library in a .tar.gz archive.
  3. Records the archive's SHA-256 in a checksum-<version>.exs manifest.