Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated actions-rs/toolchain usage #620

Merged
merged 1 commit into from
Dec 4, 2023
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
7 changes: 1 addition & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1.0.6
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- name: Dry-run package creation
# Can't verify libbpf-cargo for it may depend on yet-to-be-published libbpf-rs.
run: cargo package --package libbpf-rs --locked --no-verify
Expand Down
56 changes: 12 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,10 @@ jobs:
tc_var CFLAGS
tc_var CXXFLAGS
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rs/toolchain@v1.0.6
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- name: Install deps
run: |
sudo apt-get install -y clang-14 libelf-dev zlib1g-dev linux-headers-$(uname -r)
Expand All @@ -72,20 +69,15 @@ jobs:
- name: Install deps
run: sudo apt-get install -y libelf-dev
- name: Install Nightly Rust
uses: actions-rs/toolchain@v1.0.6
with:
profile: minimal
toolchain: nightly
uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly -Z minimal-versions update
- name: Install minimum Rust
uses: actions-rs/toolchain@v1.0.6
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
# Please adjust README and rust-version field in Cargo.toml files when
# bumping version.
toolchain: 1.65.0
components: rustfmt
default: true
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose --workspace --exclude runqslower
Expand All @@ -97,11 +89,7 @@ jobs:
- uses: actions/checkout@v4
- name: Install deps
run: sudo apt-get install -y libelf-dev
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: RUSTFLAGS="$RUSTFLAGS -L /usr/lib/x86_64-linux-gnu" cargo build --locked --package capable --features=static
build-aarch64:
Expand All @@ -118,12 +106,9 @@ jobs:
$release $release-updates $release-security \
>> /etc/apt/sources.list
shell: sudo sh -e {0}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
target: aarch64-unknown-linux-gnu
override: true
targets: aarch64-unknown-linux-gnu
- name: Install deps
run: |
sudo apt-get update
Expand All @@ -148,12 +133,9 @@ jobs:
$release $release-updates $release-security \
>> /etc/apt/sources.list
shell: sudo sh -e {0}
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
target: armv7-unknown-linux-gnueabihf
override: true
targets: armv7-unknown-linux-gnueabihf
- name: Install deps
run: |
sudo apt-get update
Expand All @@ -171,29 +153,19 @@ jobs:
- uses: actions/checkout@v4
- name: Install deps
run: sudo apt-get install -y libelf-dev
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
# TODO: Move back to `stable` once we are past 1.69
# See:
# https://github.com/clap-rs/clap/issues/4849
# https://github.com/rust-lang/rust-clippy/issues/10421
toolchain: 1.68.2
components: clippy,rustfmt
override: true
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --locked --no-deps --all-targets --tests -- -D warnings
rustfmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- run: cargo fmt --package libbpf-cargo libbpf-rs -- --check
cargo-doc:
name: Check documentation
Expand All @@ -204,9 +176,5 @@ jobs:
- uses: actions/checkout@v4
- name: Install deps
run: sudo apt-get install -y libelf-dev
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --locked --no-deps
2 changes: 1 addition & 1 deletion libbpf-rs/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ fn buffer<'a>(perf: &'a libbpf_rs::PerfBuffer, buf_idx: usize) -> &'a [u8] {
libbpf_sys::perf_buffer__buffer(
perf_buff_ptr.as_ptr(),
buf_idx as i32,
ptr::addr_of_mut!(buffer_data_ptr) as *mut *mut c_void,
ptr::addr_of_mut!(buffer_data_ptr),
ptr::addr_of_mut!(buffer_size) as *mut libbpf_sys::size_t,
)
};
Expand Down