Skip to content

Commit

Permalink
Build echidna with GHC 9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
elopez committed Dec 5, 2024
1 parent 4a38578 commit d7da6e4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 17 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
]);

Expand Down Expand Up @@ -148,17 +151,17 @@
packages.echidna-redistributable = echidnaRedistributable;

devShell = with pkgs;
haskellPackages.shellFor {
(hsPkgs pkgs).shellFor {
packages = _: [ (echidna pkgs) ];
shellHook = ''
hpack
'';
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;
};
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Campaign.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Exec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ???.
Expand Down
2 changes: 1 addition & 1 deletion src/test/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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(..))
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-22.34
resolver: nightly-2024-10-21

packages:
- '.'
Expand Down

0 comments on commit d7da6e4

Please sign in to comment.