resolve_audio_engine_binary

Function resolve_audio_engine_binary 

Source
pub fn resolve_audio_engine_binary() -> Result<PathBuf, String>
Expand description

Resolve path to the audio-engine executable.

Prefer audio-engine-artifacts/debug|release (or legacy target/debug|release) found by walking up from std::env::current_exe. That covers pnpm dev when the app runs inside a macOS bundle (…/target/debug/bundle/…/Contents/MacOS/audio-haxor) where the sibling audio-engine can be stale, while the real AudioEngine from beforeDevCommand lives at the workspace audio-engine-artifacts/<profile>/audio-engine. Also works when CARGO_TARGET_DIR is non-default (compile-time CARGO_MANIFEST_DIR alone is insufficient).

Override for debugging: set AUDIO_HAXOR_AUDIO_ENGINE to an absolute path to the AudioEngine binary. Release installs use the sibling next to the main executable when no workspace target/ is found.

Tauri bundle.externalBin places audio-engine-<host-triple> next to the main executable (see scripts/prepare-audio-engine-audioengine.mjs). We spawn via std::process::Command, not Tauri’s sidecar API, so we must resolve that suffixed name when plain audio-engine is absent (typical in a shipped .app under /Applications).