NativeArtifact.Installer (native_artifact v0.1.0)

Copy Markdown View Source

Transactional local-byte installation of an exact Manifest v1 artifact.

This internal boundary revalidates the complete manifest but does not resolve runtime compatibility. It reads only a supplied local archive or a fully verified existing installation. Network/cache access, native loading, source compilation and Mix priv symlink handling are separate boundaries.

Files live under the physical application-owned priv_dir at native/<package>/<package_version>/<artifact_id>/<archive_sha256>/, with a separate payload/ directory and portable receipt.json. A unique sibling staging tree is promoted only after all bytes, metadata and receipt are ready.

Summary

Functions

Installs exact local bytes or reuses a completely verified immutable directory.

Functions

install(manifest, artifact_id, archive_path, opts \\ [])

@spec install(NativeArtifact.Manifest.t() | map(), binary(), binary(), keyword()) ::
  {:ok, map()} | {:error, NativeArtifact.Error.t()}

Installs exact local bytes or reuses a completely verified immutable directory.

Required :priv_dir is an existing normalized physical absolute directory. Optional :manifest_limits and :archive_limits pass finite supported limits to those boundaries; :timeout bounds total local work (default 180,000 ms). Returned absolute paths are conveniences; persisted receipt paths are relative.