commit: 6afce571746629ed531f18ca10f786244cb5b3ae Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com> AuthorDate: Fri Dec 12 10:21:17 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Dec 12 13:20:34 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6afce571
dev-debug/bpftrace: add 0.24.2 Minor update with a handful of bug fixes in the stable 0.24.x branch. Also address some qa-vdb issues. Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com> Part-of: https://github.com/gentoo/gentoo/pull/44996 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-debug/bpftrace/Manifest | 2 + dev-debug/bpftrace/bpftrace-0.24.2.ebuild | 159 ++++++++++++++++++++++++++++++ 2 files changed, 161 insertions(+) diff --git a/dev-debug/bpftrace/Manifest b/dev-debug/bpftrace/Manifest index ca84831519ac..bcf2b9a8f27e 100644 --- a/dev-debug/bpftrace/Manifest +++ b/dev-debug/bpftrace/Manifest @@ -8,3 +8,5 @@ DIST bpftrace-0.23.5-man.tar.xz 76020 BLAKE2B aa6023a1c9f3e2b3f42b8d7ac78f3bc891 DIST bpftrace-0.23.5.tar.gz 1172407 BLAKE2B b5e9cff1dee01cc33f150cccf28ee4b1d671cf16b92854a7debac97e0378cef28f31e5093f840978667a1da6f5686e7ca10feb1e152b053155b68ec44c3d58c3 SHA512 1e040bce7636da4e2ebeffc1c8fc3944feb26ef2c371ff287b323123ef89b839fbaa492a61e8164efedc7579e73aebc489f168ecad903f3cac6144d8bbc4b6f1 DIST bpftrace-0.24.1-man.tar.xz 43808 BLAKE2B f5d49b29e300e37444d134b8e9530c17294dfd47aaf7810bfaaf411cc9795a57450a64de6e8d4803e71d236523b81dff285868aa3b63b30d883507a12c1ec93c SHA512 a9618aa2cb3013448cb0af20a807238dc3e0cd0e6fa3f867bc7156ecb274782b81d87c14315430d939c9eac8ec65f8d6a3f9671cd49bf52b37c576cd56c11064 DIST bpftrace-0.24.1.tar.gz 1522448 BLAKE2B 840220497bb4312391231e5471c1f8fa36151a4b5993e6cd67287967054c0b03f882e8da1e64e628f58f04d795c1f70b4877ef5cb1ff12819253303ffb2459b9 SHA512 97ce3d909c6d6fe021afc6db4ea67dd70fa85502358ee89314d8cf58cb8727ce091bbbdf23f73d9eaadae59d8244d76530dda89993b499deebe7f90edd21cda7 +DIST bpftrace-0.24.2-man.tar.xz 43820 BLAKE2B b0964633f4c1a462874f20934c286c321307a4abf79ebebaf085396e545a119f39f46f35b597921a61a5707a6cad5b368788ca8db682dee0eb916fc8a65b5520 SHA512 5a64c875400ede0050ee13f00351e06f72aeb8d8ce0db6933ac9c9f93023388218dd5fd62db7fd24370ddadbe390c6efa71692afd2e55b7f5755e4816f4832eb +DIST bpftrace-0.24.2.tar.gz 1375106 BLAKE2B c397eb7ded3a72ea0805487db66f422bda9a0a743b1757056dc1bc70119e2d4fa7e69577a7e295143ce2b9789c62c4469b995ac0dca228c464efb3db8da25eeb SHA512 d9ff773ce39b578877d5e73a48434d3654b46985bb4b9ad458fbf622718049da5075b3a2d2e6d1ae0a9effbdb74658822b4c4535bca384fbd6e539fdec393f4b diff --git a/dev-debug/bpftrace/bpftrace-0.24.2.ebuild b/dev-debug/bpftrace/bpftrace-0.24.2.ebuild new file mode 100644 index 000000000000..7bb505c72208 --- /dev/null +++ b/dev-debug/bpftrace/bpftrace-0.24.2.ebuild @@ -0,0 +1,159 @@ +# Copyright 2019-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( {17..21} ) +RUST_MIN_VER="1.85.1" +RUST_OPTIONAL=1 + +inherit cmake flag-o-matic linux-info llvm-r1 rust + +DESCRIPTION="High-level tracing language for eBPF" +HOMEPAGE="https://github.com/bpftrace/bpftrace" +MY_PV="${PV//_/}" + +if [[ ${PV} == *9999* ]] ; then + EGIT_REPO_URI="https://github.com/bpftrace/bpftrace" + EGIT_BRANCH="release/0.24.x" + inherit git-r3 + # use a released man page for git + MAN_V="0.24.2" +else + SRC_URI="https://github.com/bpftrace/${PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm64" + # the man page version may trail the release + #MAN_V="0.24.2" +fi + +SRC_URI+=" https://github.com/bpftrace/${PN}/releases/download/v${MAN_V:-${PV}}/man.tar.xz -> ${PN}-${MAN_V:-${PV}}-man.tar.xz" + +S="${WORKDIR}/${PN}-${MY_PV:-${PV}}" + +LICENSE="Apache-2.0" +SLOT="0" + +IUSE="pcap systemd test" + +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-libs/blazesym_c-0.1.1 + >=dev-libs/libbpf-1.5:= + >=dev-util/bcc-0.25.0 + $(llvm_gen_dep ' + llvm-core/clang:${LLVM_SLOT}= + llvm-core/llvm:${LLVM_SLOT}=[llvm_targets_BPF(+)] + ') + sys-libs/binutils-libs:= + virtual/libelf:= + systemd? ( sys-apps/systemd:= ) + pcap? ( net-libs/libpcap:= ) + virtual/zlib:= +" +DEPEND=" + ${RDEPEND} + dev-libs/cereal:= + test? ( dev-cpp/gtest ) +" +BDEPEND=" + app-arch/xz-utils + app-alternatives/lex + app-alternatives/yacc + dev-libs/cereal + dev-util/bpftool + || ( dev-util/xxd app-editors/vim-core ) + test? ( + ${RUST_DEPEND} + dev-lang/go + dev-util/pahole + ) + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}/bpftrace-0.11.4-old-kernels.patch" + "${FILESDIR}/bpftrace-0.21.0-dont-compress-man.patch" + "${FILESDIR}/bpftrace-0.24.1-enable-ubsan.patch" +) + +pkg_pretend() { + local CONFIG_CHECK=" + ~BPF + ~BPF_EVENTS + ~BPF_JIT + ~BPF_SYSCALL + ~DEBUG_INFO_BTF + ~DEBUG_INFO_BTF_MODULES + ~FTRACE_SYSCALLS + ~HAVE_EBPF_JIT + " + + check_extra_config + + if use test; then + if ! linux_config_exists ; then + die "Unable to check your kernel for BTF support: tests cannot run." + elif ! linux_chkconfig_present DEBUG_INFO_BTF ; then + die "CONFIG_DEBUG_INFO_BTF is not set: tests cannot run." + fi + fi +} + +pkg_setup() { + llvm-r1_pkg_setup + use test && rust_pkg_setup +} + +# git-r3 overrides automatic SRC_URI unpacking +src_unpack() { + default + + if [[ ${PV} == *9999* ]] ; then + git-r3_src_unpack + fi +} + +src_prepare() { + # create a usable version from git + if [[ ${PV} == *9999* ]] ; then + local rev=$(git branch --show-current | sed -e 's/* //g' -e 's/release\///g')-$(git rev-parse --short HEAD) + sed -i "/configure_file/i set (BPFTRACE_VERSION \"${rev}\")" cmake/Version.cmake || die + fi + + cmake_src_prepare +} + +src_configure() { + # suppress one remaining and benign ODR violation warning due to + # a generated libbpf header used by the tests, see: + # https://github.com/bpftrace/bpftrace/issues/4591 + use test && append-flags -Wno-odr + + local mycmakeargs=( + # DO dynamically link the bpftrace executable + -DSTATIC_LINKING=OFF + # DO NOT build the internal libs as shared + -DBUILD_SHARED_LIBS=OFF + -DBUILD_TESTING=$(usex test) + # we use the pregenerated man page + -DENABLE_MAN=OFF + -DENABLE_SKB_OUTPUT=$(usex pcap) + -DENABLE_SYSTEMD=$(usex systemd) + ) + + # enable UBSAN only when enabled in the toolchain + if is-flagq -fsanitize=undefined; then + filter-flags -fsanitize=undefined + mycmakeargs+=( -DBUILD_UBSAN=ON ) + fi + + cmake_src_configure +} + +src_install() { + cmake_src_install + doman man/man8/*.? + gunzip "${WORKDIR}/man/man8/bpftrace.8.gz" || die + doman "${WORKDIR}/man/man8/bpftrace.8" +}
