From 5ef242604abd6992e5ec4b4b07ba1cda01998b43 Mon Sep 17 00:00:00 2001 From: Rust Maintainers Date: Sun, 15 Oct 2017 20:31:03 +0100 Subject: [PATCH] d-cross-compile-install Gbp-Pq: Name d-cross-compile-install.patch --- src/bootstrap/step.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs index b9ebdd03d6..49201ebfbb 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -1032,11 +1032,18 @@ pub struct Rules<'a> { impl<'a> Rules<'a> { fn new(build: &'a Build) -> Rules<'a> { + let target_env = ::std::env::var("DEB_HOST_RUST_TYPE").unwrap(); + // rust forces us to do this dance because of lifetimes :/ + let hosts = &build.config.host; + let target = match hosts.iter().position(|x| x == target_env.as_str()) { + None => &build.config.build, + Some(tidx) => hosts[tidx].as_str() + }; Rules { build: build, sbuild: Step { stage: build.flags.stage.unwrap_or(2), - target: &build.config.build, + target: target, host: &build.config.build, name: "", }, -- 2.30.2