From 5d0fbaeadeb18d01871558cd9ca23ca9097bfe8a Mon Sep 17 00:00:00 2001 From: Vianney Ruhlmann Date: Thu, 13 Jun 2024 15:10:17 +0200 Subject: [PATCH 1/4] Run clippy on windows in CI --- .github/workflows/lint.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 21d580fdd..7e40a7981 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,13 +15,14 @@ jobs: run: rustup update nightly && rustup default nightly && rustup component add rustfmt - run: cargo fmt --all -- --check clippy: - name: "clippy #${{ matrix.rust_version }}" + name: "clippy #${{ matrix.platform }} ${{ matrix.rust_version }}" + runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: # Ignore nightly for now, it fails too often rust_version: ["1.71.1", "stable"] - runs-on: ubuntu-latest + platform: [windows-latest, ubuntu-latest] steps: - name: Checkout sources uses: actions/checkout@v4 @@ -31,7 +32,9 @@ jobs: rust_version: ${{ matrix.rust_version }} - name: Install ${{ matrix.version }} toolchain and clippy run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy - - run: cargo clippy --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.71.1 ] && echo -Aunknown-lints) + - name: Run clippy on ${{ matrix.platform }} ${{ matrix.rust_version }} + shell: bash + run: cargo clippy --all-targets --all-features -- -D warnings $([[ ${{ matrix.rust_version }} == "1.71.1" ]] && echo -A unknown-lints) licensecheck: runs-on: ubuntu-latest name: "Presence of licence headers" From e3f4d061b725c65d696d752fe1c53e97d4c11fe5 Mon Sep 17 00:00:00 2001 From: Vianney Ruhlmann Date: Thu, 13 Jun 2024 17:19:11 +0200 Subject: [PATCH 2/4] Fix win32 clippy error --- spawn_worker/src/win32.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spawn_worker/src/win32.rs b/spawn_worker/src/win32.rs index ecda74ca9..5152ee1f4 100644 --- a/spawn_worker/src/win32.rs +++ b/spawn_worker/src/win32.rs @@ -416,8 +416,7 @@ pub fn recv_passed_handle() -> Option { } fn get_module_file_name(h: HMODULE) -> anyhow::Result { - let mut buf = Vec::new(); - buf.resize(2000, 0); + let mut buf = vec![0; 2000]; loop { let read: usize = unsafe { GetModuleFileNameW(h, &mut buf) } as usize; if read == 0 { From 9e23d45f7b591be6fddc48ed7a08a264f1c5cdb9 Mon Sep 17 00:00:00 2001 From: Vianney Ruhlmann Date: Thu, 13 Jun 2024 17:29:26 +0200 Subject: [PATCH 3/4] Revert clippy rust_version check --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7e40a7981..2829f74c5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,7 +34,7 @@ jobs: run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy - name: Run clippy on ${{ matrix.platform }} ${{ matrix.rust_version }} shell: bash - run: cargo clippy --all-targets --all-features -- -D warnings $([[ ${{ matrix.rust_version }} == "1.71.1" ]] && echo -A unknown-lints) + run: cargo clippy --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.71.1 ] && echo -Aunknown-lints) licensecheck: runs-on: ubuntu-latest name: "Presence of licence headers" From ffcea0bf27ef23b36f90c3ea3b4c8289e13a8a77 Mon Sep 17 00:00:00 2001 From: Vianney Ruhlmann Date: Fri, 14 Jun 2024 10:23:31 +0200 Subject: [PATCH 4/4] Fix clippy error on windows --- profiling-ffi/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiling-ffi/src/lib.rs b/profiling-ffi/src/lib.rs index 20e68186f..9f5c260c2 100644 --- a/profiling-ffi/src/lib.rs +++ b/profiling-ffi/src/lib.rs @@ -1,7 +1,7 @@ // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/ // SPDX-License-Identifier: Apache-2.0 -#[cfg(feature = "symbolizer")] +#[cfg(all(feature = "symbolizer", not(target_os = "windows")))] pub use symbolizer_ffi::*; use std::fmt::Debug;