Skip to content

Commit

Permalink
Fix MacOS CI, pt. 2: The Sequel
Browse files Browse the repository at this point in the history
  • Loading branch information
evanrittenhouse committed Apr 25, 2024
1 parent 60df557 commit d39138b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
2 changes: 2 additions & 0 deletions dgram/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct GsoSettings {
mod linux_imports {
pub(super) use crate::syscalls::recv_msg;
pub(super) use crate::syscalls::send_msg;
pub(super) use crate::GsoSettings;
pub(super) use nix::errno::Errno;
pub(super) use nix::sys::socket::getsockopt;
pub(super) use nix::sys::socket::recvmsg;
Expand All @@ -25,6 +26,7 @@ mod linux_imports {
pub(super) use nix::sys::socket::sockopt::UdpGsoSegment;
pub(super) use nix::sys::socket::AddressFamily;
pub(super) use nix::sys::socket::ControlMessage;
pub(super) use nix::sys::socket::ControlMessageOwned;
pub(super) use nix::sys::socket::MsgFlags;
pub(super) use nix::sys::socket::SetSockOpt;
pub(super) use nix::sys::socket::SockaddrLike;
Expand Down
12 changes: 6 additions & 6 deletions dgram/src/socket_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub fn set_gso_segment(sock: &impl AsFd, segment: usize) -> io::Result<()> {

#[cfg(not(target_os = "linux"))]
pub fn set_gso_segment(_: &impl AsFd, _: usize) -> io::Result<()> {
Err("unsupported").into_io()
Err("unsupported")

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

mismatched types

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

mismatched types

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

mismatched types

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

mismatched types

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

mismatched types

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

mismatched types

Check failure on line 57 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

mismatched types
}

#[cfg(target_os = "linux")]
Expand All @@ -66,7 +66,7 @@ pub fn set_gro(sock: &impl AsFd) -> io::Result<()> {

#[cfg(not(target_os = "linux"))]
pub fn set_gro(_: &impl AsFd) -> io::Result<()> {
Err("unsupported").into_io()
Err("unsupported")

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

mismatched types

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

mismatched types

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

mismatched types

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

mismatched types

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

mismatched types

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

mismatched types

Check failure on line 69 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

mismatched types
}

#[cfg(target_os = "linux")]
Expand All @@ -77,8 +77,8 @@ fn set_udp_rxq_ovfl(sock: &impl AsFd) -> io::Result<()> {
}

#[cfg(not(target_os = "linux"))]
fn set_udp_rxq_ovfl<S>(_: &impl AsFd) -> io::Result<()> {
Err("unsupported").into_io()
fn set_udp_rxq_ovfl(_: &impl AsFd) -> io::Result<()> {
Err("unsupported")

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

mismatched types

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

mismatched types

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

mismatched types

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

mismatched types

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

mismatched types

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

mismatched types

Check failure on line 81 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

mismatched types
}

#[cfg(target_os = "linux")]
Expand All @@ -95,7 +95,7 @@ pub fn set_tx_time(sock: &impl AsFd) -> io::Result<()> {

#[cfg(not(target_os = "linux"))]
pub fn set_tx_time(_: &impl AsFd) -> io::Result<()> {
Err("unsupported").into_io()
Err("unsupported")

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

mismatched types

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

mismatched types

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

mismatched types

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

mismatched types

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

mismatched types

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

mismatched types

Check failure on line 98 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

mismatched types
}

#[cfg(target_os = "linux")]
Expand All @@ -107,5 +107,5 @@ pub fn set_rx_time(sock: &impl AsFd) -> io::Result<()> {

#[cfg(not(target_os = "linux"))]
pub fn set_rx_time(_: &impl AsFd) -> io::Result<()> {
Err("unsupported").into_io()
Err("unsupported")

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

mismatched types

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

mismatched types

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

mismatched types

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

mismatched types

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

mismatched types

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

mismatched types

Check failure on line 110 in dgram/src/socket_setup.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

mismatched types
}
5 changes: 2 additions & 3 deletions dgram/src/sync.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::syscalls::RecvData;
use crate::GsoSettings;
use mio::net::UdpSocket;
use std::io::Result;
use std::net::SocketAddr;
Expand Down Expand Up @@ -80,15 +79,15 @@ pub async fn send_to(
socket: &UdpSocket, client_addr: SocketAddr, send_buf: &[u8],
_segment_size: usize, _num_pkts: usize, _tx_time: Option<Instant>,
) -> Result<usize> {
socket.send_to(send_buf, client_addr).await
socket.send_to(send_buf, client_addr)
}

// Signature changes because we can't use MessageFlags outside of a *NIX context
#[cfg(not(target_os = "linux"))]
pub async fn recv_from(
socket: &UdpSocket, read_buf: &mut [u8], _cmsg_space: &mut Vec<u8>,
) -> Result<RecvData> {
let recv = socket.recv(read_buf).await?;
let recv = socket.recv(read_buf)?;

Ok(RecvData {
bytes: recv,
Expand Down
14 changes: 8 additions & 6 deletions dgram/src/syscalls.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
use crate::GsoSettings;
use nix::sys::socket::ControlMessageOwned;
use std::net::SocketAddr;
use std::os::fd::AsFd;
use std::time::Instant;
use std::time::SystemTime;

mod linux {
pub(super) use super::super::linux_imports::*;

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_windows (i686-pc-windows-msvc)

unresolved import `super::super::linux_imports`

Check failure on line 5 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_windows (i686-pc-windows-gnu)

unresolved import `super::super::linux_imports`
pub(super) use std::os::fd::AsFd;

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

unused import: `std::os::fd::AsFd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_windows (i686-pc-windows-msvc)

unresolved import `std::os::fd`

Check failure on line 6 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_windows (i686-pc-windows-gnu)

unresolved import `std::os::fd`
pub(super) use std::time::Instant;

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (x86_64-apple-ios)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_ios (aarch64-apple-ios)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-14)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_macos (macos-latest)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (i686-linux-android)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (armv7-linux-androideabi)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / android_ndk_lts (aarch64-linux-android)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_windows (i686-pc-windows-msvc)

unused import: `std::time::Instant`

Check failure on line 7 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_windows (i686-pc-windows-gnu)

unused import: `std::time::Instant`
}

#[cfg(target_os = "linux")]
use super::linux_imports::*;
use linux::*;

// An instant with the value of zero, since [`Instant`] is backed by a version
// of timespec this allows to extract raw values from an [`Instant`]
#[cfg(target_os = "linux")]
const INSTANT_ZERO: Instant = unsafe { std::mem::transmute(0u128) };

Check failure on line 16 in dgram/src/syscalls.rs

View workflow job for this annotation

GitHub Actions / quiche_multiarch (i686-unknown-linux-gnu)

cannot transmute between types of different sizes, or dependently-sized types

#[cfg(target_os = "linux")]
pub(crate) type SyscallResult<T> = std::result::Result<T, Errno>;

#[cfg(target_os = "linux")]
Expand Down
2 changes: 0 additions & 2 deletions dgram/src/tokio.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::syscalls::RecvData;
use crate::GsoSettings;
use std::io::Result;
use std::net::SocketAddr;
use std::os::fd::AsFd;
use std::time::Instant;

#[cfg(target_os = "linux")]
Expand Down

0 comments on commit d39138b

Please sign in to comment.