Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build echidna with GHC 9.8 #1334

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/container-linux-static/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.18.6
FROM alpine:3.18.9
# Based on https://github.com/fpco/alpine-haskell-stack/blob/9.2.8v2/ghc-Dockerfile

RUN apk upgrade --no-cache &&\
Expand Down Expand Up @@ -27,7 +27,7 @@ RUN apk upgrade --no-cache &&\
lld \
shadow # for stack --docker, provides groupadd

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 && \
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 && \
chmod +x /usr/local/bin/stack

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

RUN cd /tmp && \
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 && \
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 && \
tar xf ghc.tar.xz && \
cd ghc-9.6.5-x86_64-unknown-linux && \
cd ghc-9.8.2-x86_64-unknown-linux && \
./configure --prefix=/usr/local && \
make install && \
rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.6.5-x86_64-unknown-linux
rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.8.2-x86_64-unknown-linux

RUN apk upgrade --no-cache &&\
apk add --no-cache \
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
include:
- os: ubuntu-20.04
shell: bash
container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.6.5\", \"options\": \"--user 1001\"}"
container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.8.2\", \"options\": \"--user 1001\"}"
- os: macos-13 # x86_64 macOS
shell: bash
- os: windows-latest
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
id: stack
if: matrix.container == ''
with:
ghc-version: '9.6.5'
ghc-version: '9.8.2'
enable-stack: true
stack-version: 'latest'

Expand All @@ -90,7 +90,7 @@ jobs:
echo "- $HOME/.local/lib";
echo;
echo "ghc-options:";
echo ' "$locals": -Werror'
echo ' "$locals": -Werror -Wno-error=x-partial'
"$REPLACE_LINKER_WIN" && echo ' "$everything": -pgml='$(cygpath -m "$GHC_MINGW_PATH/bin/clang.exe");
echo;
"$SKIP_MSYS" && echo "skip-msys: true" || true
Expand Down Expand Up @@ -156,12 +156,12 @@ jobs:
- name: Build Dependencies
run: |
export PATH="$HASKELL_PATHS:$PATH"
stack build --ghc-options="-Werror" --only-dependencies
stack build --ghc-options="-Werror -Wno-error=x-partial" --only-dependencies
- name: Build and install echidna
run: |
export PATH="$HASKELL_PATHS:$PATH"
stack install --ghc-options="-Werror"
stack install --ghc-options="-Werror -Wno-error=x-partial"
- name: Amend and compress binaries (macOS)
if: runner.os == 'macOS'
Expand All @@ -185,7 +185,7 @@ jobs:
if: runner.os != 'macOS'
run: |
export PATH="$HASKELL_PATHS:$PATH"
stack build --test --no-run-tests --ghc-options="-Werror"
stack build --test --no-run-tests --ghc-options="-Werror -Wno-error=x-partial"
cp "$(find "$PWD" -name 'echidna-testsuite*' -type f)" .
- name: Upload testsuite
Expand Down
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 = "release/0.54.2";
sha256 = "sha256-h0e6QeMBIUkyANYdrGjrqZ2M4fnODOB0gNPQtsrAiL8=";
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
4 changes: 2 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
resolver: lts-22.34
resolver: nightly-2024-10-21

packages:
- '.'

extra-deps:
- git: https://github.com/ethereum/hevm.git
commit: 037ff11779d0089378f01cb103db1171dc642be2
commit: 53bccde13eeb6712eb9bc1d99b53529614a33690

- smt2-parser-0.1.0.1@sha256:1e1a4565915ed851c13d1e6b8bb5185cf5d454da3b43170825d53e221f753d77,1421
- spawn-0.3@sha256:b91e01d8f2b076841410ae284b32046f91471943dc799c1af77d666c72101f02,1162
Expand Down
Loading