From 8b3a4a96e56208fd7cffac8d6592d00c9304ac2a Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Thu, 6 Aug 2026 11:08:25 +0200 Subject: [PATCH 1/5] ci: run clippy in our platform specific tests We keep the main amd64 Linux clippy run for smoketesting, but we also need a platform-specific to cover all those codepaths that are arch/OS specific. --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf8e7f7c..1c3c3154 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: rustfmt,clippy + - name: targets + run: rustup target list --installed | grep aarch64 - name: rustfmt run: cargo fmt --all -- --check - name: clippy @@ -43,10 +45,13 @@ jobs: uses: dtolnay/rust-toolchain@stable with: target: ${{ matrix.job.target }} + components: clippy - name: Fetch run: cargo fetch --target ${{ matrix.job.target }} - name: Build run: cargo test --target ${{ matrix.job.target }} --no-run + - name: Clippy + run: cargo clippy --all-features --all-targets --target ${{ matrix.job.target }} -- -D warnings - name: Test run: cargo test --target ${{ matrix.job.target }} - name: Release test From b5956486894e1d8427140deaa08fd506525d3d34 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Thu, 6 Aug 2026 17:11:36 +0200 Subject: [PATCH 2/5] ci: add a linux-arm variant to the main test matrix There are now native ARM runners available, we might as well take advantage. --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c3c3154..862ad8d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,6 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: rustfmt,clippy - - name: targets - run: rustup target list --installed | grep aarch64 - name: rustfmt run: cargo fmt --all -- --check - name: clippy @@ -36,6 +34,7 @@ jobs: job: - { os: ubuntu-24.04, target: x86_64-unknown-linux-gnu, release: true } - { os: ubuntu-24.04, target: x86_64-unknown-linux-musl } + - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu } - { os: windows-2025, target: x86_64-pc-windows-msvc } - { os: macos-15-intel, target: x86_64-apple-darwin } - { os: macos-15, target: aarch64-apple-darwin } @@ -84,7 +83,6 @@ jobs: matrix: job: - target: i686-unknown-linux-gnu - - target: aarch64-unknown-linux-gnu - target: aarch64-unknown-linux-musl - target: arm-unknown-linux-gnueabi - target: arm-unknown-linux-musleabi From 83859ce130806c70d20f001dc641fa808ccccc32 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Thu, 6 Aug 2026 11:03:49 +0200 Subject: [PATCH 3/5] arm: fix clippy's collapsible_if Clippy error: error: this `if` statement can be collapsed --> src/linux/dumper_cpu_info/arm.rs:276:9 | 276 | / if field == "Features" { 277 | | if let Some(val) = value { 278 | | elf_hwcaps = parse_features(val); 279 | | } 280 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#collapsible_if --- src/linux/dumper_cpu_info/arm.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/linux/dumper_cpu_info/arm.rs b/src/linux/dumper_cpu_info/arm.rs index 0bc1290f..aa14278a 100644 --- a/src/linux/dumper_cpu_info/arm.rs +++ b/src/linux/dumper_cpu_info/arm.rs @@ -273,10 +273,10 @@ pub fn write_cpu_information( } // Rebuild the ELF hwcaps from the 'Features' field. - if field == "Features" { - if let Some(val) = value { - elf_hwcaps = parse_features(val); - } + if field == "Features" + && let Some(val) = value + { + elf_hwcaps = parse_features(val); } } From 8dcaa47103e4dca9f89fed0adcdaeed2bc38c3cb Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Thu, 6 Aug 2026 16:45:44 +0200 Subject: [PATCH 4/5] tests: address clippy warning about wait()ing We do it the proper way on Mac, checking that the child was indeed killed by us. Sadly, the Windows APIs available don't allow us to do the same there. Example clippy complaint: error: spawned process is never `wait()`ed on --> tests\windows_minidump_writer.rs:135:21 | 135 | let mut child = start_child_and_return(&[&format!("{:x}", EXCEPTION_ILLEGAL_INSTRUCTION)]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider calling `.wait()` = note: not doing so might leave behind zombie processes --- tests/mac_minidump_writer.rs | 6 ++++++ tests/windows_minidump_writer.rs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/tests/mac_minidump_writer.rs b/tests/mac_minidump_writer.rs index 1087951a..4a929326 100644 --- a/tests/mac_minidump_writer.rs +++ b/tests/mac_minidump_writer.rs @@ -7,6 +7,7 @@ use { MinidumpModuleList, MinidumpSystemInfo, MinidumpThreadList, }, minidump_writer::minidump_writer::MinidumpWriter, + std::os::unix::process::ExitStatusExt, }; mod common; @@ -67,6 +68,11 @@ fn capture_minidump(name: &str, exception_kind: u32) -> Captured<'_> { .expect("failed to send ack"); child.kill().expect("failed to kill child"); + // Reap child + let waitres = child.wait().expect("Failed to wait for child"); + let status = waitres.signal().expect("Child did not die due to signal"); + assert_eq!(waitres.code(), None); + assert_eq!(status, libc::SIGKILL); let minidump = Minidump::read_path(tmpfile.path()).expect("failed to read minidump"); diff --git a/tests/windows_minidump_writer.rs b/tests/windows_minidump_writer.rs index 548f6e87..3af18bdd 100644 --- a/tests/windows_minidump_writer.rs +++ b/tests/windows_minidump_writer.rs @@ -171,7 +171,11 @@ fn dump_external_process() { .expect("failed to write minidump"); child.kill().expect("failed to kill child"); + // Reap child + child.wait().expect("Failed to wait for child"); + // Clean up the zombie child. + child.wait().expect("failed to wait child"); let md = Minidump::read_path(tmpfile.path()).expect("failed to read minidump"); let _: MinidumpThreadList = md.get_stream().expect("Couldn't find MinidumpThreadList"); From 0fc061ac5dafff6f475b279a3edf7c87a2734740 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Thu, 6 Aug 2026 17:07:00 +0200 Subject: [PATCH 5/5] mac: use literal C string to placate clippy Clippy warning: error: manually constructing a nul-terminated string --> src/mac/streams/module_list.rs:375:21 | 375 | b"__TEXT\0".as_ptr(), | ^^^^^^^^^^^ help: use a `c""` literal: `c"__TEXT"` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#manual_c_str_literals --- src/mac/streams/module_list.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mac/streams/module_list.rs b/src/mac/streams/module_list.rs index 9da5ff87..dfc8fe6e 100644 --- a/src/mac/streams/module_list.rs +++ b/src/mac/streams/module_list.rs @@ -372,7 +372,7 @@ mod test { let expect_segment_data = unsafe { getsegmentdata( expected_img_hdr, - b"__TEXT\0".as_ptr(), + c"__TEXT".as_ptr().cast(), &mut expect_segment_size, ) };