Skip to content

Commit 3aa0798

Browse files
committed
Build echidna with GHC 9.8
1 parent 4a38578 commit 3aa0798

File tree

8 files changed

+36
-33
lines changed

8 files changed

+36
-33
lines changed

Diff for: .github/container-linux-static/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.18.6
1+
FROM alpine:3.18.9
22
# Based on https://github.com/fpco/alpine-haskell-stack/blob/9.2.8v2/ghc-Dockerfile
33

44
RUN apk upgrade --no-cache &&\
@@ -27,7 +27,7 @@ RUN apk upgrade --no-cache &&\
2727
lld \
2828
shadow # for stack --docker, provides groupadd
2929

30-
RUN curl -sSLo /usr/local/bin/stack https://github.com/commercialhaskell/stack/releases/download/v2.13.1/stack-2.13.1-linux-x86_64-bin && \
30+
RUN curl -sSLo /usr/local/bin/stack https://github.com/commercialhaskell/stack/releases/download/v3.1.1/stack-3.1.1-linux-x86_64-bin && \
3131
chmod +x /usr/local/bin/stack
3232

3333
# https://stackoverflow.com/a/41517423
@@ -36,12 +36,12 @@ RUN ln -s /usr/lib/libncurses.a /usr/lib/libtinfo.a
3636
COPY stack-config.yaml /root/.stack/config.yaml
3737

3838
RUN cd /tmp && \
39-
curl -sSLo /tmp/ghc.tar.xz https://downloads.haskell.org/~ghc/9.6.5/ghc-9.6.5-x86_64-alpine3_12-linux.tar.xz && \
39+
curl -sSLo /tmp/ghc.tar.xz https://downloads.haskell.org/~ghc/9.8.2/ghc-9.8.2-x86_64-alpine3_12-linux.tar.xz && \
4040
tar xf ghc.tar.xz && \
41-
cd ghc-9.6.5-x86_64-unknown-linux && \
41+
cd ghc-9.8.2-x86_64-unknown-linux && \
4242
./configure --prefix=/usr/local && \
4343
make install && \
44-
rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.6.5-x86_64-unknown-linux
44+
rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.8.2-x86_64-unknown-linux
4545

4646
RUN apk upgrade --no-cache &&\
4747
apk add --no-cache \

Diff for: .github/workflows/ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
include:
2323
- os: ubuntu-20.04
2424
shell: bash
25-
container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.6.5\", \"options\": \"--user 1001\"}"
25+
container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.8.2\", \"options\": \"--user 1001\"}"
2626
- os: macos-13 # x86_64 macOS
2727
shell: bash
2828
- os: windows-latest
@@ -64,7 +64,7 @@ jobs:
6464
id: stack
6565
if: matrix.container == ''
6666
with:
67-
ghc-version: '9.6.5'
67+
ghc-version: '9.8.2'
6868
enable-stack: true
6969
stack-version: 'latest'
7070

@@ -90,7 +90,7 @@ jobs:
9090
echo "- $HOME/.local/lib";
9191
echo;
9292
echo "ghc-options:";
93-
echo ' "$locals": -Werror'
93+
echo ' "$locals": -Werror -Wno-error=x-partial'
9494
"$REPLACE_LINKER_WIN" && echo ' "$everything": -pgml='$(cygpath -m "$GHC_MINGW_PATH/bin/clang.exe");
9595
echo;
9696
"$SKIP_MSYS" && echo "skip-msys: true" || true
@@ -156,12 +156,12 @@ jobs:
156156
- name: Build Dependencies
157157
run: |
158158
export PATH="$HASKELL_PATHS:$PATH"
159-
stack build --ghc-options="-Werror" --only-dependencies
159+
stack build --ghc-options="-Werror -Wno-error=x-partial" --only-dependencies
160160
161161
- name: Build and install echidna
162162
run: |
163163
export PATH="$HASKELL_PATHS:$PATH"
164-
stack install --ghc-options="-Werror"
164+
stack install --ghc-options="-Werror -Wno-error=x-partial"
165165
166166
- name: Amend and compress binaries (macOS)
167167
if: runner.os == 'macOS'
@@ -185,7 +185,7 @@ jobs:
185185
if: runner.os != 'macOS'
186186
run: |
187187
export PATH="$HASKELL_PATHS:$PATH"
188-
stack build --test --no-run-tests --ghc-options="-Werror"
188+
stack build --test --no-run-tests --ghc-options="-Werror -Wno-error=x-partial"
189189
cp "$(find "$PWD" -name 'echidna-testsuite*' -type f)" .
190190
191191
- name: Upload testsuite

Diff for: flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: flake.nix

+17-14
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,25 @@
3838
ncurses-static = pkgsStatic.ncurses.override { enableStatic = true; };
3939

4040
hsPkgs = ps :
41-
ps.haskellPackages.override {
41+
ps.haskell.packages.ghc98.override {
4242
overrides = hfinal: hprev: {
43-
with-utf8 =
44-
if (with ps.stdenv; hostPlatform.isDarwin && hostPlatform.isx86)
45-
then ps.haskell.lib.compose.overrideCabal (_ : { extraLibraries = [ps.libiconv]; }) hprev.with-utf8
46-
else hprev.with-utf8;
47-
# TODO: temporary fix for static build which is still on 9.4
48-
witch = ps.haskell.lib.doJailbreak hprev.witch;
43+
with-utf8 = ps.haskell.lib.compose.overrideCabal (drv: {
44+
version = "1.1.0.0";
45+
src = pkgs.fetchFromGitHub {
46+
owner = "serokell";
47+
repo = "haskell-with-utf8";
48+
rev = "cf6e31475da3d9f54439650a70170819daa35f54";
49+
sha256 = "sha256-hxUiZbbcA6RvrVgGk4Vbt/rZT6wnBF3bfYbbQflzQ24=";
50+
};
51+
}) hprev.with-utf8;
4952
};
5053
};
5154

5255
hevm = pkgs: pkgs.lib.pipe ((hsPkgs pkgs).callCabal2nix "hevm" (pkgs.fetchFromGitHub {
5356
owner = "ethereum";
5457
repo = "hevm";
55-
rev = "443c9040f6a8bde7d8b2cfafd99c0cb7dd7d049f";
56-
sha256 = "sha256-IC/q+2SJoyDansmbTHXfkKFfnhmMy97G13aTPNOkR30=";
58+
rev = "53bccde13eeb6712eb9bc1d99b53529614a33690";
59+
sha256 = "sha256-sd7DEWz7hrs8AO+0juFz5S7Y5l/cWmQmullFeJH7FeE=";
5760
}) { secp256k1 = pkgs.secp256k1; })
5861
([
5962
pkgs.haskell.lib.compose.dontCheck
@@ -65,7 +68,7 @@
6568
# FIXME: figure out solc situation, it conflicts with the one from
6669
# solc-select that is installed with slither, disable tests in the meantime
6770
haskell.lib.compose.dontCheck
68-
(haskell.lib.compose.addTestToolDepends [ haskellPackages.hpack slither-analyzer solc ])
71+
(haskell.lib.compose.addTestToolDepends [ (hsPkgs pkgs).hpack slither-analyzer solc ])
6972
(haskell.lib.compose.disableCabalFlag "static")
7073
]);
7174

@@ -148,17 +151,17 @@
148151
packages.echidna-redistributable = echidnaRedistributable;
149152

150153
devShell = with pkgs;
151-
haskellPackages.shellFor {
154+
(hsPkgs pkgs).shellFor {
152155
packages = _: [ (echidna pkgs) ];
153156
shellHook = ''
154157
hpack
155158
'';
156159
buildInputs = [
157160
solc
158161
slither-analyzer
159-
haskellPackages.hlint
160-
haskellPackages.cabal-install
161-
haskellPackages.haskell-language-server
162+
(hsPkgs pkgs).hlint
163+
(hsPkgs pkgs).cabal-install
164+
(hsPkgs pkgs).haskell-language-server
162165
];
163166
withHoogle = true;
164167
};

Diff for: lib/Echidna/Campaign.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import Echidna.Types.Config
4848
import Echidna.Types.Signature (FunctionName)
4949
import Echidna.Types.Test
5050
import Echidna.Types.Test qualified as Test
51-
import Echidna.Types.Tx (TxCall(..), Tx(..), call)
51+
import Echidna.Types.Tx (TxCall(..), Tx(..))
5252
import Echidna.Utility (getTimestamp)
5353

5454
instance MonadThrow m => MonadThrow (RandT g m) where

Diff for: lib/Echidna/Exec.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import Echidna.Types (ExecException(..), Gas, fromEVM, emptyAccount)
4040
import Echidna.Types.Config (Env(..), EConfig(..), UIConf(..), OperationMode(..), OutputFormat(Text))
4141
import Echidna.Types.Coverage (CoverageInfo)
4242
import Echidna.Types.Solidity (SolConf(..))
43-
import Echidna.Types.Tx (TxCall(..), Tx, TxResult(..), call, dst, initialTimestamp, initialBlockNumber, getResult)
43+
import Echidna.Types.Tx (TxCall(..), Tx(call, dst), TxResult(..), initialTimestamp, initialBlockNumber, getResult)
4444
import Echidna.Utility (getTimestamp, timePrefix)
4545

4646
-- | Broad categories of execution failures: reversions, illegal operations, and ???.

Diff for: src/test/Common.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import Echidna.Types.Campaign
5050
import Echidna.Types.Signature (ContractName)
5151
import Echidna.Types.Solidity (SolConf(..))
5252
import Echidna.Types.Test
53-
import Echidna.Types.Tx (Tx(..), TxCall(..), call)
53+
import Echidna.Types.Tx (Tx(..), TxCall(..))
5454
import Echidna.Types.World (World(..))
5555

5656
import EVM.Solidity (Contracts(..), BuildOutput(..), SolcContract(..))

Diff for: stack.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
resolver: lts-22.34
1+
resolver: nightly-2024-10-21
22

33
packages:
44
- '.'
55

66
extra-deps:
77
- git: https://github.com/ethereum/hevm.git
8-
commit: 443c9040f6a8bde7d8b2cfafd99c0cb7dd7d049f
8+
commit: 53bccde13eeb6712eb9bc1d99b53529614a33690
99

1010
- smt2-parser-0.1.0.1@sha256:1e1a4565915ed851c13d1e6b8bb5185cf5d454da3b43170825d53e221f753d77,1421
1111
- spawn-0.3@sha256:b91e01d8f2b076841410ae284b32046f91471943dc799c1af77d666c72101f02,1162

0 commit comments

Comments
 (0)