Re: [PATCH 2/2] tools build feature: Don't set feature-libcap=1 if libcap-devel isn't available

From: Ian Rogers
Date: Wed Dec 11 2024 - 23:25:55 EST


On Wed, Dec 11, 2024 at 2:45 PM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> libcap isn't tested in the tools/build/feature/test-all.c fast path
> feature detection process, so don't set it as available if test-all
> manages to build.
>
> There are other users of this feature detection mechanism, and they
> explicitely ask for libcap to be tested, so are not affected by this
> patch, for instance, with this patch in place:
>
> $ make -C tools/bpf/bpftool/ clean
> <SNIP>
> make: Leaving directory '/home/acme/git/perf-tools-next/tools/bpf/bpftool'
> ⬢ [acme@toolbox perf-tools-next]$ make -C tools/bpf/bpftool/
> make: Entering directory '/home/acme/git/perf-tools-next/tools/bpf/bpftool'
>
> Auto-detecting system features:
> ... clang-bpf-co-re: [ on ]
> ... llvm: [ on ]
> ... libcap: [ on ]
> ... libbfd: [ on ]
> ... libelf-zstd: [ on ]
> <SNIP>
> LINK bpftool
> make: Leaving directory '/home/acme/git/perf-tools-next/tools/bpf/bpftool'
> $
> $ sudo rpm -e libcap-devel
> $ make -C tools/bpf/bpftool/
> <SNIP>
> make: Entering directory '/home/acme/git/perf-tools-next/tools/bpf/bpftool'
>
> Auto-detecting system features:
> ... clang-bpf-co-re: [ on ]
> ... llvm: [ on ]
> ... libcap: [ OFF ]
> ... libbfd: [ on ]
> ... libelf-zstd: [ on ]
>
> $
>
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: Ian Rogers <irogers@xxxxxxxxxx>
> Cc: James Clark <james.clark@xxxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Quentin Monnet <qmo@xxxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

Reviewed-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks,
Ian