diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 632f9d0..5047c77 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: - uses: dtolnay/rust-toolchain@nightly with: - components: rust-src,rustfmt + components: rustfmt,rust-src - uses: dtolnay/rust-toolchain@master if: runner.os == 'macOS' && runner.arch == 'X64' diff --git a/{{project-name}}-ebpf/rust-toolchain.toml b/{{project-name}}-ebpf/rust-toolchain.toml deleted file mode 100644 index f70d225..0000000 --- a/{{project-name}}-ebpf/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "nightly" -components = ["rust-src"] diff --git a/{{project-name}}/build.rs b/{{project-name}}/build.rs index fa41cc9..b4cdfd8 100644 --- a/{{project-name}}/build.rs +++ b/{{project-name}}/build.rs @@ -59,6 +59,7 @@ fn main() { let mut cmd = Command::new("cargo"); cmd.args([ + "+nightly", "build", "-Z", "build-std=core", @@ -71,10 +72,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", "RUSTC_WORKSPACE_WRAPPER"] { - cmd.env_remove(key); - } + // Workaround to make sure that the correct toolchain is used. + cmd.env_remove("RUSTC_WORKSPACE_WRAPPER"); cmd.current_dir(ebpf_dir); // Workaround for https://github.com/rust-lang/cargo/issues/6412 where cargo flocks itself.