Skip to content

Commit

Permalink
remove the pcap windows insanity
Browse files Browse the repository at this point in the history
  • Loading branch information
gbin committed Dec 4, 2024
1 parent ccb5734 commit 89fe6c7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 37 deletions.
42 changes: 10 additions & 32 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,51 +29,29 @@ jobs:
- name: Cargo fmt check
run: cargo fmt --all -- --check

## System dependencies

# Install dependencies only on Linux
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libudev-dev libpcap-dev

# Those are needed for the integration tests on Windows
- name: Download Npcap SDK (Windows)
if: runner.os == 'Windows'
run: |
Invoke-WebRequest -Uri https://npcap.com/dist/npcap-sdk-1.13.zip -OutFile npcap-sdk.zip
Expand-Archive -Path npcap-sdk.zip -DestinationPath $env:USERPROFILE\npcap-sdk
Remove-Item npcap-sdk.zip
- name: Run clippy
run: cargo clippy -- -W warnings

- name: Set Library and Include Paths (Windows)
if: runner.os == 'Windows'
- name: Build vanilla
run: |
$npcapLibDir = "$env:USERPROFILE\npcap-sdk\Lib\x64"
$npcapIncludeDir = "$env:USERPROFILE\npcap-sdk\Include"
[System.Environment]::SetEnvironmentVariable("LIB", "$npcapLibDir;"+$env:LIB, [System.EnvironmentVariableTarget]::Process)
[System.Environment]::SetEnvironmentVariable("INCLUDE", "$npcapIncludeDir;"+$env:INCLUDE, [System.EnvironmentVariableTarget]::Process)
## End of system dependencies

## Rust env
- name: Install cargo-generate
run: cargo install cargo-generate
## End of rust env

# - name: Run clippy
# run: cargo clippy -- -W warnings
cargo build --workspace --features macro_debug
# - name: Build vanilla
# run: |
# cargo build --workspace --features macro_debug

# - name: Build with mocks
# run: |
# cargo build --workspace --features mock
- name: Build with mocks
run: |
cargo build --workspace --features mock
- name: Run tests
run: cargo test --workspace

# Integration Test for the 1 liner generation of a project.
- name: Install cargo-generate
run: cargo install cargo-generate

- name: Generate new project in temporary directory
if: runner.os != 'Windows'
run: |
Expand Down
6 changes: 4 additions & 2 deletions components/sources/cu_hesai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ repository.workspace = true
[dependencies]
cu29-clock = { workspace = true }
cu-sensor-payloads = { workspace = true }

pcap = "2.2.0"
bytemuck = { version = "1.20.0", features = ["derive"] }
uom = { workspace = true }
chrono = { version = "0.4.38" }
cu29 = { workspace = true }
socket2 = { version = "0.5.8", features = ["all"] }

[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
pcap = "2.2.0"

2 changes: 1 addition & 1 deletion components/sources/cu_hesai/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<'cl> CuSrcTask<'cl> for Xt32 {
}
}

#[cfg(test)]
#[cfg(all(test, not(target_os = "windows")))]
mod tests {
use super::*;
use chrono::DateTime;
Expand Down
2 changes: 1 addition & 1 deletion components/sources/cu_vlp16/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ cu29 = { workspace = true }
cu-sensor-payloads = { workspace = true }
velodyne-lidar = { version = "0.3.0", features = ["full"] }

[dev-dependencies]
[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
pcap-file = "2.0.0"
2 changes: 1 addition & 1 deletion components/sources/cu_vlp16/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl<'cl> CuSrcTask<'cl> for Vlp16 {
}
}

#[cfg(test)]
#[cfg(all(test, not(target_os = "windows")))]
mod tests {
use pcap_file::pcap::PcapReader;
use std::fs::File;
Expand Down

0 comments on commit 89fe6c7

Please sign in to comment.