summary refs log tree commit diff
path: root/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2019-05-03 01:16:37 -0500
committerAustin Seipp <aseipp@pobox.com>2019-05-03 11:32:58 -0500
commit241063ca84811cd4bf6be1274cfd3f57413f6297 (patch)
tree05e29461155fd6dd8e11ba075714a8bb804da173 /pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch
parent0d2b66dff20609e9d8888558def28a173aa85099 (diff)
downloadnixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.tar
nixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.tar.gz
nixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.tar.bz2
nixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.tar.lz
nixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.tar.xz
nixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.tar.zst
nixpkgs-241063ca84811cd4bf6be1274cfd3f57413f6297.zip
bpftrace: unstable-2018-10-27 -> 0.9
Update bpftrace to the latest pre-release, with a real version number.

The most notable change now is that bpftrace can use a stable version of
the 'bcc' toolchain in order to build, meaning no more hacks are needed
to clone the source code and fix up the build system, etc. This
simplifies things greatly and removes the old bcc-source patch.

Similarly, we can remove our custom gtests patch (which disabled the
build) by just passing -DBUILD_TESTING=FALSE when running cmake. This
was also added upstream recently.

However, something does still need to be fixed, at a cost: bpftrace
requires the kernel -dev package because it wants both objects and
include directories (some files are only shipped in one or the other).
Therefore, we remove the dependency on linuxHeaders and instead use
kernel.dev as the sole input to the build.

This is both a positive and a negative: the positive is that tools work
without annoying fatal errors, and that the bpf toolchain is
synchronized to the linuxPackages.kernel derivation it was built
against. The downside is that the .dev expression is much heavier as a
dependency, so bpftrace is now closer to 700mb in closure size. (This
especially hurts across kernel upgrades requiring a whole new rebuild,
especially if you have existing nixos generations that won't GC, etc.)

We probably want to slim this down substantially in the future (and
there may be a few ways to do that), but as this will probably also
touch bcc, and as a first cut of the pre-releases, this is probably fine
while we work out other kinks.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch')
-rw-r--r--pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch b/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch
new file mode 100644
index 00000000000..0c6ffc471ad
--- /dev/null
+++ b/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch
@@ -0,0 +1,22 @@
+commit b6172952c0150d84912fa6f09bab782dd0549f1e
+Author: Austin Seipp <aseipp@pobox.com>
+Date:   Fri May 3 00:47:12 2019 -0500
+
+    src: special case nix build directories for clang
+    
+    Signed-off-by: Austin Seipp <aseipp@pobox.com>
+
+diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp
+index b1db8ff..0cfb01f 100644
+--- a/src/clang_parser.cpp
++++ b/src/clang_parser.cpp
+@@ -140,6 +140,9 @@ static bool is_dir(const std::string& path)
+ // Both ksrc and kobj are guaranteed to be != "", if at least some trace of kernel sources was found.
+ static std::tuple<std::string, std::string> get_kernel_dirs(const struct utsname& utsname)
+ {
++  // NB (aseipp): special case the kernel directory for nix
++  return { "@NIX_KERNEL_SRC@/source", "@NIX_KERNEL_SRC@/build" };
++
+ #ifdef KERNEL_HEADERS_DIR
+   return {KERNEL_HEADERS_DIR, KERNEL_HEADERS_DIR};
+ #endif