From 107dcd5799c40d4eacaed0f05fae03df6572fc4d Mon Sep 17 00:00:00 2001 From: Sean Leather Date: Mon, 20 May 2019 15:02:14 +0200 Subject: [PATCH 1/2] Minor improvements to wording Fix a typo in "QEMU bug sand" --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7db1a1617..db2fb7307 100644 --- a/README.md +++ b/README.md @@ -177,17 +177,18 @@ that only support `xargo`. A target is considered as "supported" if `cross` can cross compile a "non-trivial" (binary) crate, usually Cargo, for that target. -Testing support is more complicated. It relies on QEMU user emulation, so -testing may sometimes fail due to QEMU bug sand not because there's a bug in the -crate. That being said, `cross test` is assumed to "work" (`test` column in the -table below) if it can successfully -run [compiler-builtins](https://github.com/rust-lang-nursery/compiler-builtins) -test suite. - -Also, testing is very slow. `cross` will actually run units tests *sequentially* -because QEMU gets upset when you spawn several threads. This also means that, if -one of your unit tests spawns several threads then it's more likely to fail or, -worst, "hang" (never terminate). +Testing support (`cross test`) is more complicated. It relies on [QEMU] +emulation, so testing may fail due to QEMU bugs rather than bugs in your crate. +That said, a target has a ✓ in `test` column of the table below if it can run +the [`compiler-builtins`] test suite. + +[QEMU]: https://www.qemu.org/ +[`compiler-builtins`]: https://github.com/rust-lang-nursery/compiler-builtins + +Also, testing is very slow. `cross test` runs units tests *sequentially* because +QEMU gets upset when you spawn multiple threads. This means that, if one of your +unit tests spawns threads, then it's more likely to fail or, worst, never +terminate. | Target | libc | GCC | OpenSSL | C++ | QEMU | `test` | |--------------------------------------|--------|---------|---------|:---:|-------|:------:| From 967088484df0a5a805124cf0d2f314fb2802d306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 19 Jan 2019 15:55:24 +0000 Subject: [PATCH 2/2] Support mounting on SELinux This should allow `cross` to work on both non-SELinux enabled systems and SELinux ones. --- src/docker.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/docker.rs b/src/docker.rs index 1525b8734..aadcbd33c 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -153,12 +153,12 @@ pub fn run(target: &Target, docker .args(&["-e", &format!("CROSS_RUNNER={}", runner.unwrap_or_else(|| String::new()))]) - .args(&["-v", &format!("{}:/xargo", xargo_dir.display())]) - .args(&["-v", &format!("{}:/cargo", cargo_dir.display())]) + .args(&["-v", &format!("{}:/xargo:Z", xargo_dir.display())]) + .args(&["-v", &format!("{}:/cargo:Z", cargo_dir.display())]) .args(&["-v", "/cargo/bin"]) // Prevent `bin` from being mounted inside the Docker container. - .args(&["-v", &format!("{}:/project:ro", root.display())]) - .args(&["-v", &format!("{}:/rust:ro", sysroot.display())]) - .args(&["-v", &format!("{}:/target", target_dir.display())]) + .args(&["-v", &format!("{}:/project:Z,ro", root.display())]) + .args(&["-v", &format!("{}:/rust:Z,ro", sysroot.display())]) + .args(&["-v", &format!("{}:/target:Z", target_dir.display())]) .args(&["-w", "/project"]) .args(&["-it", &image(toml, target)?]) .args(&["sh", "-c", &format!("PATH=$PATH:/rust/bin {:?}", cmd)])