Skip to content

Commit 9d028c7

Browse files
authored
Disable -D warnings in CI for now. (#1028)
* Disable `-D warnings` in CI for now. Rust nightly doesn't want us to import `Vec` ourselves, but Rust stable still needs us to. So for now, leave the imports in place and don't fail on warnings. * Disable use of `OFlags::TMPFILE` on armv7-unknown-freebsd. * Fix more import errors on armv7-unknown-freebsd. * Temporarily disable armv7-unknown-freebsd in CI.
1 parent 394dd7d commit 9d028c7

File tree

3 files changed

+41
-14
lines changed

3 files changed

+41
-14
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ jobs:
3737
os: ubuntu-latest
3838
rust: 1.63
3939

40-
env:
41-
# -D warnings is commented out in our install-rust action; re-add it here.
42-
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths --cfg criterion
40+
# TODO: Reenable this once we can remove the redundant `Vec` imports.
41+
#env:
42+
# # -D warnings is commented out in our install-rust action; re-add it here.
43+
# RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths --cfg criterion
4344
steps:
4445
- uses: actions/checkout@v4
4546
with:
@@ -134,9 +135,10 @@ jobs:
134135
os: ubuntu-latest
135136
rust: nightly
136137

137-
env:
138-
# -D warnings is commented out in our install-rust action; re-add it here.
139-
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
138+
# TODO: Reenable this once we can remove the redundant `Vec` imports.
139+
#env:
140+
# # -D warnings is commented out in our install-rust action; re-add it here.
141+
# RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
140142
steps:
141143
- uses: actions/checkout@v4
142144
with:
@@ -208,7 +210,9 @@ jobs:
208210
- run: cargo check -Z build-std --target mips64-openwrt-linux-musl --all-targets --features=all-apis
209211
- run: cargo check -Z build-std --target x86_64-unknown-dragonfly --all-targets --features=all-apis
210212
- run: cargo check -Z build-std --target sparc-unknown-linux-gnu --all-targets --features=all-apis
211-
- run: cargo check -Z build-std --target armv7-unknown-freebsd --all-targets --features=all-apis
213+
# Temporarily disable this because the target appears to have changed and needs
214+
# fixes and we transitively dev-depend on what can be an older version of rustix.
215+
#- run: cargo check -Z build-std --target armv7-unknown-freebsd --all-targets --features=all-apis
212216
# Omit --all-targets on gnu_ilp32 because dev-dependency tempfile depends on an older rustix
213217
- run: cargo check -Z build-std --target aarch64-unknown-linux-gnu_ilp32 --features=all-apis
214218
# Omit --all-targets on haiku because not all the tests build yet.
@@ -557,7 +561,8 @@ jobs:
557561
qemu_target: arm-linux-user
558562
env:
559563
# -D warnings is commented out in our install-rust action; re-add it here.
560-
RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
564+
# TODO: Reenable this once we can remove the redundant `Vec` imports.
565+
#RUSTFLAGS: -D warnings -D elided-lifetimes-in-paths
561566
QEMU_BUILD_VERSION: 8.1.2
562567
steps:
563568
- uses: actions/checkout@v4
@@ -647,7 +652,9 @@ jobs:
647652
qemu_target: ppc64le-linux-user
648653
env:
649654
# -D warnings is commented out in our install-rust action; re-add it here.
650-
RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings -D elided-lifetimes-in-paths
655+
# TODO: Reenable this once we can remove the redundant `Vec` imports.
656+
#RUSTFLAGS: --cfg rustix_use_experimental_asm -D warnings -D elided-lifetimes-in-paths
657+
RUSTFLAGS: --cfg rustix_use_experimental_asm
651658
RUSTDOCFLAGS: --cfg rustix_use_experimental_asm
652659
CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUSTFLAGS: --cfg rustix_use_experimental_asm
653660
QEMU_BUILD_VERSION: 8.1.2

src/backend/libc/fs/syscalls.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ fn open_via_syscall(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<Owned
140140
pub(crate) fn open(path: &CStr, oflags: OFlags, mode: Mode) -> io::Result<OwnedFd> {
141141
// Work around <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>.
142142
// glibc versions before 2.25 don't handle `O_TMPFILE` correctly.
143-
#[cfg(all(unix, target_env = "gnu", not(target_os = "hurd")))]
143+
#[cfg(all(
144+
unix,
145+
target_env = "gnu",
146+
not(target_os = "hurd"),
147+
not(target_os = "freebsd")
148+
))]
144149
if oflags.contains(OFlags::TMPFILE) && crate::backend::if_glibc_is_less_than_2_25() {
145150
return open_via_syscall(path, oflags, mode);
146151
}
@@ -203,7 +208,12 @@ pub(crate) fn openat(
203208
) -> io::Result<OwnedFd> {
204209
// Work around <https://sourceware.org/bugzilla/show_bug.cgi?id=17523>.
205210
// glibc versions before 2.25 don't handle `O_TMPFILE` correctly.
206-
#[cfg(all(unix, target_env = "gnu", not(target_os = "hurd")))]
211+
#[cfg(all(
212+
unix,
213+
target_env = "gnu",
214+
not(target_os = "hurd"),
215+
not(target_os = "freebsd")
216+
))]
207217
if oflags.contains(OFlags::TMPFILE) && crate::backend::if_glibc_is_less_than_2_25() {
208218
return openat_via_syscall(dirfd, path, oflags, mode);
209219
}

src/backend/libc/thread/syscalls.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ pub(crate) fn clock_nanosleep_relative(id: ClockId, request: &Timespec) -> Nanos
101101
target_os = "vita"
102102
))
103103
))]
104-
fn clock_nanosleep_relative_old(id: ClockId, request: &Timespec) -> NanosleepRelativeResult {
104+
fn clock_nanosleep_relative_old(
105+
id: crate::clockid::ClockId,
106+
request: &Timespec,
107+
) -> NanosleepRelativeResult {
105108
let tv_sec = match request.tv_sec.try_into() {
106109
Ok(tv_sec) => tv_sec,
107110
Err(_) => return NanosleepRelativeResult::Err(io::Errno::OVERFLOW),
@@ -195,14 +198,21 @@ pub(crate) fn clock_nanosleep_absolute(id: ClockId, request: &Timespec) -> io::R
195198
target_os = "vita"
196199
))
197200
))]
198-
fn clock_nanosleep_absolute_old(id: ClockId, request: &Timespec) -> io::Result<()> {
201+
fn clock_nanosleep_absolute_old(id: crate::clockid::ClockId, request: &Timespec) -> io::Result<()> {
199202
let flags = c::TIMER_ABSTIME;
200203

201204
let old_request = c::timespec {
202205
tv_sec: request.tv_sec.try_into().map_err(|_| io::Errno::OVERFLOW)?,
203206
tv_nsec: request.tv_nsec.try_into().map_err(|_| io::Errno::INVAL)?,
204207
};
205-
match unsafe { c::clock_nanosleep(id as c::clockid_t, flags, &old_request, null_mut()) } {
208+
match unsafe {
209+
c::clock_nanosleep(
210+
id as c::clockid_t,
211+
flags,
212+
&old_request,
213+
core::ptr::null_mut(),
214+
)
215+
} {
206216
0 => Ok(()),
207217
err => Err(io::Errno(err)),
208218
}

0 commit comments

Comments
 (0)