From 0a976d3cfb543d4032af65fdf4bd47a69ee73896 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 16 Nov 2024 00:40:23 -0600 Subject: [PATCH 1/4] ci: trim trailing whitespace (backport ) (cherry picked from commit 4b21887cddd082f99d17def3cfb541abf5198676) --- .github/workflows/full_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index 74386c64948a3..9fb88067d183e 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -220,7 +220,7 @@ jobs: run: | export PATH=$HOME/.rust_solaris/bin:$PATH bash ./ci/run.sh ${{ matrix.target }} - + check_cfg: name: "Check #[cfg]s" runs-on: ubuntu-22.04 From d7b6bf0ee8a09b62cbaa6f1508277f8ed2734e5c Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 16 Nov 2024 00:44:58 -0600 Subject: [PATCH 2/4] ci: Remove tests with rust < 1.63 Since the increase to MSRV in [1], we no longer need to test with old versions of Rust. This makes CI identical to `main`, with the exception of branch configuration. [1]: https://github.com/rust-lang/libc/pull/4040 --- .github/workflows/full_ci.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index 9fb88067d183e..e3e69a0fa3dac 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -33,13 +33,7 @@ jobs: - stable - beta - nightly - # FIXME: Disabled due to: - # error: failed to parse registry's information for: serde - # 1.13.0, - - 1.19.0 - - 1.24.0 - - 1.25.0 - - 1.30.0 + - 1.63.0 steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -57,9 +51,10 @@ jobs: max-parallel: 4 matrix: target: - - { toolchain: stable, os: macos-13 } - - { toolchain: beta, os: macos-13 } - - { toolchain: nightly, os: macos-13 } + - { toolchain: stable, os: macos-14 } + - { toolchain: beta, os: macos-14 } + - { toolchain: nightly, os: macos-14 } + - { toolchain: 1.63.0, os: macos-14 } runs-on: ${{ matrix.target.os }} steps: - uses: actions/checkout@v4 @@ -77,10 +72,7 @@ jobs: fail-fast: true matrix: toolchain: - - 1.19.0 - - 1.24.0 - - 1.25.0 - - 1.30.0 + - 1.63.0 - stable steps: - uses: actions/checkout@v4 @@ -93,12 +85,12 @@ jobs: macos: name: macOS - runs-on: macos-13 + runs-on: macos-14 strategy: fail-fast: true matrix: target: - - x86_64-apple-darwin + - aarch64-apple-darwin steps: - uses: actions/checkout@v4 - name: Setup Rust toolchain @@ -120,6 +112,7 @@ jobs: ARCH_BITS: 64 ARCH: x86_64 - target: x86_64-pc-windows-msvc + # FIXME: It currently causes segfaults. #- target: i686-pc-windows-gnu # env: # ARCH_BITS: 32 From a4b5bf87aec69b93716375776ba2eb81a1f5550a Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 16 Nov 2024 00:46:33 -0600 Subject: [PATCH 3/4] Remove the "main" workflow This workflow is redundant now that Bors is no longer used. Remove it. --- .github/workflows/main.yml | 86 -------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index d22a4a19cc565..0000000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: CI - -on: - pull_request: - types: [opened, synchronize, reopened] - push: - branches: - - main - -permissions: - contents: read # to fetch code (actions/checkout) - -jobs: - docker_linux_tier1: - name: Docker Linux Tier1 - runs-on: ubuntu-22.04 - strategy: - fail-fast: true - matrix: - target: [ - i686-unknown-linux-gnu, - x86_64-unknown-linux-gnu, - ] - steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run-docker.sh - run: LIBC_CI=1 sh ./ci/run-docker.sh ${{ matrix.target }} - - macos: - name: macOS - runs-on: macos-13 - strategy: - fail-fast: true - matrix: - target: [ - x86_64-apple-darwin, - ] - steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} - - windows: - name: Windows - runs-on: windows-2022 - env: - OS: windows - strategy: - fail-fast: true - matrix: - include: - - target: x86_64-pc-windows-gnu - env: - ARCH_BITS: 64 - ARCH: x86_64 - - target: x86_64-pc-windows-msvc - #- target: i686-pc-windows-gnu - # env: - # ARCH_BITS: 32 - # ARCH: i686 - - target: i686-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - - name: Self-update rustup - run: rustup self update - shell: bash - - name: Setup Rust toolchain - run: TARGET=${{ matrix.target }} sh ./ci/install-rust.sh - shell: bash - - name: Execute run.sh - run: LIBC_CI=1 sh ./ci/run.sh ${{ matrix.target }} - shell: bash - - style_check: - name: Style check - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Setup Rust toolchain - run: sh ./ci/install-rust.sh - - name: Check style - run: sh ci/style.sh From 6093ce044c3e2638523afcc3720db9b0851f4cb6 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Sat, 16 Nov 2024 01:28:20 -0600 Subject: [PATCH 4/4] MacOS: move `ifconf` to `s_no_extra_traits` The derived implementations were causing a CI failure that didn't show up before. Manually implement `PartialEq` and `Debug` to work around this. --- src/unix/bsd/apple/mod.rs | 45 +++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index c6dd20cfd4eb6..3e61a283d3488 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1143,15 +1143,6 @@ s! { pub nativeattr: attribute_set_t, } - #[cfg_attr(libc_packedN, repr(packed(4)))] - pub struct ifconf { - pub ifc_len: ::c_int, - #[cfg(libc_union)] - pub ifc_ifcu: __c_anonymous_ifc_ifcu, - #[cfg(not(libc_union))] - pub ifc_ifcu: *mut ifreq, - } - #[cfg_attr(libc_align, repr(align(8)))] pub struct tcp_connection_info { pub tcpi_state: u8, @@ -1202,6 +1193,15 @@ s! { } s_no_extra_traits! { + #[cfg_attr(libc_packedN, repr(packed(4)))] + pub struct ifconf { + pub ifc_len: ::c_int, + #[cfg(libc_union)] + pub ifc_ifcu: __c_anonymous_ifc_ifcu, + #[cfg(not(libc_union))] + pub ifc_ifcu: *mut ifreq, + } + #[cfg_attr(libc_packedN, repr(packed(4)))] pub struct kevent { pub ident: ::uintptr_t, @@ -1617,6 +1617,32 @@ cfg_if! { cfg_if! { if #[cfg(feature = "extra_traits")] { + impl PartialEq for ifconf + where + Self: Copy + { + fn eq(&self, other: &Self) -> bool { + let len_ptr1 = core::ptr::addr_of!(self.ifc_len); + let len_ptr2 = core::ptr::addr_of!(other.ifc_len); + let ifcu_ptr1 = core::ptr::addr_of!(self.ifc_ifcu); + let ifcu_ptr2 = core::ptr::addr_of!(other.ifc_ifcu); + + // SAFETY: `ifconf` implements `Copy` so the reads are valid + let len1 = unsafe { len_ptr1.read_unaligned() }; + let len2 = unsafe { len_ptr2.read_unaligned() }; + let ifcu1 = unsafe { ifcu_ptr1.read_unaligned() }; + let ifcu2 = unsafe { ifcu_ptr2.read_unaligned() }; + + len1 == len2 && ifcu1 == ifcu2 + } + } + impl Eq for ifconf {} + impl ::fmt::Debug for ifconf { + fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result { + f.debug_struct("ifconf").finish_non_exhaustive() + } + } + impl PartialEq for kevent { fn eq(&self, other: &kevent) -> bool { self.ident == other.ident @@ -1627,6 +1653,7 @@ cfg_if! { && self.udata == other.udata } } + impl Eq for kevent {} impl ::fmt::Debug for kevent { fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {