pub enum CrossTool {
CargoNative,
CargoZigbuild,
MuslCross,
}Expand description
A host-native cross-compilation mechanism — the concrete toolchain a
NativeCross verdict runs on.
The program is always cargo; the variants differ in the subcommand and
the env they need. Ordered by preference: a plain native build needs the
least, zigbuild covers the most ground, musl-cross is the narrow fallback.
Variants§
CargoNative
cargo build [--target T] with no foreign sysroot — the target is
host-native, or a same-OS arch-cross the host SDK already covers
(x86_64-apple-darwin from an arm64 mac). Just needs the rustup
target add.
CargoZigbuild
cargo zigbuild --target T — zig provides the linker + sysroot,
cross-compiling musl/glibc Linux and Windows-gnu from any host. The
W222 default for the overwhelming majority of foreign-arch targets.
MuslCross
cargo build --target T with CARGO_TARGET_<T>_LINKER / CC_<t>
pointed at a <arch>-linux-musl-gcc cross toolchain. Fallback for a
musl target on a host that has the cross-gcc but not zig.
Implementations§
Source§impl CrossTool
impl CrossTool
Sourcepub fn cargo_subcommand(&self) -> &'static str
pub fn cargo_subcommand(&self) -> &'static str
The cargo subcommand this tool drives (build or zigbuild). The
program itself is always cargo.
Sourcepub fn env_for(&self, target: &str) -> Vec<(String, String)>
pub fn env_for(&self, target: &str) -> Vec<(String, String)>
Env vars this tool needs for target, as (key, value) pairs.
Only MuslCross needs any — it points cargo’s
per-target linker and the cc crate’s compiler at the
<arch>-linux-musl-gcc cross toolchain. Zigbuild self-contains its
sysroot, and a native build inherits the host toolchain, so both
return empty.
Sourcepub fn probe_argv(&self) -> Vec<String>
pub fn probe_argv(&self) -> Vec<String>
The argv that probes whether this tool is installed (its --version).
ToolAvailability::probe runs these; the exit status is the signal.
Sourcepub fn install_hint(&self) -> &'static str
pub fn install_hint(&self) -> &'static str
Actionable one-line install hint, surfaced when the tool is selected
but unavailable. Mirrors the
preflight discipline of routing the operator to
the fix rather than dying with a raw toolchain error.
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
Short label with the mechanism parenthetical, matching the style of
Resolution::label for the T4
preflight / detail pane.
Trait Implementations§
impl Eq for CrossTool
impl StructuralPartialEq for CrossTool
Auto Trait Implementations§
impl Freeze for CrossTool
impl RefUnwindSafe for CrossTool
impl Send for CrossTool
impl Sync for CrossTool
impl Unpin for CrossTool
impl UnsafeUnpin for CrossTool
impl UnwindSafe for CrossTool
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> Fruit for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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