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

Narrow libbcc dependency from llvm-dev to just libllvm #4997

Closed
wants to merge 1 commit into from

Conversation

bobrik
Copy link
Contributor

@bobrik bobrik commented May 9, 2024

It works with list libllvm, so no need to pull in the whole thing, which is 600MiB worth of packages.

It works with list libllvm, so no need to pull in the whole thing,
which is 600MiB worth of packages.
@bobrik
Copy link
Contributor Author

bobrik commented May 9, 2024

@shunghsiyu, what exactly broke for you prior to #4921?

@bobrik bobrik marked this pull request as draft May 9, 2024 18:29
@shunghsiyu
Copy link
Contributor

shunghsiyu commented May 20, 2024

It works with list libllvm, so no need to pull in the whole thing, which is 600MiB worth of packages.
@shunghsiyu, what exactly broke for you prior to #4921?

The problem for me is that using bcc header files (packaged as bcc-devel on RPM systems) requires llvm-devel to be on installed as well since 6f11bf7, otherwise compilation will fail. This is not a theoretical issue but an actual one that we saw with Sysinternals/ProcMon-for-Linux.

debian/control does not have a separate package to host the bcc header files so I ended up placing such requirement on the main bcc package, which is admittedly not ideal.

@shunghsiyu
Copy link
Contributor

shunghsiyu commented May 20, 2024

From a packaging point of view I'd much prefer we revert 6f11bf7 to keep the dependency at a minimum.

That said I only know two users of bcc-devel: one is Sysinternals/ProcMon-for-Linux mentioned above, and the other is bpftrace/bpftrace. bpftrace already pulls llvm-devel itself anyway, while ProcMon-for-Linux doesn't get packaged everywhere; so this is perhaps a bit of bikeshedding.

@chantra what do you think?

@chantra
Copy link
Contributor

chantra commented May 20, 2024 via email

@chantra
Copy link
Contributor

chantra commented May 20, 2024

If bcc-devel requires llvm-devel, I suppose the problem is because we pull llvm-config.h in bcc_module.h which is public? Moving llvm-config.h to private only headers should do the job.

Can you list the public headers and we can work on moving this include out of the way.

@shunghsiyu
Copy link
Contributor

For packaging, this should only be a build dependency right

Not sure about Debian, but on the RPM side, even though llvm-devel is a build-time dependency for ProcMon-for-Linux, it should be listed as a runtime dependency for bcc-devel to get it transitively installed; otherwise llvm-devel do not get installed along with bcc-devel.

The follow graph depicts the dependency chain:

ProMon (build-time dependency with "BuildRequires: bcc-devel") --> bcc-devel (runtime dependency with "Requires: llvm-devel") --> llvm-devel

@shunghsiyu
Copy link
Contributor

If bcc-devel requires llvm-devel, I suppose the problem is because we pull llvm-config.h in bcc_module.h which is public? Moving llvm-config.h to private only headers should do the job.

I think that will work

Can you list the public headers and we can work on moving this include out of the way.

The public headers I founds are:

  • BPF.h
  • BPFTable.h
  • bcc_common.h
  • bcc_elf.h
  • bcc_exception.h
  • bcc_proc.h
  • bcc_syms.h
  • bcc_usdt.h
  • bcc_version.h
  • bpf_module.h
  • file_desc.h
  • libbpf.h
  • perf_reader.h
  • table_desc.h
  • table_storage.h

So bpf_module.h should be the one that need modification.

chantra added a commit to chantra/bcc that referenced this pull request May 29, 2024
In iovisor#4737 I added depedency on llvm-config.h in order to discover what LLVM version
is being used. This was only meant to be used at build time.
By adding llvm-config.h in bpf_module.h, a public header of libbcc, I introduced
a dependency on llvm-dev to libbcc which is unnecessary.

This change removes the include from `bpf_module.h`, which should be enough.

It does not seem I need to add the include in any other files.

Fixes iovisor#4997

Signed-off-by: Manu Bretelle <chantr4@gmail.com>
chantra added a commit to chantra/bcc that referenced this pull request May 29, 2024
In iovisor#4737 I added depedency on llvm-config.h in order to discover what LLVM version
is being used. This was only meant to be used at build time.
By adding llvm-config.h in bpf_module.h, a public header of libbcc, I introduced
a dependency on llvm-dev to libbcc which is unnecessary.

This change removes the include from `bpf_module.h`, which should be enough.

It does not seem I need to add the include in any other files.

Fixes iovisor#4997

Signed-off-by: Manu Bretelle <chantr4@gmail.com>
chantra added a commit to chantra/bcc that referenced this pull request May 29, 2024
In iovisor#4737 I added depedency on llvm-config.h in order to discover what LLVM version
is being used. This was only meant to be used at build time.
By adding llvm-config.h in bpf_module.h, a public header of libbcc, I introduced
a dependency on llvm-dev to libbcc which is unnecessary.

This change removes the include from `bpf_module.h`, which should be enough, and
add it to `bpf_module.cc` instead.

Fixes iovisor#4997

Signed-off-by: Manu Bretelle <chantr4@gmail.com>
@chantra
Copy link
Contributor

chantra commented May 29, 2024

#5018 should fix this issue. @shunghsiyu could you confirm the package change are fine? cc @yonghong-song

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants