Skip to content

Commit fbf7bc6

Browse files
committed
examples: Pin Rust nightly to 2023-01-10
We need to wait for the following fixes in Rust nightly to be able to use the newest one: * rust-lang/rust#106796 * rust-lang/rust#106856 Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
1 parent b5dbd06 commit fbf7bc6

File tree

17 files changed

+58
-18
lines changed

17 files changed

+58
-18
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
- name: Install latest nightly
3030
uses: actions-rs/toolchain@v1
3131
with:
32-
toolchain: nightly
32+
toolchain: nightly-2023-01-10
3333
components: rust-src
3434

3535
- name: Install bpf-linker
36-
run: cargo +nightly install bpf-linker
36+
run: cargo install bpf-linker
3737

3838
- uses: Swatinem/rust-cache@v1
3939

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel="nightly"
2+
channel="nightly-2023-01-10"

examples/aya-tool/xtask/src/build_ebpf.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
4343
let dir = PathBuf::from("myapp-ebpf");
4444
let target = format!("--target={}", opts.target);
4545
let args = vec![
46-
"+nightly",
4746
"build",
4847
"--verbose",
4948
target.as_str(),
@@ -52,8 +51,14 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
5251
"--profile",
5352
opts.profile.as_str(),
5453
];
54+
55+
// Command::new creates a child process which inherits all env variables. This means env
56+
// vars set by the cargo xtask command are also inherited. RUSTUP_TOOLCHAIN is removed
57+
// so the rust-toolchain.toml file in the -ebpf folder is honored.
58+
5559
let status = Command::new("cargo")
5660
.current_dir(&dir)
61+
.env_remove("RUSTUP_TOOLCHAIN")
5762
.args(&args)
5863
.status()
5964
.expect("failed to build bpf program");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel="nightly"
2+
channel="nightly-2023-01-10"

examples/cgroup-skb-egress/xtask/src/build_ebpf.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
4444
let dir = PathBuf::from("cgroup-skb-egress-ebpf");
4545
let target = format!("--target={}", opts.target);
4646
let mut args = vec![
47-
"+nightly",
4847
"build",
4948
"--verbose",
5049
target.as_str(),
@@ -54,8 +53,14 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
5453
if opts.release {
5554
args.push("--release")
5655
}
56+
57+
// Command::new creates a child process which inherits all env variables. This means env
58+
// vars set by the cargo xtask command are also inherited. RUSTUP_TOOLCHAIN is removed
59+
// so the rust-toolchain.toml file in the -ebpf folder is honored.
60+
5761
let status = Command::new("cargo")
5862
.current_dir(&dir)
63+
.env_remove("RUSTUP_TOOLCHAIN")
5964
.args(&args)
6065
.status()
6166
.expect("failed to build bpf program");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel="nightly"
2+
channel="nightly-2023-01-10"

examples/kprobetcp/xtask/src/build_ebpf.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
4343
let dir = PathBuf::from("kprobetcp-ebpf");
4444
let target = format!("--target={}", opts.target);
4545
let mut args = vec![
46-
"+nightly",
4746
"build",
4847
"--verbose",
4948
target.as_str(),
@@ -53,8 +52,14 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
5352
if opts.release {
5453
args.push("--release")
5554
}
55+
56+
// Command::new creates a child process which inherits all env variables. This means env
57+
// vars set by the cargo xtask command are also inherited. RUSTUP_TOOLCHAIN is removed
58+
// so the rust-toolchain.toml file in the -ebpf folder is honored.
59+
5660
let status = Command::new("cargo")
5761
.current_dir(&dir)
62+
.env_remove("RUSTUP_TOOLCHAIN")
5863
.args(&args)
5964
.status()
6065
.expect("failed to build bpf program");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel="nightly"
2+
channel="nightly-2023-01-10"

examples/lsm-nice/xtask/src/build_ebpf.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
4343
let dir = PathBuf::from("lsm-nice-ebpf");
4444
let target = format!("--target={}", opts.target);
4545
let args = vec![
46-
"+nightly",
4746
"build",
4847
"--verbose",
4948
target.as_str(),
@@ -52,8 +51,14 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
5251
"--profile",
5352
opts.profile.as_str(),
5453
];
54+
55+
// Command::new creates a child process which inherits all env variables. This means env
56+
// vars set by the cargo xtask command are also inherited. RUSTUP_TOOLCHAIN is removed
57+
// so the rust-toolchain.toml file in the -ebpf folder is honored.
58+
5559
let status = Command::new("cargo")
5660
.current_dir(&dir)
61+
.env_remove("RUSTUP_TOOLCHAIN")
5762
.args(&args)
5863
.status()
5964
.expect("failed to build bpf program");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel="nightly"
2+
channel="nightly-2023-01-10"

0 commit comments

Comments
 (0)