Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 17 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
msrv: ${{ steps.definitions.outputs.msrv }}
examples: ${{ steps.definitions.outputs.examples }}
crates: ${{ steps.definitions.outputs.crates }}
workspaces: ${{ steps.definitions.outputs.workspaces }}
steps:
- uses: actions/checkout@v4
# examples is populated by
Expand Down Expand Up @@ -76,6 +77,9 @@ jobs:
export CRATES=$(find quic common -name *Cargo.toml | jq -R | jq -s | jq '. += ["tools/xdp/s2n-quic-xdp/Cargo.toml","dc/s2n-quic-dc/Cargo.toml"]' | jq -c)
echo "crates=$CRATES"
echo "crates=$CRATES" >> $GITHUB_OUTPUT
export WORKSPACES=$(find . -maxdepth 4 -name Cargo.toml -not -path './tools/xdp/ebpf/*' -exec grep -l '^\[workspace\]' {} \; | xargs -n1 dirname | sort | jq -R | jq -sc)
echo "workspaces=$WORKSPACES"
echo "workspaces=$WORKSPACES" >> $GITHUB_OUTPUT

rustfmt:
runs-on: ubuntu-latest
Expand All @@ -96,14 +100,7 @@ jobs:

clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- toolchain: stable
# fail on stable warnings
args: "-D warnings"
- toolchain: beta
needs: env
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -112,15 +109,21 @@ jobs:
- name: Install rust toolchain
id: toolchain
run: |
rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component clippy
rustup override set ${{ matrix.toolchain }}
rustup toolchain install stable --profile minimal --component clippy
rustup override set stable

- uses: camshaft/rust-cache@v1

# TODO translate json reports to in-action warnings
- name: Run cargo clippy
- name: Run cargo clippy on all workspaces
run: |
cargo clippy --all-features --all-targets --workspace -- ${{ matrix.args }}
WORKSPACES=$(echo '${{ needs.env.outputs.workspaces }}' | jq -r '.[]')
for workspace in $WORKSPACES; do
echo "Running clippy on $workspace"
cd "$workspace"
cargo clippy --all-features --all-targets --workspace -- -D warnings
cd $GITHUB_WORKSPACE
done

udeps:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -522,10 +525,6 @@ jobs:
working-directory: ${{ matrix.example }}
run: cargo +nightly fmt --all -- --check

- name: lint
working-directory: ${{ matrix.example }}
run: cargo clippy --all-features --all-targets -- -D warnings

# not all examples will build with the --manifest-path argument, since the
# manifest-path argument will pull configuration from the current directory
# instead of the directory with the Cargo.toml file
Expand Down Expand Up @@ -884,7 +883,7 @@ jobs:
- name: Install rust toolchain
id: toolchain
run: |
rustup toolchain install stable --profile minimal --component clippy,rustfmt
rustup toolchain install stable --profile minimal --component rustfmt
rustup override set stable

- uses: camshaft/install@v1
Expand All @@ -893,10 +892,6 @@ jobs:

- uses: camshaft/rust-cache@v1

- name: Run clippy
working-directory: tools/xdp
run: cargo +stable clippy

- name: Build ebpf
working-directory: tools/xdp
env:
Expand All @@ -917,7 +912,7 @@ jobs:
- name: Install rust toolchain
working-directory: dc/wireshark
run: |
rustup toolchain install stable --profile minimal --component clippy,rustfmt
rustup toolchain install stable --profile minimal --component rustfmt
rustup override set stable

- uses: camshaft/install@v1
Expand All @@ -935,10 +930,6 @@ jobs:
working-directory: dc/wireshark
run: cargo fmt --all -- --check

- name: Run clippy
working-directory: dc/wireshark
run: cargo clippy --tests

- name: Run tests
working-directory: dc/wireshark
run: cargo xtask test
Expand Down
2 changes: 1 addition & 1 deletion dc/wireshark/.clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.77.0"
msrv = "1.82.0"
2 changes: 1 addition & 1 deletion dc/wireshark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "wireshark_dcquic"
version = "0.0.0"
edition = "2021"
publish = false
rust-version = "1.77"
rust-version = "1.82"

[lib]
crate-type = ["rlib", "cdylib"]
Expand Down
2 changes: 1 addition & 1 deletion dc/wireshark/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ fn env<N: AsRef<str>>(name: N) -> String {

fn option_env<N: AsRef<str>>(name: N) -> Option<String> {
let name = name.as_ref();
println!("cargo:rerun-if-env-changed={}", name);
println!("cargo:rerun-if-env-changed={name}");
std::env::var(name).ok()
}
2 changes: 1 addition & 1 deletion dc/wireshark/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.77.0"
channel = "1.82.0"
components = [ "rustc", "clippy", "rustfmt" ]
4 changes: 2 additions & 2 deletions dc/wireshark/src/wireshark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Info for Vec<u8> {

fn append<T: core::fmt::Display>(&mut self, v: T) {
use std::io::Write;
let _ = write!(self, "{}", v);
let _ = write!(self, "{v}");
}

fn append_str(&mut self, v: &str) {
Expand All @@ -51,7 +51,7 @@ impl Info for String {

fn append<T: core::fmt::Display>(&mut self, v: T) {
use std::fmt::Write;
let _ = write!(self, "{}", v);
let _ = write!(self, "{v}");
}

fn append_str(&mut self, v: &str) {
Expand Down
2 changes: 1 addition & 1 deletion dc/wireshark/xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl WiresharkVersion {
let tshark = tshark(sh).unwrap();
let output = cmd!(sh, "{tshark} --version").read().unwrap();
let version = output.lines().next().unwrap();
let version = version.trim_start_matches(|v: char| !v.is_digit(10));
let version = version.trim_start_matches(|v: char| !v.is_ascii_digit());
let (version, _) = version
.split_once(char::is_whitespace)
.unwrap_or((version, ""));
Expand Down
1 change: 1 addition & 0 deletions tools/udp-attack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name = "udp-attack"
version = "0.1.0"
edition = "2021"
publish = false
rust-version = "1.82"

[dependencies]
clap = { version = "4", features = ["derive"] }
Expand Down
3 changes: 0 additions & 3 deletions tools/udp-attack/rust-toolchain

This file was deleted.

2 changes: 1 addition & 1 deletion tools/xdp/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.80.0"
channel = "1.82.0"
components = [ "rustc", "clippy", "rustfmt" ]
2 changes: 1 addition & 1 deletion tools/xdp/tester/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async fn main() -> Result<(), anyhow::Error> {

if opt.trace {
if let Err(e) = EbpfLogger::init(&mut bpf) {
warn!("failed to initialize eBPF logger: {}", e);
warn!("failed to initialize eBPF logger: {e}");
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/xdp/xtask/src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn cap_net_raw_tests() -> Result<(), anyhow::Error> {
|| !path
.file_name()
.and_then(|name| name.to_str())
.map_or(false, |name| name.starts_with("s2n_quic_xdp"))
.is_some_and(|name| name.starts_with("s2n_quic_xdp"))
{
continue;
}
Expand Down
Loading