From c4b43d11da5fcae77d339fd316f74a46d37cd5d1 Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Mon, 16 Dec 2024 12:49:06 -0500 Subject: [PATCH] make it actually detect whether xwin and zigbuild are needed --- cargo-dist/src/lib.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/cargo-dist/src/lib.rs b/cargo-dist/src/lib.rs index 5481b9ac4..6a83acc48 100644 --- a/cargo-dist/src/lib.rs +++ b/cargo-dist/src/lib.rs @@ -59,7 +59,7 @@ mod tests; /// dist env test -- make sure we have everything we need for a build. pub fn do_env_test(cfg: &Config) -> DistResult<()> { - let (dist, mut manifest) = tasks::gather_work(cfg)?; + let (dist, _manifest) = tasks::gather_work(cfg)?; let builds = dist.config.builds; @@ -71,6 +71,9 @@ pub fn do_env_test(cfg: &Config) -> DistResult<()> { let tools = dist.tools; + let cargo = tools.cargo()?; + let host = cargo.host_target.parse()?; + for step in dist .local_build_steps .iter() @@ -78,19 +81,18 @@ pub fn do_env_test(cfg: &Config) -> DistResult<()> { { match step { BuildStep::Cargo(step) => { - println!("step = {:#?}", step); - /* - let host = step.host; - let target = step.target_triple; - // TODO: Figure out where to get host, target from? - let wrapper = tasks::build_wrapper_for_cross(host, target)?; + let target = step.target_triple.parse()?; + let wrapper = tasks::build_wrapper_for_cross(&host, &target)?; match wrapper { - Some(CargoBuildWrapper::Xwin) => { need_xwin = true; } - Some(CargoBuildWrapper::ZigBuild) => { need_zigbuild = true; } + Some(CargoBuildWrapper::Xwin) => { + need_xwin = true; + } + Some(CargoBuildWrapper::ZigBuild) => { + need_zigbuild = true; + } None => {} } - */ } _ => {} }