Skip to content

Expr: Remove expensive unnecessary simplification #4331

Expr: Remove expensive unnecessary simplification

Expr: Remove expensive unnecessary simplification #4331

Workflow file for this run

name: "Build"
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nix-build:
strategy:
matrix:
runtime: [ linux-x64, osx-x64, osx-arm64 ]
include:
- runtime: linux-x64
os: ubuntu-latest
- runtime: osx-x64
os: macos-15-intel
- runtime: osx-arm64
os: macos-15
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v30
- name: Nix cache
id: cache
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-build-${{ matrix.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
purge: true
purge-prefixes: nix-build-${{ matrix.os }}-
purge-created: 0
purge-primary-key: never
gc-max-store-size: 1G
- name: build hevm
run: nix build .#ci -L
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: hevm-${{ matrix.runtime }}
path: result/bin/hevm
extra-tests:
strategy:
matrix:
os: [ ubuntu-latest, macos-15 ]
include:
- os: ubuntu-latest
- os: macos-15
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v30
- name: Nix cache
id: cache
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-tests-${{ matrix.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
purge: true
purge-prefixes: nix-tests-${{ matrix.os }}-
purge-created: 0
purge-primary-key: never
gc-max-store-size: 1G
# cabal complains if we don't do this...
- name: cabal update
run: nix develop --command bash -c "cabal update"
# can't be run in nix build due to network usage
- name: run rpc tests
run: nix develop --command bash -c "cabal --active-repositories=:none run rpc-tests"
# if we run this in nix build we often get killed due to oom in ci
- name: run ethereum tests
run: nix develop --command bash -c "cabal --active-repositories=:none run ethereum-tests"
# if we run this in nix build, it complains about running in a sandbox
- name: run cli tests
run: nix develop --command bash -c "cabal --active-repositories=:none run cli-test"
build-windows:
name: build (windows-latest)
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
- run: |
echo FOUNDRY_PATH="$(dirname "$(which forge)")" >> "$GITHUB_ENV"
shell: bash
- uses: msys2/setup-msys2@v2
id: msys2
with:
msystem: CLANG64
path-type: minimal
update: true
install: >-
base-devel
gmp-devel
openssl-devel
git
unzip
bash
pacboy: >-
cmake:p
ninja:p
clang:p
lld:p
autotools:p
gmp:p
openssl:p
z3:p
go:p
- uses: haskell-actions/[email protected]
id: setup
with:
ghc-version: '9.8.4'
- name: Extract GHC & Cabal paths
run: |
HASKELL_PATHS="$(cygpath -u "$GHC_PATH"):$(cygpath -u "$CABAL_PATH")"
# This relative path works only if GHC was installed using chocalatey, but not when it was installed with ghcup
HASKELL_MINGW_PATH="$(cygpath -u "$GHC_PATH/../mingw")"
SYSTEM_MINGW_PATH="$(cygpath -m "$MSYS2_LOCATION/$MSYSTEM")"
if [ ! -d "$HASKELL_MINGW_PATH" ]; then
echo "The expected HASKELL_MINGW directory $HASKELL_MINGW_PATH does not exist"
echo "Trying to locate it via ghcup"
GHCUP_PATH=$(cygpath -u "C:\ghcup\bin\ghcup.exe")
GHC_REAL_PATH=$("$GHCUP_PATH" whereis ghc "$GHC_VERSION" | tr -d '\r')
HASKELL_MINGW_PATH="$(cygpath -u "$(dirname $GHC_REAL_PATH)"/../mingw)"
fi
echo "SYSTEM_MINGW_PATH is $SYSTEM_MINGW_PATH"
echo "HASKELL_MINGW_PATH is $HASKELL_MINGW_PATH"
if [ ! -d "$HASKELL_MINGW_PATH" ]; then
echo "Failed to locate GHC-bundled mingw"
exit 1
fi
echo "HASKELL_PATHS=$HASKELL_PATHS" >> "$GITHUB_ENV"
echo "HASKELL_MINGW_PATH=$HASKELL_MINGW_PATH" >> "$GITHUB_ENV"
echo "SYSTEM_MINGW_PATH=$SYSTEM_MINGW_PATH" >> "$GITHUB_ENV"
env:
GHC_VERSION: ${{ steps.setup.outputs.ghc-version }}
GHC_PATH: ${{ steps.setup.outputs.ghc-path }}
CABAL_PATH: ${{ steps.setup.outputs.cabal-path }}
MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
- name: build and install c dependencies
run: |
export PATH="$HASKELL_MINGW_PATH/bin:$PATH"
echo "::group::Installing libsecp256k1"
./.github/scripts/install-libsecp256k1.sh
echo "::endgroup::"
echo "::group::Installing libff"
./.github/scripts/install-libff.sh
echo "::endgroup::"
- name: Configure the build
run: |
export PATH="$HASKELL_PATHS:$PATH"
cabal configure --disable-documentation --enable-executable-static --enable-executable-stripping \
--extra-lib-dirs="$(cygpath -m "$HASKELL_MINGW_PATH/x86_64-w64-mingw32/lib")" \
--extra-lib-dirs="$(cygpath -m "$HASKELL_MINGW_PATH/lib")" \
--extra-lib-dirs="$SYSTEM_MINGW_PATH/lib" \
--extra-include-dirs="$HOME/.local/include" --extra-lib-dirs="$HOME/.local/lib" \
--ghc-options=-pgml="$(cygpath -m "$HASKELL_MINGW_PATH/bin/clang.exe") -optc-idirafter -optc$SYSTEM_MINGW_PATH/include -optcxx-idirafter -optcxx$SYSTEM_MINGW_PATH/include" -fstatic-secp256k1 --constraint="zlib +bundled-c-zlib"
cabal build --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.
- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install haskell dependencies
run: |
export PATH="$HASKELL_PATHS:$PATH"
cabal build all --only-dependencies
# Cache dependencies already, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v4
# Caches are immutable, trying to save with the same key would error.
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: build hevm
run: |
export PATH="$HASKELL_PATHS:$PATH"
cabal build
mkdir result && cp "$(cabal list-bin hevm)" result/hevm.exe
strip result/hevm.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: hevm-windows-x64
path: result/hevm.exe
- uses: actions/checkout@v4
with:
repository: ethereum/solidity
ref: 8a97fa7a1db1ec509221ead6fea6802c684ee887
path: ethereum-solidity
persist-credentials: false
- uses: actions/checkout@v4
with:
repository: ethereum/tests
ref: v13
path: ethereum-tests
persist-credentials: false
- uses: actions/checkout@v4
with:
repository: foundry-rs/forge-std
path: forge-std
persist-credentials: false
- name: prepare test dependencies
run: |
# bitwuzla
curl --retry 5 -fsSL https://github.com/bitwuzla/bitwuzla/releases/download/0.8.2/Bitwuzla-Win64-x86_64-static.zip -o bitwuzla.zip
unzip bitwuzla.zip && rm bitwuzla.zip
echo BITWUZLA_PATH="$PWD/Bitwuzla-Win64-x86_64-static/bin" >> "$GITHUB_ENV"
# evm
go install github.com/ethereum/go-ethereum/cmd/evm@latest
echo EVM_PATH="$(cygpath -u "$(go env GOPATH)/bin")" >> "$GITHUB_ENV"
# cvc5
curl --retry 5 -fsSL https://github.com/cvc5/cvc5/releases/download/cvc5-1.3.0/cvc5-Win64-x86_64-static.zip -o cvc5.zip
unzip cvc5.zip && rm cvc5.zip
echo CVC5_PATH="$PWD/cvc5-Win64-x86_64-static/bin" >> "$GITHUB_ENV"
# solc
mkdir solc
curl --retry 5 -fsSL https://github.com/ethereum/solidity/releases/download/v0.8.26/solc-windows.exe -o solc/solc.exe
echo DAPP_SOLC="$PWD/solc/solc.exe" >> "$GITHUB_ENV"
echo DAPP_SOLC_PATH="$PWD/solc/" >> "$GITHUB_ENV"
# repos
echo HEVM_SOLIDITY_REPO="$PWD/ethereum-solidity" >> "$GITHUB_ENV"
echo HEVM_ETHEREUM_TESTS_REPO="$PWD/ethereum-tests" >> "$GITHUB_ENV"
echo HEVM_FORGE_STD_REPO="$PWD/forge-std" >> "$GITHUB_ENV"
- name: run tests
run: |
export PATH="$EVM_PATH:$CVC5_PATH:$BITWUZLA_PATH:$DAPP_SOLC_PATH:$FOUNDRY_PATH:$HASKELL_PATHS:$PATH"
cabal run test
- name: run rpc tests
run: |
export PATH="$BITWUZLA_PATH:$FOUNDRY_PATH:$HASKELL_PATHS:$PATH"
cabal run rpc-tests
- name: run ethereum tests
run: |
export PATH="$HASKELL_PATHS:$PATH"
cabal run ethereum-tests
cabal-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v30
- name: Nix cache
id: cache
uses: nix-community/cache-nix-action@v6
with:
primary-key: nix-cabal-check-${{ hashFiles('**/*.nix', '**/flake.lock') }}
purge: true
purge-prefixes: nix-cabal-check-
purge-created: 0
purge-primary-key: never
gc-max-store-size: 1G
- name: run cabal check
run: nix develop -c cabal check --verbose=3