Skip to content

Commit 0e24e68

Browse files
committed
Remove integration-ebp/rust-toolchain
Centralize the knowledge in build.rs instead.
1 parent 8d08ed7 commit 0e24e68

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

.github/workflows/ci.yml

+18-13
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- uses: dtolnay/rust-toolchain@master
25+
- uses: dtolnay/rust-toolchain@nightly
2626
with:
27-
toolchain: nightly
28-
components: rustfmt, clippy, miri, rust-src
27+
components: clippy,miri,rustfmt,rust-src
28+
29+
# Installed *after* nightly so it is the default.
30+
- uses: dtolnay/rust-toolchain@stable
2931

3032
- uses: Swatinem/rust-cache@v2
3133

@@ -43,7 +45,7 @@ jobs:
4345
run: taplo fmt --check
4446

4547
- name: Check formatting
46-
run: cargo fmt --all -- --check
48+
run: cargo +nightly fmt --all -- --check
4749

4850
- name: Run clippy
4951
run: ./clippy.sh
@@ -62,7 +64,7 @@ jobs:
6264
- name: Run miri
6365
run: |
6466
set -euxo pipefail
65-
cargo hack miri test --all-targets --feature-powerset \
67+
cargo +nightly hack miri test --all-targets --feature-powerset \
6668
--exclude aya-ebpf \
6769
--exclude aya-ebpf-bindings \
6870
--exclude aya-log-ebpf \
@@ -85,9 +87,7 @@ jobs:
8587
steps:
8688
- uses: actions/checkout@v4
8789

88-
- uses: dtolnay/rust-toolchain@master
89-
with:
90-
toolchain: stable
90+
- uses: dtolnay/rust-toolchain@stable
9191

9292
- uses: Swatinem/rust-cache@v2
9393

@@ -149,11 +149,13 @@ jobs:
149149
steps:
150150
- uses: actions/checkout@v4
151151

152-
- uses: dtolnay/rust-toolchain@master
152+
- uses: dtolnay/rust-toolchain@nightly
153153
with:
154-
toolchain: nightly
155154
components: rust-src
156155

156+
# Installed *after* nightly so it is the default.
157+
- uses: dtolnay/rust-toolchain@stable
158+
157159
- uses: Swatinem/rust-cache@v2
158160

159161
- name: bpf-linker
@@ -165,7 +167,7 @@ jobs:
165167
CARGO_CFG_BPF_TARGET_ARCH: ${{ matrix.bpf_target_arch }}
166168
run: |
167169
set -euxo pipefail
168-
cargo hack build \
170+
cargo +nightly hack build \
169171
--target ${{ matrix.target }} \
170172
-Z build-std=core \
171173
--package aya-ebpf \
@@ -239,10 +241,13 @@ jobs:
239241
echo $(brew --prefix)/opt/gnu-tar/libexec/gnubin >> $GITHUB_PATH
240242
echo $(brew --prefix)/opt/llvm/bin >> $GITHUB_PATH
241243
242-
- uses: dtolnay/rust-toolchain@master
244+
- uses: dtolnay/rust-toolchain@nightly
243245
with:
244-
toolchain: nightly
245246
components: rust-src
247+
248+
# Installed *after* nightly so it is the default.
249+
- uses: dtolnay/rust-toolchain@stable
250+
with:
246251
targets: aarch64-unknown-linux-musl,x86_64-unknown-linux-musl
247252

248253
- uses: Swatinem/rust-cache@v2

test/integration-ebpf/rust-toolchain.toml

-2
This file was deleted.

test/integration-test/build.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ fn main() {
191191

192192
let mut cmd = Command::new("cargo");
193193
cmd.args([
194+
"+nightly",
194195
"build",
195196
"-Z",
196197
"build-std=core",
@@ -203,8 +204,8 @@ fn main() {
203204

204205
cmd.env("CARGO_CFG_BPF_TARGET_ARCH", arch);
205206

206-
// Workaround to make sure that the rust-toolchain.toml is respected.
207-
for key in ["RUSTUP_TOOLCHAIN", "RUSTC"] {
207+
// Workaround to make sure that the correct toolchain is used.
208+
for key in ["RUSTC", "RUSTC_WORKSPACE_WRAPPER"] {
208209
cmd.env_remove(key);
209210
}
210211
cmd.current_dir(integration_ebpf_dir);

0 commit comments

Comments
 (0)