From b0d8ef7fa73fc20d17568bcdf4a7b393fe7c8f92 Mon Sep 17 00:00:00 2001 From: "Miao, ZhiCheng" Date: Mon, 28 Aug 2023 09:55:21 +0300 Subject: [PATCH] echidna: fix build due to brick-1.9 --- pkgs/tools/security/echidna/brick-1.9.patch | 44 +++++++++++++++++++++ pkgs/tools/security/echidna/default.nix | 3 ++ 2 files changed, 47 insertions(+) create mode 100644 pkgs/tools/security/echidna/brick-1.9.patch diff --git a/pkgs/tools/security/echidna/brick-1.9.patch b/pkgs/tools/security/echidna/brick-1.9.patch new file mode 100644 index 000000000000000..de63cd69e20e6ca --- /dev/null +++ b/pkgs/tools/security/echidna/brick-1.9.patch @@ -0,0 +1,44 @@ +diff --git a/lib/Echidna/UI.hs b/lib/Echidna/UI.hs +index 613c3ef..559e227 100644 +--- a/lib/Echidna/UI.hs ++++ b/lib/Echidna/UI.hs +@@ -131,7 +131,7 @@ ui vm world dict initialCorpus = do + , now = now + , fetchedContracts = mempty + , fetchedSlots = mempty +- , fetchedDialog = B.dialog (Just " Fetched contracts/slots ") Nothing 80 ++ , fetchedDialog = B.dialog (Just $ str " Fetched contracts/slots ") Nothing 80 + , displayFetchedDialog = False + , workerEvents = mempty + , corpusSize = 0 +diff --git a/lib/Echidna/UI/Widgets.hs b/lib/Echidna/UI/Widgets.hs +index 4eee4ce..964b314 100644 +--- a/lib/Echidna/UI/Widgets.hs ++++ b/lib/Echidna/UI/Widgets.hs +@@ -4,7 +4,7 @@ module Echidna.UI.Widgets where + + #ifdef INTERACTIVE_UI + +-import Brick ++import Brick hiding (style) + import Brick.AttrMap qualified as A + import Brick.Widgets.Border + import Brick.Widgets.Center +@@ -43,7 +43,7 @@ data UIState = UIState + , now :: LocalTime + , fetchedContracts :: Map Addr (Maybe Contract) + , fetchedSlots :: Map Addr (Map W256 (Maybe W256)) +- , fetchedDialog :: B.Dialog () ++ , fetchedDialog :: B.Dialog () Name + , displayFetchedDialog :: Bool + + , workerEvents :: Seq (Int, LocalTime, CampaignEvent) +@@ -222,7 +222,7 @@ perfWidget uiState = + ppSeed :: [WorkerState] -> String + ppSeed campaigns = show (head campaigns).genDict.defSeed + +-fetchedDialogWidget :: UIState -> Widget n ++fetchedDialogWidget :: UIState -> Widget Name + fetchedDialogWidget uiState = + B.renderDialog uiState.fetchedDialog $ padLeftRight 1 $ + foldl (<=>) emptyWidget (Map.mapWithKey renderContract uiState.fetchedContracts) diff --git a/pkgs/tools/security/echidna/default.nix b/pkgs/tools/security/echidna/default.nix index bf28f8936166f3c..8606388cfae2156 100644 --- a/pkgs/tools/security/echidna/default.nix +++ b/pkgs/tools/security/echidna/default.nix @@ -34,6 +34,9 @@ in mkDerivation rec { sha256 = "sha256-5d9ttPR3rRHywBeLM85EGCEZLNZNZzOAhIN6AJToJyI="; }; + # Note: pending PR https://github.com/crytic/echidna/pull/1096 + patches = [ ./brick-1.9.patch ]; + isLibrary = true; isExecutable = true;