Unverified Commit 8001332b authored by Philip Taron's avatar Philip Taron Committed by GitHub
Browse files

prevail: rename from ebpf-verifier; unstable-2023-07-15 -> 0.2.0 (#505643)

parents 01e91702 cf18e132
Loading
Loading
Loading
Loading
+28 −12
Original line number Diff line number Diff line
@@ -4,28 +4,30 @@
  fetchFromGitHub,
  boost,
  cmake,
  catch2,
  catch2_3,
  microsoft-gsl,
  pkg-config,
  replaceVars,
  yaml-cpp,
}:

stdenv.mkDerivation {
  pname = "ebpf-verifier";
  version = "unstable-2023-07-15";
stdenv.mkDerivation (finalAttrs: {
  pname = "prevail";
  version = "0.2.0";

  src = fetchFromGitHub {
    owner = "vbpf";
    repo = "ebpf-verifier";
    rev = "de14d3aa3cd2845b621faf32b599766a66e158cf";
    repo = "prevail";
    rev = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-gnxB8ZLbTyIYpd61T57LPKFm1MHufeVEq/qN9pu2Vpk=";
    hash = "sha256-qlQSoz9GE2Z2rzmrPIj+HnIQmNxiBSgvR40FR9psuDc=";
  };

  patches = [
    (replaceVars ./remove-fetchcontent-usage.patch {
      # We will download them instead of cmake's fetchContent
      catch2Src = catch2.src;
      catch2Src = catch2_3.src;
      gslSrc = microsoft-gsl.src;
    })
  ];

@@ -39,21 +41,35 @@ stdenv.mkDerivation {
    yaml-cpp
  ];

  cmakeFlags = [
    (lib.cmakeBool "prevail_ENABLE_TESTS" finalAttrs.doCheck)
  ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    cp ../check $out/bin/ebpf-verifier
    cp ../bin/prevail $out/bin/prevail

    runHook postInstall
  '';

  doCheck = true;

  checkPhase = ''
    runHook preCheck
    pushd ..
    bin/tests
    popd
    runHook postCheck
  '';

  meta = {
    description = "eBPF verifier based on abstract interpretation";
    homepage = "https://github.com/vbpf/ebpf-verifier";
    homepage = "https://github.com/vbpf/prevail";
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    maintainers = [ ];
    mainProgram = "ebpf-verifier";
    mainProgram = "prevail";
  };
}
})
+25 −0
Original line number Diff line number Diff line
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,9 +75,7 @@
 endif ()
 
 FetchContent_Declare(GSL
-  GIT_REPOSITORY "https://github.com/microsoft/GSL"
-  GIT_TAG "v4.2.0"
-  GIT_SHALLOW ON
+  SOURCE_DIR "@gslSrc@"
 )
 set(GSL_INSTALL ON CACHE BOOL "Force GSL install to vendor it with prevail" FORCE)
 set(GSL_TEST OFF CACHE BOOL "Skip GSL tests when building as a dependency" FORCE)
@@ -196,9 +194,7 @@
 # Tests
 if (prevail_ENABLE_TESTS)
   FetchContent_Declare(Catch2
-    GIT_REPOSITORY "https://github.com/catchorg/Catch2.git"
-    GIT_TAG "v3.13.0"
-    GIT_SHALLOW ON
+    SOURCE_DIR "@catch2Src@"
   )
   FetchContent_MakeAvailable(Catch2)
 
+0 −14
Original line number Diff line number Diff line
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7cf256..cb94e5a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,8 +6,7 @@ project(ebpf_verifier)
 include(FetchContent)
 FetchContent_Declare(
   Catch2
-  GIT_REPOSITORY https://github.com/catchorg/Catch2.git
-  GIT_TAG        ac93f1943762f6fc92f0dc5bac0d720a33a27530
+  SOURCE_DIR @catch2Src@
 )
 FetchContent_MakeAvailable(Catch2)
 
+1 −0
Original line number Diff line number Diff line
@@ -625,6 +625,7 @@ mapAliases {
  e17gtk = throw "'e17gtk' has been removed because it was archived upstream."; # Added 2026-01-15
  eask = throw "'eask' has been renamed to/replaced by 'eask-cli'"; # Converted to throw 2025-10-27
  easyloggingpp = throw "easyloggingpp has been removed, as it is deprecated upstream and does not build with CMake 4"; # Added 2025-09-17
  ebpf-verifier = warnAlias "'ebpf-verifier' has been renamed to 'prevail'" prevail; # Added 2026-04-01
  EBTKS = throw "'EBTKS' has been renamed to/replaced by 'ebtks'"; # Converted to throw 2025-10-27
  ec2-utils = throw "'ec2-utils' has been renamed to/replaced by 'amazon-ec2-utils'"; # Converted to throw 2025-10-27
  ecryptfs = throw "'ecryptfs' has been removed due to lack of maintenance. Consider using 'fscrypt', 'gocryptfs' or 'cryfs' instead."; # Added 2026-01-14
+0 −4
Original line number Diff line number Diff line
@@ -403,10 +403,6 @@ with pkgs;

  dnf4 = python3Packages.callPackage ../development/python-modules/dnf4/wrapper.nix { };

  ebpf-verifier = callPackage ../tools/networking/ebpf-verifier {
    catch2 = catch2_3;
  };

  enochecker-test = with python3Packages; callPackage ../development/tools/enochecker-test { };

  inherit (gridlock) nyarr;