From cf18e132dc2b6ff7ae8e02ab53ce2377751afda5 Mon Sep 17 00:00:00 2001 From: Xiangyan Sun Date: Wed, 1 Apr 2026 01:00:21 -0700 Subject: [PATCH] prevail: rename from ebpf-verifier; unstable-2023-07-15 -> 0.2.0 --- .../pr/prevail/package.nix} | 40 +++++++++++++------ .../prevail/remove-fetchcontent-usage.patch | 25 ++++++++++++ .../remove-fetchcontent-usage.patch | 14 ------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 -- 5 files changed, 54 insertions(+), 30 deletions(-) rename pkgs/{tools/networking/ebpf-verifier/default.nix => by-name/pr/prevail/package.nix} (52%) create mode 100644 pkgs/by-name/pr/prevail/remove-fetchcontent-usage.patch delete mode 100644 pkgs/tools/networking/ebpf-verifier/remove-fetchcontent-usage.patch diff --git a/pkgs/tools/networking/ebpf-verifier/default.nix b/pkgs/by-name/pr/prevail/package.nix similarity index 52% rename from pkgs/tools/networking/ebpf-verifier/default.nix rename to pkgs/by-name/pr/prevail/package.nix index b672d2c6297f..dc0228506381 100644 --- a/pkgs/tools/networking/ebpf-verifier/default.nix +++ b/pkgs/by-name/pr/prevail/package.nix @@ -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"; }; -} +}) diff --git a/pkgs/by-name/pr/prevail/remove-fetchcontent-usage.patch b/pkgs/by-name/pr/prevail/remove-fetchcontent-usage.patch new file mode 100644 index 000000000000..84827c87db01 --- /dev/null +++ b/pkgs/by-name/pr/prevail/remove-fetchcontent-usage.patch @@ -0,0 +1,25 @@ +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) + diff --git a/pkgs/tools/networking/ebpf-verifier/remove-fetchcontent-usage.patch b/pkgs/tools/networking/ebpf-verifier/remove-fetchcontent-usage.patch deleted file mode 100644 index 8a4af1bee19a..000000000000 --- a/pkgs/tools/networking/ebpf-verifier/remove-fetchcontent-usage.patch +++ /dev/null @@ -1,14 +0,0 @@ -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) - diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index af491f9d8642..ad68c1bac00a 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -622,6 +622,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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4380dac2f84f..5e9f7a877096 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -349,10 +349,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;