Skip to content

Commit

Permalink
hack powerpc64, solaris and pc-windows-gnu and sparc64
Browse files Browse the repository at this point in the history
  • Loading branch information
Emilgardis committed Feb 4, 2023
1 parent 8f22bbf commit 98532cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile.hack
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARG CROSS_IMAGE
FROM $CROSS_IMAGE
21 changes: 20 additions & 1 deletion xtask/src/build_docker_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 98532cd

Please sign in to comment.