From d7da6e42c0ec6630002c6987aeb6f56323cb8ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 5 Dec 2024 20:03:51 +0100 Subject: [PATCH] Build echidna with GHC 9.8 --- flake.lock | 6 +++--- flake.nix | 31 +++++++++++++++++-------------- lib/Echidna/Campaign.hs | 2 +- lib/Echidna/Exec.hs | 2 +- src/test/Common.hs | 2 +- stack.yaml | 2 +- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index a44f65c89..0f51596ee 100644 --- a/flake.lock +++ b/flake.lock @@ -70,11 +70,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1726436956, - "narHash": "sha256-a3rP7uafX/qBFX0y4CGS8vvTPvxsLl9eZQ85DkIn3DI=", + "lastModified": 1733229606, + "narHash": "sha256-FLYY5M0rpa5C2QAE3CKLYAM6TwbKicdRK6qNrSHlNrE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "039b72d0c738c934e2e36d7fc5520d1b425287a6", + "rev": "566e53c2ad750c84f6d31f9ccb9d00f823165550", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e456114a0..8b3eca0b6 100644 --- a/flake.nix +++ b/flake.nix @@ -38,22 +38,25 @@ ncurses-static = pkgsStatic.ncurses.override { enableStatic = true; }; hsPkgs = ps : - ps.haskellPackages.override { + ps.haskell.packages.ghc98.override { overrides = hfinal: hprev: { - with-utf8 = - if (with ps.stdenv; hostPlatform.isDarwin && hostPlatform.isx86) - then ps.haskell.lib.compose.overrideCabal (_ : { extraLibraries = [ps.libiconv]; }) hprev.with-utf8 - else hprev.with-utf8; - # TODO: temporary fix for static build which is still on 9.4 - witch = ps.haskell.lib.doJailbreak hprev.witch; + with-utf8 = ps.haskell.lib.compose.overrideCabal (drv: { + version = "1.1.0.0"; + src = pkgs.fetchFromGitHub { + owner = "serokell"; + repo = "haskell-with-utf8"; + rev = "cf6e31475da3d9f54439650a70170819daa35f54"; + sha256 = "sha256-hxUiZbbcA6RvrVgGk4Vbt/rZT6wnBF3bfYbbQflzQ24="; + }; + }) hprev.with-utf8; }; }; hevm = pkgs: pkgs.lib.pipe ((hsPkgs pkgs).callCabal2nix "hevm" (pkgs.fetchFromGitHub { owner = "ethereum"; repo = "hevm"; - rev = "443c9040f6a8bde7d8b2cfafd99c0cb7dd7d049f"; - sha256 = "sha256-IC/q+2SJoyDansmbTHXfkKFfnhmMy97G13aTPNOkR30="; + rev = "53bccde13eeb6712eb9bc1d99b53529614a33690"; + sha256 = "sha256-sd7DEWz7hrs8AO+0juFz5S7Y5l/cWmQmullFeJH7FeE="; }) { secp256k1 = pkgs.secp256k1; }) ([ pkgs.haskell.lib.compose.dontCheck @@ -65,7 +68,7 @@ # FIXME: figure out solc situation, it conflicts with the one from # solc-select that is installed with slither, disable tests in the meantime haskell.lib.compose.dontCheck - (haskell.lib.compose.addTestToolDepends [ haskellPackages.hpack slither-analyzer solc ]) + (haskell.lib.compose.addTestToolDepends [ (hsPkgs pkgs).hpack slither-analyzer solc ]) (haskell.lib.compose.disableCabalFlag "static") ]); @@ -148,7 +151,7 @@ packages.echidna-redistributable = echidnaRedistributable; devShell = with pkgs; - haskellPackages.shellFor { + (hsPkgs pkgs).shellFor { packages = _: [ (echidna pkgs) ]; shellHook = '' hpack @@ -156,9 +159,9 @@ buildInputs = [ solc slither-analyzer - haskellPackages.hlint - haskellPackages.cabal-install - haskellPackages.haskell-language-server + (hsPkgs pkgs).hlint + (hsPkgs pkgs).cabal-install + (hsPkgs pkgs).haskell-language-server ]; withHoogle = true; }; diff --git a/lib/Echidna/Campaign.hs b/lib/Echidna/Campaign.hs index 2f3085884..589adab23 100644 --- a/lib/Echidna/Campaign.hs +++ b/lib/Echidna/Campaign.hs @@ -48,7 +48,7 @@ import Echidna.Types.Config import Echidna.Types.Signature (FunctionName) import Echidna.Types.Test import Echidna.Types.Test qualified as Test -import Echidna.Types.Tx (TxCall(..), Tx(..), call) +import Echidna.Types.Tx (TxCall(..), Tx(..)) import Echidna.Utility (getTimestamp) instance MonadThrow m => MonadThrow (RandT g m) where diff --git a/lib/Echidna/Exec.hs b/lib/Echidna/Exec.hs index 130e1b335..4cea32816 100644 --- a/lib/Echidna/Exec.hs +++ b/lib/Echidna/Exec.hs @@ -40,7 +40,7 @@ import Echidna.Types (ExecException(..), Gas, fromEVM, emptyAccount) import Echidna.Types.Config (Env(..), EConfig(..), UIConf(..), OperationMode(..), OutputFormat(Text)) import Echidna.Types.Coverage (CoverageInfo) import Echidna.Types.Solidity (SolConf(..)) -import Echidna.Types.Tx (TxCall(..), Tx, TxResult(..), call, dst, initialTimestamp, initialBlockNumber, getResult) +import Echidna.Types.Tx (TxCall(..), Tx(call, dst), TxResult(..), initialTimestamp, initialBlockNumber, getResult) import Echidna.Utility (getTimestamp, timePrefix) -- | Broad categories of execution failures: reversions, illegal operations, and ???. diff --git a/src/test/Common.hs b/src/test/Common.hs index 2eb400aaa..b67fb6f34 100644 --- a/src/test/Common.hs +++ b/src/test/Common.hs @@ -50,7 +50,7 @@ import Echidna.Types.Campaign import Echidna.Types.Signature (ContractName) import Echidna.Types.Solidity (SolConf(..)) import Echidna.Types.Test -import Echidna.Types.Tx (Tx(..), TxCall(..), call) +import Echidna.Types.Tx (Tx(..), TxCall(..)) import Echidna.Types.World (World(..)) import EVM.Solidity (Contracts(..), BuildOutput(..), SolcContract(..)) diff --git a/stack.yaml b/stack.yaml index 261e3d398..7ff9d9453 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-22.34 +resolver: nightly-2024-10-21 packages: - '.'