Skip to content

Commit

Permalink
Add needs_docker_privileged
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Apr 7, 2022
1 parent a309bf1 commit d88eb5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ pub fn run(
docker.args(&["-e", "PKG_CONFIG_ALLOW_CROSS=1"]);

docker.arg("--rm");
docker.arg("--privileged");

if target.needs_docker_privileged() {
docker.arg("--privileged");
}

// We need to specify the user for Docker, but not for Podman.
if let Ok(ce) = get_container_engine() {
Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ impl Target {

!native && (self.is_linux() || self.is_windows() || self.is_bare_metal())
}

fn needs_docker_privileged(&self) -> bool {
let arch_32bit = self.triple().starts_with("arm")
|| self.triple().starts_with("i586")
|| self.triple().starts_with("i686");

arch_32bit && self.is_android()
}
}

impl std::fmt::Display for Target {
Expand Down

0 comments on commit d88eb5e

Please sign in to comment.