pub enum ResolveSource {
Path,
EnvVar,
PathLookup,
SiblingDir,
TargetDebug,
TargetRelease,
AutoBuilt,
NotFound,
}Expand description
Provenance of a scheduler binary returned by resolve_scheduler.
Each variant identifies the discovery branch that produced the path, so downstream tooling (sidecar, cache-key construction, log lines) can distinguish “we found a pre-built binary in a target directory whose git hash we don’t control” from “we just built this binary from HEAD in the current workspace and therefore know its source commit is the workspace HEAD.”
Only the AutoBuilt variant carries an honest
source-commit guarantee: every other branch locates an existing
file whose provenance is outside this process’s knowledge.
Callers that need to stamp a sidecar with a scheduler-specific
commit must discard the hash for every non-AutoBuilt resolution
— a stale target/debug/ binary looks identical to a fresh
AutoBuilt one but can be arbitrarily old.
Eevdf / KernelBuiltin / Path resolutions do not go through
the discovery cascade:
Eevdf/KernelBuiltin→NotFound(no user-space binary involved; the tuple’sOption<PathBuf>isNone).Path(p)→Path(the caller named the binary explicitly in the test entry — no env-var or filesystem search runs).
The variant ordering in the enum mirrors the discovery cascade
order in resolve_scheduler so a reviewer can scan both lists
in lockstep.
Variants§
Path
Resolved via the literal path the caller supplied as
SchedulerSpec::Path(p). No env-var or filesystem search
involved — the path arrived in the test entry directly.
Trusted to the extent the caller trusts the argument; git-
hash provenance is UNKNOWN to this process.
EnvVar
Resolved via the KTSTR_SCHEDULER environment variable on the
SchedulerSpec::Discover arm. Trusted to the extent the
caller trusts the variable; git-hash provenance is UNKNOWN
to this process.
PathLookup
Resolved via a $PATH lookup. Only produced when
KTSTR_CARGO_TEST_MODE is active and a binary by the
requested name was found on the user’s $PATH in front of
the sibling-dir / target-dir cascade. Git-hash provenance
UNKNOWN — the binary on PATH may be a system-wide install,
a prior build, or a custom one the user staged for this run.
SiblingDir
Resolved via a sibling of crate::resolve_current_exe
(same directory, or the sibling of a deps/ directory for
integration tests / nextest). Git-hash provenance UNKNOWN
— the binary may be from any previous build.
TargetDebug
Resolved via a fallback search in target/debug/. Git-hash
provenance UNKNOWN — a stale binary from an older tree
passes this check identically to a fresh one.
TargetRelease
Resolved via a fallback search in target/release/. Git-hash
provenance UNKNOWN — same stale-binary hazard as
TargetDebug.
AutoBuilt
Built on demand by crate::build_and_find_binary inside this
process. The build targets the current workspace’s HEAD by
construction — the ONLY variant where the source commit is
known to match the workspace tree the tests run from.
NotFound
No user-space binary path was produced. Returned for
SchedulerSpec::Eevdf and SchedulerSpec::KernelBuiltin (the
kernel supplies the scheduler — no binary to locate). The
tuple’s Option<PathBuf> is always None for this variant.
Implementations§
Source§impl ResolveSource
impl ResolveSource
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Stable snake_case tag for the sidecar resolve_source field and
the stats --resolve-source filter — the string analog of the
variant, mirroring the run_source tag convention so the
persisted JSON shape does not depend on this enum’s Rust
representation. Variant order matches the discovery cascade.
Trait Implementations§
Source§impl Clone for ResolveSource
impl Clone for ResolveSource
Source§fn clone(&self) -> ResolveSource
fn clone(&self) -> ResolveSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolveSource
impl Debug for ResolveSource
Source§impl PartialEq for ResolveSource
impl PartialEq for ResolveSource
impl Copy for ResolveSource
impl Eq for ResolveSource
impl StructuralPartialEq for ResolveSource
Auto Trait Implementations§
impl Freeze for ResolveSource
impl RefUnwindSafe for ResolveSource
impl Send for ResolveSource
impl Sync for ResolveSource
impl Unpin for ResolveSource
impl UnwindSafe for ResolveSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more