about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-23 08:58:24 +0000
committerbors <bors@rust-lang.org>2019-08-23 08:58:24 +0000
commitf834695781d00daa61d04e11720403ff32cb0e78 (patch)
tree218129b5d456e040429c2c71d923909805e9c8a0
parent0507d49755b9f506da8770af757704eb5c2b54d7 (diff)
parent2ff1f45ead012271823aa8c9693717b493b72fa6 (diff)
downloadrust-f834695781d00daa61d04e11720403ff32cb0e78.tar.gz
rust-f834695781d00daa61d04e11720403ff32cb0e78.zip
Auto merge of #63521 - newpavlov:redox_builder, r=pietroalbini
Re-enable Redox builder (take 2)

Closes: #63160
-rw-r--r--Cargo.lock4
-rw-r--r--src/ci/docker/dist-various-1/Dockerfile6
-rw-r--r--src/libstd/sys/unix/process/process_unix.rs25
-rw-r--r--src/libtest/lib.rs13
4 files changed, 22 insertions, 26 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 153c3d3599a..d96f92505ad 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1580,9 +1580,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
 
 [[package]]
 name = "libc"
-version = "0.2.60"
+version = "0.2.61"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb"
+checksum = "c665266eb592905e8503ba3403020f4b8794d26263f412ca33171600eca9a6fa"
 dependencies = [
  "rustc-std-workspace-core",
 ]
diff --git a/src/ci/docker/dist-various-1/Dockerfile b/src/ci/docker/dist-various-1/Dockerfile
index ae2ea8ef95a..10579119462 100644
--- a/src/ci/docker/dist-various-1/Dockerfile
+++ b/src/ci/docker/dist-various-1/Dockerfile
@@ -104,9 +104,7 @@ ENV TARGETS=$TARGETS,armv5te-unknown-linux-musleabi
 ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf
 ENV TARGETS=$TARGETS,aarch64-unknown-linux-musl
 ENV TARGETS=$TARGETS,sparc64-unknown-linux-gnu
-# FIXME: temporarily disable the redox builder,
-# see: https://github.com/rust-lang/rust/issues/63160
-# ENV TARGETS=$TARGETS,x86_64-unknown-redox
+ENV TARGETS=$TARGETS,x86_64-unknown-redox
 ENV TARGETS=$TARGETS,thumbv6m-none-eabi
 ENV TARGETS=$TARGETS,thumbv7m-none-eabi
 ENV TARGETS=$TARGETS,thumbv7em-none-eabi
@@ -132,7 +130,7 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
     CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
     AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \
     CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
-    
+
 ENV RUST_CONFIGURE_ARGS \
       --musl-root-armv5te=/musl-armv5te \
       --musl-root-arm=/musl-arm \
diff --git a/src/libstd/sys/unix/process/process_unix.rs b/src/libstd/sys/unix/process/process_unix.rs
index a9711c71b7a..e6a742bd45d 100644
--- a/src/libstd/sys/unix/process/process_unix.rs
+++ b/src/libstd/sys/unix/process/process_unix.rs
@@ -178,23 +178,22 @@ impl Command {
             cvt_r(|| libc::dup2(fd, libc::STDERR_FILENO))?;
         }
 
-        if cfg!(not(any(target_os = "l4re"))) {
+        #[cfg(not(target_os = "l4re"))]
+        {
             if let Some(u) = self.get_gid() {
                 cvt(libc::setgid(u as gid_t))?;
             }
             if let Some(u) = self.get_uid() {
+                // When dropping privileges from root, the `setgroups` call
+                // will remove any extraneous groups. If we don't call this,
+                // then even though our uid has dropped, we may still have
+                // groups that enable us to do super-user things. This will
+                // fail if we aren't root, so don't bother checking the
+                // return value, this is just done as an optimistic
+                // privilege dropping function.
                 //FIXME: Redox kernel does not support setgroups yet
-                if cfg!(not(target_os = "redox")) {
-                    // When dropping privileges from root, the `setgroups` call
-                    // will remove any extraneous groups. If we don't call this,
-                    // then even though our uid has dropped, we may still have
-                    // groups that enable us to do super-user things. This will
-                    // fail if we aren't root, so don't bother checking the
-                    // return value, this is just done as an optimistic
-                    // privilege dropping function.
-                    let _ = libc::setgroups(0, ptr::null());
-                }
-
+                #[cfg(not(target_os = "redox"))]
+                let _ = libc::setgroups(0, ptr::null());
                 cvt(libc::setuid(u as uid_t))?;
             }
         }
@@ -203,7 +202,7 @@ impl Command {
         }
 
         // emscripten has no signal support.
-        #[cfg(not(any(target_os = "emscripten")))]
+        #[cfg(not(target_os = "emscripten"))]
         {
             use crate::mem::MaybeUninit;
             // Reset signal handling so the child process starts in a
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs
index ef66c4df99d..5e0f19fe553 100644
--- a/src/libtest/lib.rs
+++ b/src/libtest/lib.rs
@@ -965,12 +965,11 @@ fn use_color(opts: &TestOpts) -> bool {
 
 #[cfg(any(
     target_os = "cloudabi",
-    target_os = "redox",
     all(target_arch = "wasm32", not(target_os = "emscripten")),
     all(target_vendor = "fortanix", target_env = "sgx")
 ))]
 fn stdout_isatty() -> bool {
-    // FIXME: Implement isatty on Redox and SGX
+    // FIXME: Implement isatty on SGX
     false
 }
 #[cfg(unix)]
@@ -1193,15 +1192,15 @@ fn get_concurrency() -> usize {
         }
     }
 
-    #[cfg(target_os = "redox")]
+    #[cfg(target_os = "vxworks")]
     fn num_cpus() -> usize {
-        // FIXME: Implement num_cpus on Redox
+        // FIXME: Implement num_cpus on vxWorks
         1
     }
 
-    #[cfg(target_os = "vxworks")]
+    #[cfg(target_os = "redox")]
     fn num_cpus() -> usize {
-        // FIXME: Implement num_cpus on vxWorks
+        // FIXME: Implement num_cpus on Redox
         1
     }
 
@@ -1221,7 +1220,7 @@ fn get_concurrency() -> usize {
         target_os = "ios",
         target_os = "linux",
         target_os = "macos",
-        target_os = "solaris"
+        target_os = "solaris",
     ))]
     fn num_cpus() -> usize {
         unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize }