Auto merge of #63521 - newpavlov:redox_builder, r=pietroalbini

Re-enable Redox builder (take 2)

Closes: #63160
This commit is contained in:
bors 2019-08-23 08:58:24 +00:00
commit f834695781
4 changed files with 24 additions and 28 deletions

View File

@ -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",
]

View File

@ -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 \

View File

@ -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

View File

@ -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,18 +1192,18 @@ fn get_concurrency() -> usize {
}
}
#[cfg(target_os = "redox")]
fn num_cpus() -> usize {
// FIXME: Implement num_cpus on Redox
1
}
#[cfg(target_os = "vxworks")]
fn num_cpus() -> usize {
// FIXME: Implement num_cpus on vxWorks
1
}
#[cfg(target_os = "redox")]
fn num_cpus() -> usize {
// FIXME: Implement num_cpus on Redox
1
}
#[cfg(any(
all(target_arch = "wasm32", not(target_os = "emscripten")),
all(target_vendor = "fortanix", target_env = "sgx")
@ -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 }