Skip to content

Commit be286ef

Browse files
d-e-s-odanielocfb
authored andcommitted
Replace deprecated actions-rs/toolchain usage
The actions-rs/toolchain GitHub action is no longer maintained. Switch over to using dtolnay/rust-toolchain in its stead. Signed-off-by: Daniel Müller <[email protected]>
1 parent 63b5c23 commit be286ef

File tree

3 files changed

+14
-51
lines changed

3 files changed

+14
-51
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v4
35-
- name: Install Rust
36-
uses: actions-rs/[email protected]
37-
with:
38-
profile: minimal
39-
toolchain: stable
40-
override: true
35+
- uses: dtolnay/rust-toolchain@stable
4136
- name: Dry-run package creation
4237
# Can't verify libbpf-cargo for it may depend on yet-to-be-published libbpf-rs.
4338
run: cargo package --package libbpf-rs --locked --no-verify

.github/workflows/test.yml

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,10 @@ jobs:
4343
tc_var CFLAGS
4444
tc_var CXXFLAGS
4545
- uses: actions/checkout@v4
46-
- name: Install Rust
47-
uses: actions-rs/[email protected]
46+
- uses: dtolnay/rust-toolchain@master
4847
with:
49-
profile: minimal
5048
toolchain: ${{ matrix.rust }}
5149
components: rustfmt
52-
override: true
5350
- name: Install deps
5451
run: |
5552
sudo apt-get install -y clang-14 libelf-dev zlib1g-dev linux-headers-$(uname -r)
@@ -72,20 +69,15 @@ jobs:
7269
- name: Install deps
7370
run: sudo apt-get install -y libelf-dev
7471
- name: Install Nightly Rust
75-
uses: actions-rs/[email protected]
76-
with:
77-
profile: minimal
78-
toolchain: nightly
72+
uses: dtolnay/rust-toolchain@nightly
7973
- run: cargo +nightly -Z minimal-versions update
8074
- name: Install minimum Rust
81-
uses: actions-rs/toolchain@v1.0.6
75+
uses: dtolnay/rust-toolchain@master
8276
with:
83-
profile: minimal
8477
# Please adjust README and rust-version field in Cargo.toml files when
8578
# bumping version.
8679
toolchain: 1.65.0
8780
components: rustfmt
88-
default: true
8981
- uses: Swatinem/rust-cache@v2
9082
- name: Build
9183
run: cargo build --verbose --workspace --exclude runqslower
@@ -97,11 +89,7 @@ jobs:
9789
- uses: actions/checkout@v4
9890
- name: Install deps
9991
run: sudo apt-get install -y libelf-dev
100-
- uses: actions-rs/toolchain@v1
101-
with:
102-
profile: minimal
103-
toolchain: stable
104-
override: true
92+
- uses: dtolnay/rust-toolchain@stable
10593
- uses: Swatinem/rust-cache@v2
10694
- run: RUSTFLAGS="$RUSTFLAGS -L /usr/lib/x86_64-linux-gnu" cargo build --locked --package capable --features=static
10795
build-aarch64:
@@ -118,12 +106,9 @@ jobs:
118106
$release $release-updates $release-security \
119107
>> /etc/apt/sources.list
120108
shell: sudo sh -e {0}
121-
- uses: actions-rs/toolchain@v1
109+
- uses: dtolnay/rust-toolchain@stable
122110
with:
123-
profile: minimal
124-
toolchain: stable
125-
target: aarch64-unknown-linux-gnu
126-
override: true
111+
targets: aarch64-unknown-linux-gnu
127112
- name: Install deps
128113
run: |
129114
sudo apt-get update
@@ -148,12 +133,9 @@ jobs:
148133
$release $release-updates $release-security \
149134
>> /etc/apt/sources.list
150135
shell: sudo sh -e {0}
151-
- uses: actions-rs/toolchain@v1
136+
- uses: dtolnay/rust-toolchain@stable
152137
with:
153-
profile: minimal
154-
toolchain: stable
155-
target: armv7-unknown-linux-gnueabihf
156-
override: true
138+
targets: armv7-unknown-linux-gnueabihf
157139
- name: Install deps
158140
run: |
159141
sudo apt-get update
@@ -171,29 +153,19 @@ jobs:
171153
- uses: actions/checkout@v4
172154
- name: Install deps
173155
run: sudo apt-get install -y libelf-dev
174-
- uses: actions-rs/toolchain@v1
156+
- uses: dtolnay/rust-toolchain@stable
175157
with:
176-
profile: minimal
177-
# TODO: Move back to `stable` once we are past 1.69
178-
# See:
179-
# https://github.com/clap-rs/clap/issues/4849
180-
# https://github.com/rust-lang/rust-clippy/issues/10421
181-
toolchain: 1.68.2
182-
components: clippy,rustfmt
183-
override: true
158+
components: rustfmt
184159
- uses: Swatinem/rust-cache@v2
185160
- run: cargo clippy --locked --no-deps --all-targets --tests -- -D warnings
186161
rustfmt:
187162
name: Check code formatting
188163
runs-on: ubuntu-latest
189164
steps:
190165
- uses: actions/checkout@v4
191-
- uses: actions-rs/toolchain@v1
166+
- uses: dtolnay/rust-toolchain@nightly
192167
with:
193-
profile: minimal
194-
toolchain: nightly
195168
components: rustfmt
196-
override: true
197169
- run: cargo fmt --package libbpf-cargo libbpf-rs -- --check
198170
cargo-doc:
199171
name: Check documentation
@@ -204,9 +176,5 @@ jobs:
204176
- uses: actions/checkout@v4
205177
- name: Install deps
206178
run: sudo apt-get install -y libelf-dev
207-
- uses: actions-rs/toolchain@v1
208-
with:
209-
profile: minimal
210-
toolchain: stable
211-
override: true
179+
- uses: dtolnay/rust-toolchain@stable
212180
- run: cargo doc --locked --no-deps

libbpf-rs/tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ fn buffer<'a>(perf: &'a libbpf_rs::PerfBuffer, buf_idx: usize) -> &'a [u8] {
14341434
libbpf_sys::perf_buffer__buffer(
14351435
perf_buff_ptr.as_ptr(),
14361436
buf_idx as i32,
1437-
ptr::addr_of_mut!(buffer_data_ptr) as *mut *mut c_void,
1437+
ptr::addr_of_mut!(buffer_data_ptr),
14381438
ptr::addr_of_mut!(buffer_size) as *mut libbpf_sys::size_t,
14391439
)
14401440
};

0 commit comments

Comments
 (0)