diff --git a/xtask/src/build_ebpf.rs b/xtask/src/build_ebpf.rs index 9b9e56d5..efbc4f29 100644 --- a/xtask/src/build_ebpf.rs +++ b/xtask/src/build_ebpf.rs @@ -37,7 +37,7 @@ impl std::fmt::Display for Architecture { } #[derive(Debug, Parser)] -pub struct Options { +pub struct BuildEbpfOptions { /// Set the endianness of the BPF target #[clap(default_value = "bpfel-unknown-none", long)] pub target: Architecture, @@ -49,12 +49,12 @@ pub struct Options { pub libbpf_dir: PathBuf, } -pub fn build_ebpf(opts: Options) -> anyhow::Result<()> { +pub fn build_ebpf(opts: BuildEbpfOptions) -> anyhow::Result<()> { build_rust_ebpf(&opts)?; build_c_ebpf(&opts) } -fn build_rust_ebpf(opts: &Options) -> anyhow::Result<()> { +fn build_rust_ebpf(opts: &BuildEbpfOptions) -> anyhow::Result<()> { let mut dir = PathBuf::from(WORKSPACE_ROOT.to_string()); dir.push("test/integration-ebpf"); @@ -92,7 +92,7 @@ fn get_libbpf_headers>(libbpf_dir: P, include_path: P) -> anyhow: Ok(()) } -fn build_c_ebpf(opts: &Options) -> anyhow::Result<()> { +fn build_c_ebpf(opts: &BuildEbpfOptions) -> anyhow::Result<()> { let mut src = PathBuf::from(WORKSPACE_ROOT.to_string()); src.push("test/integration-ebpf/src/bpf"); diff --git a/xtask/src/build_test.rs b/xtask/src/build_test.rs index f2cf91b1..5d727ac0 100644 --- a/xtask/src/build_test.rs +++ b/xtask/src/build_test.rs @@ -10,7 +10,7 @@ pub struct Options { pub musl: bool, #[clap(flatten)] - pub ebpf_options: build_ebpf::Options, + pub ebpf_options: build_ebpf::BuildEbpfOptions, } pub fn build_test(opts: Options) -> anyhow::Result<()> { diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 5cf9574c..90eb6ecc 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -9,7 +9,7 @@ use std::process::exit; use clap::Parser; #[derive(Parser)] -pub struct Options { +pub struct XtaskOptions { #[clap(subcommand)] command: Command, } @@ -19,12 +19,12 @@ enum Command { Codegen(codegen::Options), Docs, BuildIntegrationTest(build_test::Options), - BuildIntegrationTestEbpf(build_ebpf::Options), + BuildIntegrationTestEbpf(build_ebpf::BuildEbpfOptions), IntegrationTest(run::Options), } fn main() { - let opts = Options::parse(); + let opts = XtaskOptions::parse(); use Command::*; let ret = match opts.command { diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 13f61f31..7d01ccff 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -3,7 +3,7 @@ use std::{os::unix::process::CommandExt, path::PathBuf, process::Command}; use anyhow::Context as _; use clap::Parser; -use crate::build_ebpf::{build_ebpf, Architecture, Options as BuildOptions}; +use crate::build_ebpf::{build_ebpf, Architecture, BuildEbpfOptions as BuildOptions}; #[derive(Debug, Parser)] pub struct Options {