diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 21d580fdd..2829f74c5 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 -Aunknown-lints) licensecheck: runs-on: ubuntu-latest name: "Presence of licence headers" 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; 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 {