Skip to content

Commit

Permalink
Enabled Vita without cfg in RUSTFLAGS and added CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
nikarh committed Oct 18, 2023
1 parent 099c9c8 commit c1705f9
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 26 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -133,6 +133,22 @@ jobs:
run: cargo install --debug cargo-hack
- name: Check all targets
run: make check_all_targets
CheckTier3Targets:
name: Check
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
target: ["armv7-sony-vita-newlibeabihf"]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- uses: taiki-e/install-action@cargo-hack
- name: Run check
run: cargo hack check -Z build-std=std,panic_abort --feature-powerset --target ${{ matrix.target }}
Sanitizer:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down Expand Up @@ -160,5 +176,6 @@ jobs:
- Docs
- Rustfmt
- CheckTargets
- CheckTier3Targets
steps:
- run: exit 0
9 changes: 5 additions & 4 deletions src/poll.rs
@@ -1,4 +1,4 @@
#[cfg(all(unix, not(mio_unsupported_force_poll_poll)))]
#[cfg(all(unix, not(mio_unsupported_force_poll_poll), not(target_os = "vita")))]
use std::os::unix::io::{AsRawFd, RawFd};
#[cfg(all(debug_assertions, not(target_os = "wasi")))]
use std::sync::atomic::{AtomicBool, Ordering};
Expand Down Expand Up @@ -423,7 +423,7 @@ impl Poll {
}
}

#[cfg(all(unix, not(mio_unsupported_force_poll_poll)))]
#[cfg(all(unix, not(mio_unsupported_force_poll_poll), not(target_os = "vita")))]
impl AsRawFd for Poll {
fn as_raw_fd(&self) -> RawFd {
self.registry.as_raw_fd()
Expand Down Expand Up @@ -710,7 +710,7 @@ impl fmt::Debug for Registry {
}
}

#[cfg(all(unix, not(mio_unsupported_force_poll_poll)))]
#[cfg(all(unix, not(mio_unsupported_force_poll_poll), not(target_os = "vita")))]
impl AsRawFd for Registry {
fn as_raw_fd(&self) -> RawFd {
self.selector.as_raw_fd()
Expand All @@ -720,7 +720,8 @@ impl AsRawFd for Registry {
cfg_os_poll! {
#[cfg(all(
unix,
not(mio_unsupported_force_poll_poll)
not(mio_unsupported_force_poll_poll),
not(target_os = "vita"),
))]
#[test]
pub fn as_raw_fd() {
Expand Down
6 changes: 3 additions & 3 deletions src/sys/unix/mod.rs
Expand Up @@ -34,7 +34,7 @@ cfg_os_poll! {

cfg_io_source! {
// Both `kqueue` and `epoll` don't need to hold any user space state.
#[cfg(not(mio_unsupported_force_poll_poll))]
#[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "vita")))]
mod stateless_io_source {
use std::io;
use std::os::unix::io::RawFd;
Expand Down Expand Up @@ -87,10 +87,10 @@ cfg_os_poll! {
}
}

#[cfg(not(mio_unsupported_force_poll_poll))]
#[cfg(not(any(mio_unsupported_force_poll_poll, target_os = "vita")))]
pub(crate) use self::stateless_io_source::IoSourceState;

#[cfg(mio_unsupported_force_poll_poll)]
#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))]
pub(crate) use self::selector::IoSourceState;
}

Expand Down
4 changes: 2 additions & 2 deletions src/sys/unix/selector/mod.rs
Expand Up @@ -20,10 +20,10 @@ mod epoll;
))]
pub(crate) use self::epoll::{event, Event, Events, Selector};

#[cfg(mio_unsupported_force_poll_poll)]
#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))]
mod poll;

#[cfg(mio_unsupported_force_poll_poll)]
#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))]
pub(crate) use self::poll::{event, Event, Events, IoSourceState, Selector};

#[cfg(all(
Expand Down
39 changes: 22 additions & 17 deletions src/sys/unix/waker.rs
Expand Up @@ -9,7 +9,8 @@
target_os = "tvos",
target_os = "watchos",
)
))
)),
not(target_os = "vita"),
))]
mod fdbased {
#[cfg(all(
Expand Down Expand Up @@ -61,7 +62,8 @@ mod fdbased {
target_os = "tvos",
target_os = "watchos",
)
))
)),
not(target_os = "vita"),
))]
pub use self::fdbased::Waker;

Expand Down Expand Up @@ -205,6 +207,7 @@ pub use self::kqueue::Waker;
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
target_os = "vita",
))]
mod pipe {
use crate::sys::unix::pipe;
Expand Down Expand Up @@ -250,7 +253,7 @@ mod pipe {
}
}

#[cfg(mio_unsupported_force_poll_poll)]
#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))]
pub fn ack_and_reset(&self) {
self.empty();
}
Expand All @@ -275,22 +278,24 @@ mod pipe {
}
}

#[cfg(all(
mio_unsupported_force_poll_poll,
any(
mio_unsupported_force_waker_pipe,
target_os = "aix",
target_os = "dragonfly",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
target_os = "vita",
)
#[cfg(any(
all(
mio_unsupported_force_poll_poll,
any(
mio_unsupported_force_waker_pipe,
target_os = "aix",
target_os = "dragonfly",
target_os = "illumos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox",
)
),
target_os = "vita",
))]
pub(crate) use self::pipe::WakerInternal;

#[cfg(mio_unsupported_force_poll_poll)]
#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))]
mod poll {
use crate::sys::Selector;
use crate::Token;
Expand All @@ -316,5 +321,5 @@ mod poll {
}
}

#[cfg(mio_unsupported_force_poll_poll)]
#[cfg(any(mio_unsupported_force_poll_poll, target_os = "vita"))]
pub use self::poll::Waker;

0 comments on commit c1705f9

Please sign in to comment.