Explicit platform descriptions for the six proposed v0.1 targets.
new/1 accepts string-keyed data, never host information or a language-specific
triple. It performs no OS probing, process execution, network requests or atom
creation. An explicit target describes the intended BEAM, which can differ from
the physical machine (for example, an x86_64 BEAM under Rosetta).
These are candidate platform contracts, not a list of certified platforms. Minimum OS/libc/ERTS versions and system-library requirements live in the manifest's compatibility record and require later resolver/runtime checks.
Summary
Functions
Validates an explicit target, deriving only fixed platform invariants.
Tests only the conservative NIF API requirement: same major, required minor no newer than runtime minor. It does not prove overall artifact compatibility.
Parses an NIF API version without interpreting it as a decimal number.
Types
@type nif_version() :: {pos_integer(), non_neg_integer()}
@type t() :: %NativeArtifact.Target{
arch: :x86_64 | :aarch64,
cpu_baseline: :x86_64 | :armv8_a,
endianness: :little,
libc: :glibc | :musl | :none,
object_format: :elf | :mach_o,
os: :linux | :macos,
pointer_width: 64,
source: :explicit
}
Functions
@spec new(map()) :: {:ok, t()} | {:error, NativeArtifact.Error.t()}
Validates an explicit target, deriving only fixed platform invariants.
os, arch and libc are required; unknown libc is never treated as GNU.
Optional invariant fields must match the selected platform exactly.
Tests only the conservative NIF API requirement: same major, required minor no newer than runtime minor. It does not prove overall artifact compatibility.
@spec parse_nif_version(term()) :: {:ok, nif_version()} | {:error, NativeArtifact.Error.t()}
Parses an NIF API version without interpreting it as a decimal number.