Skip to main content

locate_runtime_binary

Function locate_runtime_binary 

Source
fn locate_runtime_binary(target: BuildTarget) -> Result<PathBuf>
Expand description

Looks for the khora-runtime binary for target in:

  1. Sibling of the editor binary — the canonical layout once the engine release archive is unpacked, and what cargo build produces in target/<profile>/.
  2. Sibling profile fallback — when the editor runs from target/release/, also check target/debug/ (and vice-versa). Lets a contributor running cargo run -p khora-hub --release find a runtime that was built in debug by cargo build or cargo hub-dev.
  3. Hub engine cache~/.khora/engines/<version>/runtime/ is the layout produced by hub::download::start_download when the matching khora-runtime-<host> artifact is present in the GitHub release.

Non-host targets always fall through today: the hub only fetches its own host architecture from a release, and dev builds only produce the host runtime. Cross-target build-template caching is a future expansion that re-uses this same lookup once the hub fetches all three runtime archives.