Skip to content

Re-enable Redox builder (take 2) #63521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1569,9 +1569,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",
]
Expand Down
6 changes: 2 additions & 4 deletions src/ci/docker/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand Down
25 changes: 12 additions & 13 deletions src/libstd/sys/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;
}
}
Expand All @@ -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
Expand Down
13 changes: 6 additions & 7 deletions src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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
}

Expand All @@ -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 }
Expand Down