diff --git a/Dockerfile.hack b/Dockerfile.hack new file mode 100644 index 000000000..664ab56dd --- /dev/null +++ b/Dockerfile.hack @@ -0,0 +1,2 @@ +ARG CROSS_IMAGE +FROM $CROSS_IMAGE \ No newline at end of file diff --git a/xtask/src/build_docker_image.rs b/xtask/src/build_docker_image.rs index fc00310ba..6feb367b2 100644 --- a/xtask/src/build_docker_image.rs +++ b/xtask/src/build_docker_image.rs @@ -84,7 +84,21 @@ fn locate_dockerfile( } else { eyre::bail!("unable to find dockerfile for target \"{target}\""); }; - let dockerfile = dockerfile_root.join(dockerfile_name).to_utf8()?.to_string(); + let dockerfile = if matches!( + target.triplet.as_str(), + "powerpc64-unknown-linux-gnu" + | "x86_64-sun-solaris" + | "i686-pc-windows-gnu" + | "x86_64-pc-windows-gnu" + | "sparc64-unknown-linux-gnu" + ) { + crate::util::project_dir(&mut <_>::default())? + .join("Dockerfile.hack") + .to_utf8()? + .to_string() + } else { + dockerfile_root.join(dockerfile_name).to_utf8()?.to_string() + }; Ok((target, dockerfile)) } @@ -243,6 +257,11 @@ pub fn build_docker_image( docker_build.args(&["--build-arg", "VERBOSE=1"]); } + docker_build.args(&[ + "--build-arg", + &format!("CROSS_IMAGE={}", target.image_name(&repository, "0.2.4")), + ]); + if target.needs_workspace_root_context() { docker_build.arg(&root); } else {