From 916dba8790619ad3002ab489a32f44070e44152d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 18 Mar 2023 18:50:14 +0000 Subject: [PATCH] bpftools: 5.19.12 -> 6.2; sync with linuxHeaders bpftools used to use the same version and sources as linux_latest, but this was changed in f12d2f016b6 ("bpftools: decouple version from linux_latest"), because it caused too many rebuilds. Since then, it has languished. It came to my attention because bpftool btf dump seems to be completely broken on recent kernels. So, since it's a package that really needs to be kept up to date to be compatible with the latest kernels, let's couple it to linuxHeaders instead. linuxHeaders updates already have to go through staging, so we won't suffer from extra rebuilds like we did when it was coupled to the latest kernel directly, which goes straight to master. --- pkgs/os-specific/linux/bpftools/default.nix | 9 ++------- .../linux/bpftools/strip-binary-name.patch | 15 --------------- 2 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 pkgs/os-specific/linux/bpftools/strip-binary-name.patch diff --git a/pkgs/os-specific/linux/bpftools/default.nix b/pkgs/os-specific/linux/bpftools/default.nix index 287ad9d42264..ef89ae404063 100644 --- a/pkgs/os-specific/linux/bpftools/default.nix +++ b/pkgs/os-specific/linux/bpftools/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl +{ lib, stdenv, linuxHeaders , libopcodes, libopcodes_2_38 , libbfd, libbfd_2_38 , elfutils, readline @@ -8,15 +8,10 @@ stdenv.mkDerivation rec { pname = "bpftools"; - version = "5.19.12"; - src = fetchurl { - url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz"; - sha256 = "sha256-xDalSMcxLOb8WjRyy+rYle749ShB++fHH9jki9/isLo="; - }; + inherit (linuxHeaders) version src; patches = [ - ./strip-binary-name.patch # fix unknown type name '__vector128' on ppc64le ./include-asm-types-for-ppc64le.patch ]; diff --git a/pkgs/os-specific/linux/bpftools/strip-binary-name.patch b/pkgs/os-specific/linux/bpftools/strip-binary-name.patch deleted file mode 100644 index 623e90963bd9..000000000000 --- a/pkgs/os-specific/linux/bpftools/strip-binary-name.patch +++ /dev/null @@ -1,15 +0,0 @@ -Strip path to the binary from prints. - -I see no sense in including the full path in outputs like bpftool --version -Especially as argv[0] may not include it, based on calling via $PATH or not. ---- a/tools/bpf/bpftool/main.c -+++ b/tools/bpf/bpftool/main.c -@@ -443 +443,7 @@ -- bin_name = argv[0]; -+ /* Strip the path if any. */ -+ const char *bin_name_slash = strrchr(argv[0], '/'); -+ if (bin_name_slash) { -+ bin_name = bin_name_slash + 1; -+ } else { -+ bin_name = argv[0]; -+ }