The key: when a precompiled build may stand in for a local compile. Pure functions over the project's lock, the manifest entry and the toolchain, so every rule is testable without a network or a build.
Summary
Functions
Names a build for a HIT or MISS line: the first 12 characters of its
files hash (files_hash/1), then, where known, its variant, its
toolchain, its system and release, and how its closure differs from the
one Mix compiles the package with here, as in
"3f2a9c01b7de: without, Elixir 1.18.4/OTP 27, closure -decimal".
The identity of a build's bytes: sha256 over its files' path, sha256 and mode, in path order. Two manifest entries with the same hash install the same files. nil for an entry with a malformed file list, or a path with a NUL or newline, which could pass one file off as another's line.
Lock-closure children of nerves; nerves_bootstrap recompiles them whenever it compiles nerves.
select/2 with the reason of a miss as a reason struct: the code
and arguments a miss report sends, beside the text the line prints.
Types
@type ctx() :: %{ optional(:manager) => String.t() | nil, optional(:overrides) => [atom()], optional(:build_method_unknown) => String.t() | nil, optional(:systems) => map() | nil, optional(:getenv) => (String.t() -> String.t() | nil), optional(:machine_env) => (String.t() -> String.t() | nil), optional(:elixir_compiler_options) => (-> term()), optional(:compile_order) => Precompiled.Env.compile_order() | nil, optional(:env_closure) => [atom()] | nil, optional(:dep_sources) => Precompiled.Env.dep_sources() | nil, optional(:user_config) => (String.t(), String.t() -> term()), optional(:user_config_all) => (String.t() -> term()), optional(:host_native) => map() | nil, optional(:probe) => map() | nil, name: String.t(), version: String.t(), lock_entry: tuple(), lock: map(), system: {String.t(), String.t()}, elixir: String.t(), otp: String.t(), dep_env: String.t(), config: (String.t(), [String.t()] -> {:ok, term()} | :error), prefer: String.t() | nil }
Functions
Names a build for a HIT or MISS line: the first 12 characters of its
files hash (files_hash/1), then, where known, its variant, its
toolchain, its system and release, and how its closure differs from the
one Mix compiles the package with here, as in
"3f2a9c01b7de: without, Elixir 1.18.4/OTP 27, closure -decimal".
The variant is a world build's own (world_phx), else with or
without the package's optional deps, for a package that declares any.
In the closure, +name is a dep the build was made with that Mix leaves
out here, -name one Mix compiles it with that the build lacks.
Only manifest values and dependency names are printed, each reduced to
the characters a reason argument may hold (letters, digits and
_ . + : -; anything else prints as ?); nothing from the environment
is read. Never raises.
The identity of a build's bytes: sha256 over its files' path, sha256 and mode, in path order. Two manifest entries with the same hash install the same files. nil for an entry with a malformed file list, or a path with a NUL or newline, which could pass one file off as another's line.
A build's foreign_priv entries (0.8.0), when it has any, are hashed
after its own files, apart from them; an entry without any hashes as it
did before. So is a relocated build's relocation record (0.9.0).
Lock-closure children of nerves; nerves_bootstrap recompiles them whenever it compiles nerves.
select/2 with the reason of a miss as a reason struct: the code
and arguments a miss report sends, beside the text the line prints.