Source-builds an NBPR package artefact tarball end-to-end.
Driven from both Mix.Tasks.Nbpr.Build (CLI) and Mix.Tasks.Nbpr.Fetch's
fallback path (when no prebuilt artefact is published for the active
(system, system_version, build_opts) tuple).
Pipeline:
- Discover
deps/nerves_system_br/and read the pinned BR version. - Ensure the patched BR source tree at
$NERVES_DATA_DIR/nbpr/buildroot/<version>/. - Render a defconfig that layers the package + its
build_optson top of the active system'snerves_defconfig. - Run BR (
<pkg>-dirclean && <pkg>) against a stable per-(system, BR-version) output dir, in Docker on non-Linux hosts. - Filter per-package output via BR's files-list (runtime-only).
- Pack into the canonical artefact tarball at
output_dir/.
Returns the absolute path to the produced tarball.
Summary
Functions
Builds the artefact for pkg against inputs.system_app/system_version,
with inputs.build_opts applied. Writes the tarball into output_dir and
returns its absolute path.
Returns the stable per-(system, BR-version) BR output dir. Reusing across
builds keeps the toolchain extraction, host-skeleton, and unchanged packages
cached; make olddefconfig reconciles defconfig drift.
Functions
@spec build!(NBPR.Package.t(), NBPR.Artifact.build_inputs(), Path.t()) :: Path.t()
Builds the artefact for pkg against inputs.system_app/system_version,
with inputs.build_opts applied. Writes the tarball into output_dir and
returns its absolute path.
inputs is the standard NBPR.Artifact.build_inputs/0 map (the same one
used for cache-key/manifest computation in the fetch path).
Returns the stable per-(system, BR-version) BR output dir. Reusing across
builds keeps the toolchain extraction, host-skeleton, and unchanged packages
cached; make olddefconfig reconciles defconfig drift.