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 bdd4817 commit 52277ce
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
33 changes: 20 additions & 13 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,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

Expand Down Expand Up @@ -157,11 +159,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 @@ -173,7 +177,7 @@ jobs:
CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.bpf_target_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 @@ -247,10 +251,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 52277ce

Please sign in to comment.