Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 952001 - >=dev-debug/bpftrace-0.23: will require new library blazesym
Summary: >=dev-debug/bpftrace-0.23: will require new library blazesym
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Holger Hoffstätte
URL: https://github.com/bpftrace/bpftrace/...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2025-03-24 19:19 UTC by Holger Hoffstätte
Modified: 2025-03-27 11:49 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Hoffstätte 2025-03-24 19:19:42 UTC
The dependency on bcc is being retired, though my understanding is that the initial release of bpftrace-0.23 will still be able to use it as fallback (see $URL). The replacement will be a new Rust-based library by Meta: https://github.com/libbpf/blazesym/

I made an initial prototype ebuild here:
https://github.com/hhoffstaette/gentoo/tree/blazesym/dev-libs/blazesym-capi

It builds and installs, albeit manually-ish for now. For some reason using cargo-c did not work at all (build aborts immediately). A pkgconfig .pc file would be nice, as would be proper major.minor soname (missing upstream).

Hopefully the ebuild can act as starting point. Naming & versioning are open to change, I will open upstream bugs about those since it's not clear whether the version of the ebuild/library should be the blazesym part or the C API, both of which have different crate versions.


Reproducible: Always

Steps to Reproduce:
1. build bpftrace-0.23 once it's out
2. blazesym is missing
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-25 04:07:35 UTC
Note that in https://github.com/hhoffstaette/gentoo/commit/1d2efd2a2e60e95aca0c72023d1e8e1e492526f6, you didn't have the src_install bit at least (using raw cargo_src_install won't work, need the cargo-c magic again, see examples in-tree).
Comment 2 Holger Hoffstätte 2025-03-25 08:34:52 UTC
(In reply to Sam James from comment #1)
> Note that in
> https://github.com/hhoffstaette/gentoo/commit/
> 1d2efd2a2e60e95aca0c72023d1e8e1e492526f6, you didn't have the src_install
> bit at least (using raw cargo_src_install won't work, need the cargo-c magic
> again, see examples in-tree).

Thanks for looking - the latest version has a manual src_install that seems to work (gross, but..)

I got further with using cargo-c's cbuild command (added the missing feature), but it seems it will not work since blazesym currently uses a hacked version of cbindgen, which cargo-c does not know about and then fails to read the cbindgen config file. At least I think that's what happening, I'll file a bug in cargo-c for clarification and link here.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-25 08:39:07 UTC
Ah, thanks (and gross)...
Comment 4 Holger Hoffstätte 2025-03-25 15:37:50 UTC
New ebuild with upstream- and artifact-consistent name at:
https://github.com/hhoffstaette/gentoo/tree/blazesym/dev-libs/blazesym_c

Now adds cargo-c awareness to blazesym and uses cargo-c, which in turn generates a proper .so, a valid pkgconfig, .so symlinks AND does your laundry.
Comment 5 Holger Hoffstätte 2025-03-25 16:26:54 UTC
And just in time: initial bpftrace-0.23.0 at

https://github.com/hhoffstaette/gentoo/tree/bpftrace-update/dev-debug/bpftrace

Mostly lldb removal and a new dependency on cereal. Feel free to steal.
No blazesym yet, will look at that next.
Comment 6 Holger Hoffstätte 2025-03-25 17:50:22 UTC
The current bpftrace-0.23 ebuild picks up blazesym automagically when it is installed (no dependency yet), and the result works fine:

$ldd /usr/bin/bpftrace
...
	libblazesym_c.so.0.1 => /usr/lib64/libblazesym_c.so.0.1 (0x00007f4e99ca1000)
...

$bpftrace -e "tracepoint:raw_syscalls:sys_enter /pid == $(pidof firefox)/ { @[comm] = count(); }"
Attaching 1 probe...
^C

@[ImageIO]: 4
@[TaskCon~ller #1]: 4
@[sqldb:c~lite #5]: 4
@[FSBroker1597]: 6
@[sqldb:p~lite #4]: 9
@[DNS Res~ver #17]: 10
@[AudioIP~ver RPC]: 10
..etc..

\o/
Comment 7 Holger Hoffstätte 2025-03-25 20:19:04 UTC
I'm trying to get a GH-hosted crate tarball going and will then make a PR.
Right now I'm hosting that on my personal server, which is a bit awkward.

Patrick, Yichun: is it OK if I add you also to dev-libs/blazesym_c metadata.xml, just like with bpftrace?
Comment 8 Yixun Lan archtester gentoo-dev 2025-03-25 21:25:47 UTC
(In reply to Holger Hoffstätte from comment #7)
> Patrick, Yichun: is it OK if I add you also to dev-libs/blazesym_c
> metadata.xml, just like with bpftrace?

fine by me if you want to keep me posted (TBO I've not spent much time on BPF),
so thanks for taking care of it
Comment 9 Larry the Git Cow gentoo-dev 2025-03-27 11:49:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff14aaada5967ae3479093287cb48b2b0cbe5725

commit ff14aaada5967ae3479093287cb48b2b0cbe5725
Author:     Holger Hoffstätte <holger@applied-asynchrony.com>
AuthorDate: 2025-03-26 18:50:25 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-03-27 11:48:08 +0000

    dev-debug/bpftrace: add 0.23.0
    
    This release preemptively drops support for USE=lldb, which has been
    removed upstream. It also adopts blazesym for address symbolization
    and adds support for LLVM-20.
    
    Closes: https://bugs.gentoo.org/952001
    Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
    Closes: https://github.com/gentoo/gentoo/pull/41312
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-debug/bpftrace/Manifest               |   2 +
 dev-debug/bpftrace/bpftrace-0.23.0.ebuild | 109 ++++++++++++++++++++++++++++++
 2 files changed, 111 insertions(+)