Skip to content

Commit 0a2283a

Browse files
authored
fix ci (#300)
1 parent a4b65d0 commit 0a2283a

File tree

7 files changed

+26
-51
lines changed

7 files changed

+26
-51
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,24 @@ jobs:
1212
matrix:
1313
target:
1414
- x86_64-unknown-linux-gnu
15-
- aarch64-unknown-linux-gnu
1615

1716
steps:
1817
- uses: actions/checkout@v4
19-
- uses: actions-rs/cargo@v1
20-
with:
21-
command: test
22-
use-cross: true
23-
args: --target ${{ matrix.target }}
24-
- uses: actions-rs/cargo@v1
25-
with:
26-
command: run
27-
use-cross: true
28-
# Only run the test package on x86 until we find an ergonomic way
29-
# to virtualize aarch64
30-
args: --package io-uring-test --features io-uring-test/ci --target x86_64-unknown-linux-gnu
18+
- uses: dtolnay/rust-toolchain@stable
19+
- name: Test
20+
run: cargo run --package io-uring-test --features io-uring-test/ci --target ${{ matrix.target }}
3121

3222
check-bench:
3323
runs-on: ubuntu-latest
3424

3525
strategy:
3626
fail-fast: false
3727

38-
matrix:
39-
target:
40-
- x86_64-unknown-linux-gnu
41-
4228
steps:
4329
- uses: actions/checkout@v4
44-
- uses: actions-rs/toolchain@v1
45-
with:
46-
toolchain: nightly
47-
profile: minimal
48-
components: clippy
49-
override: true
50-
- uses: actions-rs/clippy-check@v1
51-
with:
52-
token: ${{ secrets.GITHUB_TOKEN }}
53-
args: --package io-uring-bench
30+
- uses: dtolnay/rust-toolchain@stable
31+
- name: Bench
32+
run: cargo bench --package io-uring-bench
5433

5534
check:
5635
runs-on: ubuntu-latest
@@ -60,7 +39,7 @@ jobs:
6039

6140
matrix:
6241
toolchain:
63-
- nightly
42+
- stable
6443
- "1.48"
6544
target:
6645
- x86_64-unknown-linux-gnu
@@ -70,26 +49,23 @@ jobs:
7049

7150
steps:
7251
- uses: actions/checkout@v4
73-
- uses: actions-rs/toolchain@v1
74-
with:
75-
toolchain: ${{ matrix.toolchain }}
76-
target: ${{ matrix.target }}
77-
components: clippy
78-
override: true
79-
- uses: actions-rs/clippy-check@v1
52+
- uses: dtolnay/rust-toolchain@stable
8053
with:
81-
token: ${{ secrets.GITHUB_TOKEN }}
82-
args: --target ${{ matrix.target }}
54+
toolchain: ${{ matrix.toolchain }}
55+
target: ${{ matrix.target }}
56+
components: clippy
57+
override: true
58+
- name: Lint
59+
run: cargo clippy --target ${{ matrix.target }}
8360

8461
fmt:
8562
name: fmt
8663
runs-on: ubuntu-latest
8764
steps:
8865
- uses: actions/checkout@v4
89-
- name: Install Rust
90-
run: rustup update stable
91-
- name: Install rustfmt
92-
run: rustup component add rustfmt
66+
- uses: dtolnay/rust-toolchain@stable
67+
with:
68+
components: rustfmt
9369

9470
- name: "rustfmt --check"
9571
run: |

io-uring-test/src/tests/futex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ fn syscall_futex(futex: *const u32, op: libc::c_int, val: u32) -> io::Result<i64
2626
)
2727
};
2828
if ret >= 0 {
29-
Ok(ret)
29+
Ok(ret as _)
3030
} else {
3131
Err(io::Error::from_raw_os_error(-ret as _))
3232
}

io-uring-test/src/tests/net.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,11 +1661,11 @@ pub fn test_udp_sendzc_with_dest<S: squeue::EntryMarker, C: cqueue::EntryMarker>
16611661
33 => match cqe.result() {
16621662
// First SendZc notification
16631663
11 => {
1664-
assert_eq!(cqueue::more(cqe.flags()), true);
1664+
assert!(cqueue::more(cqe.flags()));
16651665
}
16661666
// Last SendZc notification
16671667
0 => {
1668-
assert_eq!(cqueue::more(cqe.flags()), false);
1668+
assert!(!cqueue::more(cqe.flags()));
16691669
}
16701670
_ => panic!("wrong result for notification"),
16711671
},

io-uring-test/src/tests/queue.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,10 @@ pub fn test_msg_ring_data<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
172172
let fd = types::Fd(dest_ring.as_raw_fd());
173173
let result = 82; // b'R'
174174
let user_data = 85; // b'U'
175-
let flags = None;
176175
unsafe {
177176
ring.submission()
178177
.push(
179-
&opcode::MsgRingData::new(fd, result, user_data, flags)
178+
&opcode::MsgRingData::new(fd, result, user_data, None)
180179
.build()
181180
.into(),
182181
)
@@ -194,7 +193,7 @@ pub fn test_msg_ring_data<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
194193
assert_eq!(dest_cqes.len(), 1);
195194
assert_eq!(dest_cqes[0].user_data(), user_data);
196195
assert_eq!(dest_cqes[0].result(), result);
197-
assert_eq!(dest_cqes[0].flags(), flags.unwrap_or(0));
196+
assert_eq!(dest_cqes[0].flags(), 0);
198197

199198
Ok(())
200199
}

io-uring-test/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub fn writev_readv<S: squeue::EntryMarker, C: cqueue::EntryMarker>(
102102
let mut output = vec![0; text.len()];
103103
let mut output2 = vec![0; text2.len()];
104104

105-
let text3 = vec![IoSlice::new(text), IoSlice::new(text2)];
105+
let text3 = [IoSlice::new(text), IoSlice::new(text2)];
106106
let mut output3 = vec![IoSliceMut::new(&mut output), IoSliceMut::new(&mut output2)];
107107

108108
let write_e = opcode::Writev::new(fd_in, text3.as_ptr().cast(), text3.len() as _);

src/cqueue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl Entry {
210210
///
211211
/// This is currently used for:
212212
/// - Storing the selected buffer ID, if one was selected. See
213-
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
213+
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
214214
#[inline]
215215
pub fn flags(&self) -> u32 {
216216
self.0.flags
@@ -259,7 +259,7 @@ impl Entry32 {
259259
///
260260
/// This is currently used for:
261261
/// - Storing the selected buffer ID, if one was selected. See
262-
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
262+
/// [`BUFFER_SELECT`](crate::squeue::Flags::BUFFER_SELECT) for more info.
263263
#[inline]
264264
pub fn flags(&self) -> u32 {
265265
self.0 .0.flags

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! The crate only provides a summary of the parameters.
44
//! For more detailed documentation, see manpage.
5-
#![warn(rust_2018_idioms, unused_qualifications)]
5+
#![warn(rust_2018_idioms)]
66

77
#[macro_use]
88
mod util;

0 commit comments

Comments
 (0)