Skip to content

Commit

Permalink
sdk: Fix args after "--" in build-bpf and test-bpf (backport #27221) (#…
Browse files Browse the repository at this point in the history
…27225)

sdk: Fix args after "--" in build-bpf and test-bpf (#27221)

(cherry picked from commit 68a5e05)

Co-authored-by: Jon Cinque <[email protected]>
  • Loading branch information
mergify[bot] and joncinque authored Aug 18, 2022
1 parent ae7a76c commit 1123d58
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sdk/cargo-build-bpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ fn main() {
args.remove(0);
}
}
args.push("--arch".to_string());
args.push("bpf".to_string());
let index = args.iter().position(|x| x == "--").unwrap_or(args.len());
args.insert(index, "bpf".to_string());
args.insert(index, "--arch".to_string());
print!("cargo-build-bpf child: {}", program.display());
for a in &args {
print!(" {}", a);
Expand Down
5 changes: 3 additions & 2 deletions sdk/cargo-test-bpf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ fn main() {
args.remove(0);
}
}
args.push("--arch".to_string());
args.push("bpf".to_string());
let index = args.iter().position(|x| x == "--").unwrap_or(args.len());
args.insert(index, "bpf".to_string());
args.insert(index, "--arch".to_string());
print!("cargo-test-bpf child: {}", program.display());
for a in &args {
print!(" {}", a);
Expand Down

0 comments on commit 1123d58

Please sign in to comment.