Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf-cargo: Remove SkeletonBuilder::debug() method #1061

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libbpf-cargo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Unreleased
----------
- Removed `SkeletonBuilder::skip_clang_version_check`
- Removed `SkeletonBuilder::skip_clang_version_check` and
`SkeletonBuilder::debug`
- Removed `--skip-clang-version-checks` option of `libbpf build`
sub-command
- Replaced `--debug` option of `libbpf` sub-command with `-v` /
Expand Down
11 changes: 0 additions & 11 deletions libbpf-cargo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ mod test;
///
/// SkeletonBuilder::new()
/// .source("myobject.bpf.c")
/// .debug(true)
/// .clang("/opt/clang/clang")
/// .build_and_generate("/output/path")
/// .unwrap();
/// ```
#[derive(Debug)]
pub struct SkeletonBuilder {
debug: bool,
source: Option<PathBuf>,
obj: Option<PathBuf>,
clang: Option<PathBuf>,
Expand All @@ -123,7 +121,6 @@ impl Default for SkeletonBuilder {
impl SkeletonBuilder {
pub fn new() -> Self {
SkeletonBuilder {
debug: false,
source: None,
obj: None,
clang: None,
Expand All @@ -149,14 +146,6 @@ impl SkeletonBuilder {
self
}

/// Turn debug output on or off
///
/// Default is off
pub fn debug(&mut self, debug: bool) -> &mut SkeletonBuilder {
self.debug = debug;
self
}

/// Specify which `clang` binary to use
///
/// Default searches `$PATH` for `clang`
Expand Down
5 changes: 0 additions & 5 deletions libbpf-cargo/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ fn test_skeleton_builder_basic() {
let skel = NamedTempFile::new().unwrap();
SkeletonBuilder::new()
.source(proj_dir.join("src/bpf/prog.bpf.c"))
.debug(true)
.build_and_generate(skel.path())
.unwrap();

Expand Down Expand Up @@ -770,15 +769,13 @@ fn test_skeleton_builder_clang_opts() {
// Should fail b/c `PURPOSE` not defined
SkeletonBuilder::new()
.source(proj_dir.join("src/bpf/prog.bpf.c"))
.debug(true)
.clang("clang")
.build_and_generate(skel.path())
.unwrap_err();

// Should succeed b/c we defined the macro
SkeletonBuilder::new()
.source(proj_dir.join("src/bpf/prog.bpf.c"))
.debug(true)
.clang("clang")
.clang_args(["-DPURPOSE=you_pass_the_butter"])
.build_and_generate(skel.path())
Expand Down Expand Up @@ -1084,7 +1081,6 @@ fn test_skeleton_builder_deterministic() {
let skel1 = NamedTempFile::new().unwrap();
SkeletonBuilder::new()
.source(proj_dir.join("src/bpf/prog.bpf.c"))
.debug(true)
.clang("clang")
.build_and_generate(skel1.path())
.unwrap();
Expand All @@ -1093,7 +1089,6 @@ fn test_skeleton_builder_deterministic() {
let skel2 = NamedTempFile::new().unwrap();
SkeletonBuilder::new()
.source(proj_dir.join("src/bpf/prog.bpf.c"))
.debug(true)
.clang("clang")
.build_and_generate(skel2.path())
.unwrap();
Expand Down
Loading