Expand description
Resolve the on-disk paths of whisker-rustc-shim and
whisker-linker-shim for the dev session.
Both shims are [[bin]] targets of the whisker-cli package,
shipped alongside the main whisker binary. The dev-server needs
absolute paths to set them as RUSTC_WORKSPACE_WRAPPER and
-C linker=….
Resolution order:
- Beside the running
whiskerbinary (current_exe()’s dir).cargo install whisker-cliinstalls all three bins into~/.cargo/bintogether, so external (crates.io) users resolve here and never need an in-workspace build. In-workspace dev also matches once the shims are built (they sit next totarget/debug/whisker). <target>/debug/—CARGO_TARGET_DIRenv wins, else<workspace>/target. Covers an in-workspace run whosecurrent_exelives elsewhere (e.g. invoked via a wrapper).- Build them with
cargo build -p whisker-cli --bin …from the workspace, then re-check. Only meaningful in-workspace (wherewhisker-cliis a member); for external users step 1 already succeeded. A build failure surfaces asErr(_)and the caller falls back to Tier 2.
Structs§
- Shim
Paths - Absolute paths to both shim binaries.
Functions§
- exe_
name - Pure helper: append
.exeon Windows. Pulled out so tests don’t have to fork on cfg. - expected_
shim_ paths - Compute the expected shim paths without touching the filesystem.
Pure function — used both in tests and as the first half of
resolve_shim_paths. - resolve_
shim_ paths - Resolve both shim paths. Build them with
cargo buildif the binaries aren’t on disk yet. Returns absolute paths suitable for passing toRUSTC_WORKSPACE_WRAPPERand-C linker=…. - shim_
paths_ in_ dir - The two shim paths as they’d sit inside
dir. Pure — used both for thecurrent_exe()neighbor lookup and in tests.