Skip to content

Commit 466ac9c

Browse files
committed
Auto merge of #63521 - newpavlov:redox_builder, r=pietroalbini
Re-enable Redox builder (take 2) Closes: #63160
2 parents 7b0085a + 82cb207 commit 466ac9c

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1580,9 +1580,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
15801580

15811581
[[package]]
15821582
name = "libc"
1583-
version = "0.2.60"
1583+
version = "0.2.61"
15841584
source = "registry+https://github.com/rust-lang/crates.io-index"
1585-
checksum = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb"
1585+
checksum = "c665266eb592905e8503ba3403020f4b8794d26263f412ca33171600eca9a6fa"
15861586
dependencies = [
15871587
"rustc-std-workspace-core",
15881588
]

src/ci/docker/dist-various-1/Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ ENV TARGETS=$TARGETS,armv5te-unknown-linux-musleabi
104104
ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabihf
105105
ENV TARGETS=$TARGETS,aarch64-unknown-linux-musl
106106
ENV TARGETS=$TARGETS,sparc64-unknown-linux-gnu
107-
# FIXME: temporarily disable the redox builder,
108-
# see: https://github.com/rust-lang/rust/issues/63160
109-
# ENV TARGETS=$TARGETS,x86_64-unknown-redox
107+
ENV TARGETS=$TARGETS,x86_64-unknown-redox
110108
ENV TARGETS=$TARGETS,thumbv6m-none-eabi
111109
ENV TARGETS=$TARGETS,thumbv7m-none-eabi
112110
ENV TARGETS=$TARGETS,thumbv7em-none-eabi
@@ -132,7 +130,7 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
132130
CC_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-gcc \
133131
AR_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-ar \
134132
CXX_thumbv7neon_unknown_linux_gnueabihf=arm-linux-gnueabihf-g++
135-
133+
136134
ENV RUST_CONFIGURE_ARGS \
137135
--musl-root-armv5te=/musl-armv5te \
138136
--musl-root-arm=/musl-arm \

src/libstd/sys/unix/process/process_unix.rs

+12-13
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,22 @@ impl Command {
178178
cvt_r(|| libc::dup2(fd, libc::STDERR_FILENO))?;
179179
}
180180

181-
if cfg!(not(any(target_os = "l4re"))) {
181+
#[cfg(not(target_os = "l4re"))]
182+
{
182183
if let Some(u) = self.get_gid() {
183184
cvt(libc::setgid(u as gid_t))?;
184185
}
185186
if let Some(u) = self.get_uid() {
187+
// When dropping privileges from root, the `setgroups` call
188+
// will remove any extraneous groups. If we don't call this,
189+
// then even though our uid has dropped, we may still have
190+
// groups that enable us to do super-user things. This will
191+
// fail if we aren't root, so don't bother checking the
192+
// return value, this is just done as an optimistic
193+
// privilege dropping function.
186194
//FIXME: Redox kernel does not support setgroups yet
187-
if cfg!(not(target_os = "redox")) {
188-
// When dropping privileges from root, the `setgroups` call
189-
// will remove any extraneous groups. If we don't call this,
190-
// then even though our uid has dropped, we may still have
191-
// groups that enable us to do super-user things. This will
192-
// fail if we aren't root, so don't bother checking the
193-
// return value, this is just done as an optimistic
194-
// privilege dropping function.
195-
let _ = libc::setgroups(0, ptr::null());
196-
}
197-
195+
#[cfg(not(target_os = "redox"))]
196+
let _ = libc::setgroups(0, ptr::null());
198197
cvt(libc::setuid(u as uid_t))?;
199198
}
200199
}
@@ -203,7 +202,7 @@ impl Command {
203202
}
204203

205204
// emscripten has no signal support.
206-
#[cfg(not(any(target_os = "emscripten")))]
205+
#[cfg(not(target_os = "emscripten"))]
207206
{
208207
use crate::mem::MaybeUninit;
209208
// Reset signal handling so the child process starts in a

src/libtest/lib.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -965,12 +965,11 @@ fn use_color(opts: &TestOpts) -> bool {
965965

966966
#[cfg(any(
967967
target_os = "cloudabi",
968-
target_os = "redox",
969968
all(target_arch = "wasm32", not(target_os = "emscripten")),
970969
all(target_vendor = "fortanix", target_env = "sgx")
971970
))]
972971
fn stdout_isatty() -> bool {
973-
// FIXME: Implement isatty on Redox and SGX
972+
// FIXME: Implement isatty on SGX
974973
false
975974
}
976975
#[cfg(unix)]
@@ -1193,12 +1192,6 @@ fn get_concurrency() -> usize {
11931192
}
11941193
}
11951194

1196-
#[cfg(target_os = "redox")]
1197-
fn num_cpus() -> usize {
1198-
// FIXME: Implement num_cpus on Redox
1199-
1
1200-
}
1201-
12021195
#[cfg(target_os = "vxworks")]
12031196
fn num_cpus() -> usize {
12041197
// FIXME: Implement num_cpus on vxWorks
@@ -1221,7 +1214,8 @@ fn get_concurrency() -> usize {
12211214
target_os = "ios",
12221215
target_os = "linux",
12231216
target_os = "macos",
1224-
target_os = "solaris"
1217+
target_os = "solaris",
1218+
target_os = "redox",
12251219
))]
12261220
fn num_cpus() -> usize {
12271221
unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize }

0 commit comments

Comments
 (0)