Bsdkrun.Binary (bsdkrun_ex v0.1.0)

Copy Markdown View Source

Resolves the bsdkrun binary. First match wins; the result is cached in :persistent_term. Resolution order:

  1. an explicit override set via set_binary_path/1,
  2. the $BSDKRUN_BIN environment variable,
  3. bsdkrun on $PATH,
  4. in-repo dev builds relative to this SDK: <repo>/target/release/bsdkrun then <repo>/target/debug/bsdkrun.

If none exist, resolve!/0 raises a Bsdkrun.Error of kind :binary_not_found listing everything it looked at.

Summary

Functions

Reset cached discovery state and any override (mainly for tests).

Resolve (and cache) the path to the bsdkrun binary, or raise.

Force the SDK to use a specific bsdkrun binary, bypassing discovery. Handy in tests or when running against a locally built debug binary.

Functions

reset_cache()

@spec reset_cache() :: :ok

Reset cached discovery state and any override (mainly for tests).

resolve!()

@spec resolve!() :: String.t()

Resolve (and cache) the path to the bsdkrun binary, or raise.

set_binary_path(path)

@spec set_binary_path(String.t()) :: :ok

Force the SDK to use a specific bsdkrun binary, bypassing discovery. Handy in tests or when running against a locally built debug binary.