Precompiled.Host (precompiled v0.2.0)

Copy Markdown View Source

Install signed, verified precompiled dependency builds instead of compiling them.

Opt in with config :precompiled, source: url. In a Mix project the mix precompiled.deps task, reached through the project's deps.loadpaths alias, calls run/1 before Mix compiles the dependencies (the Nerves nerves.init hook calls it the same way); install/2 wraps Mix.install/2. Every candidate dependency prints HIT, MISS or FAIL with a reason, and the same list lands in _build/<target>_<env>/lib/.precompiled/report.json.

Summary

Functions

Mix.install/2 with precompiled builds: resolves deps, installs every matching build into the install project, then calls Mix.install/2, which compiles only the rest. Takes Mix.install/2's options plus :source, :except, :root and :home (see Precompiled.Config); without a source, configured or given, it is a plain Mix.install/2.

The build-time step: check every dependency Mix is about to compile and install the matching builds. :disabled without a source, and on the host target unless allow_host: true (what mix precompiled.deps passes); host?: true | false forces either.

Functions

install(deps, opts \\ [])

@spec install([term()], keyword()) :: :ok

Mix.install/2 with precompiled builds: resolves deps, installs every matching build into the install project, then calls Mix.install/2, which compiles only the rest. Takes Mix.install/2's options plus :source, :except, :root and :home (see Precompiled.Config); without a source, configured or given, it is a plain Mix.install/2.

Needs Mix on the device (:mix in extra_applications), a writable MIX_INSTALL_DIR, and Hex.

run(opts \\ [])

@spec run(keyword()) :: :disabled | :nothing_to_do | {:ok, Precompiled.Check.report()}

The build-time step: check every dependency Mix is about to compile and install the matching builds. :disabled without a source, and on the host target unless allow_host: true (what mix precompiled.deps passes); host?: true | false forces either.