Unverified Commit 184dfbc8 authored by Dominique Martinet's avatar Dominique Martinet Committed by GitHub
Browse files

bcc: 0.26.0 -> 0.28.0 (#240520)

* bcc: 0.26.0 -> 0.28.0

update now calls setuptool through cmake which installs an egg file,
this apparently requires setting a PYTHONPATH which includes the
output dir to work.

While here, make it clear we only support python3 as 'python' in
nixpkgs is still python2 even if it's no longer usable...

* bcc/bpftrace: use llvm 16
parent 87dfa279
Loading
Loading
Loading
Loading
+35 −10
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub
, makeWrapper, cmake, llvmPackages
, flex, bison, elfutils, python, luajit, netperf, iperf, libelf
, bash, libbpf, nixosTests
, audit
{ audit
, bash
, bison
, cmake
, elfutils
, fetchFromGitHub
, flex
, iperf
, lib
, libbpf
, llvmPackages
, luajit
, makeWrapper
, netperf
, nixosTests
, python3
, stdenv
, zip
}:

python.pkgs.buildPythonApplication rec {
python3.pkgs.buildPythonApplication rec {
  pname = "bcc";
  version = "0.26.0";
  version = "0.28.0";

  disabled = !stdenv.isLinux;

@@ -15,7 +28,7 @@ python.pkgs.buildPythonApplication rec {
    owner = "iovisor";
    repo = "bcc";
    rev = "v${version}";
    sha256 = "sha256-zx38tPwuuGU6px9pRNN5JtvBysK9fStOvoqe7cLo7LM=";
    sha256 = "sha256-+ecSaVroDC2bWbio4JsuwEvHQdCMpxLt7hIkeREMJs8=";
  };
  format = "other";

@@ -31,8 +44,16 @@ python.pkgs.buildPythonApplication rec {
    ./fix-deadlock-detector-import.patch
  ];

  propagatedBuildInputs = [ python.pkgs.netaddr ];
  nativeBuildInputs = [ makeWrapper cmake flex bison llvmPackages.llvm.dev ];
  propagatedBuildInputs = [ python3.pkgs.netaddr ];
  nativeBuildInputs = [
    bison
    cmake
    flex
    llvmPackages.llvm.dev
    makeWrapper
    python3.pkgs.setuptools
    zip
  ];

  cmakeFlags = [
    "-DBCC_KERNEL_MODULES_DIR=/run/booted-system/kernel-modules/lib/modules"
@@ -59,6 +80,10 @@ python.pkgs.buildPythonApplication rec {
      --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
  '';

  preInstall = ''
    # required for setuptool during install
    export PYTHONPATH=$out/${python3.sitePackages}:$PYTHONPATH
  '';
  postInstall = ''
    mkdir -p $out/bin $out/share
    rm -r $out/share/bcc/tools/old
+2 −3
Original line number Diff line number Diff line
@@ -18474,12 +18474,11 @@ with pkgs;
  bpftools = callPackage ../os-specific/linux/bpftools { };
  bcc = callPackage ../os-specific/linux/bcc {
    python = python3;
    llvmPackages = llvmPackages_14;
    llvmPackages = llvmPackages_16;
  };
  bpftrace = callPackage ../os-specific/linux/bpftrace {
    llvmPackages = llvmPackages_14;
    llvmPackages = llvmPackages_16;
  };
  bpm-tools = callPackage ../tools/audio/bpm-tools { };