From aaa20cc1fd06a4fe2b8012e02db2e54e98bf38c0 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Wed, 31 Aug 2022 16:57:10 +0000 Subject: [PATCH] aya-gen: Rename to aya-tool Signed-off-by: Dave Tucker --- Cargo.toml | 4 ++-- {aya-gen => aya-tool}/Cargo.toml | 2 +- aya-gen/src/bin/aya-gen.rs => aya-tool/src/bin/aya-tool.rs | 3 ++- {aya-gen => aya-tool}/src/bindgen.rs | 0 {aya-gen => aya-tool}/src/generate.rs | 0 {aya-gen => aya-tool}/src/lib.rs | 0 {aya-gen => aya-tool}/src/rustfmt.rs | 0 xtask/Cargo.toml | 2 +- xtask/src/codegen/aya.rs | 2 +- xtask/src/codegen/aya_bpf_bindings.rs | 4 ++-- 10 files changed, 9 insertions(+), 8 deletions(-) rename {aya-gen => aya-tool}/Cargo.toml (94%) rename aya-gen/src/bin/aya-gen.rs => aya-tool/src/bin/aya-tool.rs (91%) rename {aya-gen => aya-tool}/src/bindgen.rs (100%) rename {aya-gen => aya-tool}/src/generate.rs (100%) rename {aya-gen => aya-tool}/src/lib.rs (100%) rename {aya-gen => aya-tool}/src/rustfmt.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 07909562..81a5d761 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] members = [ - "aya", "aya-gen", "aya-log", "aya-log-common", "aya-log-parser", "test/integration-test", "test/integration-test-macros", "xtask", + "aya", "aya-tool", "aya-log", "aya-log-common", "aya-log-parser", "test/integration-test", "test/integration-test-macros", "xtask", # macros "aya-bpf-macros", "aya-log-ebpf-macros", # ebpf crates "bpf/aya-bpf", "bpf/aya-bpf-bindings", "bpf/aya-log-ebpf", "test/integration-ebpf" ] -default-members = ["aya", "aya-gen", "aya-log", "aya-bpf-macros", "aya-log-ebpf-macros"] +default-members = ["aya", "aya-tool", "aya-log", "aya-bpf-macros", "aya-log-ebpf-macros"] [profile.dev] panic = "abort" diff --git a/aya-gen/Cargo.toml b/aya-tool/Cargo.toml similarity index 94% rename from aya-gen/Cargo.toml rename to aya-tool/Cargo.toml index edede99b..5e4eb644 100644 --- a/aya-gen/Cargo.toml +++ b/aya-tool/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "aya-gen" +name = "aya-tool" version = "0.1.0" authors = ["Alessandro Decina "] edition = "2021" diff --git a/aya-gen/src/bin/aya-gen.rs b/aya-tool/src/bin/aya-tool.rs similarity index 91% rename from aya-gen/src/bin/aya-gen.rs rename to aya-tool/src/bin/aya-tool.rs index 5706f602..39b6a3ea 100644 --- a/aya-gen/src/bin/aya-gen.rs +++ b/aya-tool/src/bin/aya-tool.rs @@ -1,4 +1,4 @@ -use aya_gen::generate::{generate, InputFile}; +use aya_tool::generate::{generate, InputFile}; use std::{path::PathBuf, process::exit}; @@ -12,6 +12,7 @@ pub struct Options { #[derive(Parser)] enum Command { + /// Generate Rust bindings to Kernel types using bpftool #[clap(name = "generate", action)] Generate { #[clap(long, default_value = "/sys/kernel/btf/vmlinux", action)] diff --git a/aya-gen/src/bindgen.rs b/aya-tool/src/bindgen.rs similarity index 100% rename from aya-gen/src/bindgen.rs rename to aya-tool/src/bindgen.rs diff --git a/aya-gen/src/generate.rs b/aya-tool/src/generate.rs similarity index 100% rename from aya-gen/src/generate.rs rename to aya-tool/src/generate.rs diff --git a/aya-gen/src/lib.rs b/aya-tool/src/lib.rs similarity index 100% rename from aya-gen/src/lib.rs rename to aya-tool/src/lib.rs diff --git a/aya-gen/src/rustfmt.rs b/aya-tool/src/rustfmt.rs similarity index 100% rename from aya-gen/src/rustfmt.rs rename to aya-tool/src/rustfmt.rs diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index e7521249..136a1e26 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Alessandro Decina "] edition = "2021" [dependencies] -aya-gen = { path = "../aya-gen" } +aya-tool = { path = "../aya-tool" } clap = { version = "3", features = ["derive"] } anyhow = "1" syn = "1" diff --git a/xtask/src/codegen/aya.rs b/xtask/src/codegen/aya.rs index 4e7d0e9d..b4e6d104 100644 --- a/xtask/src/codegen/aya.rs +++ b/xtask/src/codegen/aya.rs @@ -1,7 +1,7 @@ use anyhow::anyhow; use std::path::PathBuf; -use aya_gen::{bindgen, write_to_file}; +use aya_tool::{bindgen, write_to_file}; use crate::codegen::{Architecture, Options}; diff --git a/xtask/src/codegen/aya_bpf_bindings.rs b/xtask/src/codegen/aya_bpf_bindings.rs index 6b984e8b..6fb75fd0 100644 --- a/xtask/src/codegen/aya_bpf_bindings.rs +++ b/xtask/src/codegen/aya_bpf_bindings.rs @@ -3,7 +3,7 @@ use proc_macro2::TokenStream; use quote::ToTokens; use std::path::PathBuf; -use aya_gen::{bindgen, write_to_file_fmt}; +use aya_tool::{bindgen, write_to_file_fmt}; use syn::{parse_str, Item}; use crate::codegen::{ @@ -17,7 +17,7 @@ pub fn codegen(opts: &Options) -> Result<(), anyhow::Error> { let builder = || { let mut bindgen = bindgen::bpf_builder() .header(&*dir.join("include/bindings.h").to_string_lossy()) - // aya-gen uses aya_bpf::cty. We can't use that here since aya-bpf + // aya-tool uses aya_bpf::cty. We can't use that here since aya-bpf // depends on aya-bpf-bindings so it would create a circular dep. .ctypes_prefix("::aya_bpf_cty") .clang_args(&[