Skip to content

Commit

Permalink
Remove rust-toolchain files
Browse files Browse the repository at this point in the history
These files aren't at the root of the workspace, so they are not
normally respected. Move the knowledge that BPF must be compiled with
nightly to build.rs instead.
  • Loading branch information
tamird committed Nov 27, 2024
1 parent c465aed commit fc37b43
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rustfmt, clippy, miri, rust-src
components: miri,rustfmt,rust-src

# Installed *after* nightly so it is the default.
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- uses: Swatinem/rust-cache@v2

Expand All @@ -43,7 +47,7 @@ jobs:
run: taplo fmt --check

- name: Check formatting
run: cargo fmt --all -- --check
run: cargo +nightly fmt --all -- --check

- name: Run clippy
run: |
Expand All @@ -70,7 +74,7 @@ jobs:
- name: Run miri
run: |
set -euxo pipefail
cargo hack miri test --all-targets --feature-powerset \
cargo +nightly hack miri test --all-targets --feature-powerset \
--exclude aya-ebpf \
--exclude aya-ebpf-bindings \
--exclude aya-log-ebpf \
Expand All @@ -93,9 +97,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.arch }}

- uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -162,11 +165,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rust-src

# Installed *after* nightly so it is the default.
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: bpf-linker
Expand All @@ -178,7 +183,7 @@ jobs:
CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.arch }}
run: |
set -euxo pipefail
cargo hack build \
cargo +nightly hack build \
--target ${{ matrix.target }} \
-Z build-std=core \
--package aya-ebpf \
Expand Down Expand Up @@ -252,10 +257,13 @@ jobs:
echo $(brew --prefix)/opt/gnu-tar/libexec/gnubin >> $GITHUB_PATH
echo $(brew --prefix)/opt/llvm/bin >> $GITHUB_PATH
- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: rust-src

# Installed *after* nightly so it is the default.
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-musl,x86_64-unknown-linux-musl

- uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 0 additions & 2 deletions ebpf/rust-toolchain.toml

This file was deleted.

2 changes: 0 additions & 2 deletions test/integration-ebpf/rust-toolchain.toml

This file was deleted.

5 changes: 3 additions & 2 deletions test/integration-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ fn main() {

let mut cmd = Command::new("cargo");
cmd.args([
"+nightly",
"build",
"-Z",
"build-std=core",
Expand All @@ -203,8 +204,8 @@ fn main() {

cmd.env("CARGO_CFG_BPF_TARGET_ARCH", arch);

// Workaround to make sure that the rust-toolchain.toml is respected.
for key in ["RUSTUP_TOOLCHAIN", "RUSTC"] {
// Workaround to make sure that the correct toolchain is used.
for key in ["RUSTC", "RUSTC_WORKSPACE_WRAPPER"] {
cmd.env_remove(key);
}
cmd.current_dir(integration_ebpf_dir);
Expand Down

0 comments on commit fc37b43

Please sign in to comment.