Resolves a path to the full source tree of an active Nerves system,
fetching from GitHub when the user has the Hex tarball (which deliberately
omits Config.in and patches/).
Why
Source-build needs the system's full source tree:
Config.in— referenced bynerves_system_br/Config.innerves_defconfig— the system's BR defconfigpatches/buildroot/**— Nerves' BR patches
Hex tarballs of nerves_system_* exclude Config.in and patches/ because
Hex consumers use the prebuilt artefact, not source. NBPR users frequently
only have the Hex dep — we transparently fetch the equivalent source from
GitHub the first time source-build runs for that (system, version) tuple.
Cache
Extracted GitHub source lives at:
<data_dir>/nbpr/system-source/<system_app>-<system_version>/with a .nbpr-ready marker file once extraction completes successfully.
Idempotent across runs.
Summary
Functions
Returns a path to a full source tree for system_app at system_version.
Functions
Returns a path to a full source tree for system_app at system_version.
If the user's deps/<system_app>/ already has Config.in (git/path dep,
or Hex with patches), returns that. Otherwise fetches the GitHub tarball
for the matching tag, caches it under <data_dir>/nbpr/system-source/,
and returns the cache path.
Raises if the GitHub URL can't be discovered from hex_metadata.config
or the tarball can't be downloaded.