From 72702286088389fc223c2988c86c6b0b100b4271 Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Wed, 18 Oct 2023 14:52:38 +0100 Subject: [PATCH 1/8] slimmed down the nix distribution of booster --- .github/workflows/test.yml | 113 +------- flake.lock | 560 ++----------------------------------- flake.nix | 327 ++++++++-------------- 3 files changed, 154 insertions(+), 846 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfb2ce959..4fb7f6977 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,58 +59,6 @@ jobs: run: | docker stop --time=0 hs-booster-ci-stack-unit-buster-${{ github.run_id }} - cabal: - name: 'Cabal / Unit Tests' - runs-on: [self-hosted, linux, normal] - steps: - - - name: 'Checkout Code' - uses: actions/checkout@v3 - with: - # Check out pull request HEAD instead of merge commit. - ref: ${{ github.event.pull_request.head.sha }} - - - name: 'Cache Cabal package database and store' - uses: actions/cache@v3 - with: - path: | - cabal-cache/packages - cabal-cache/store - key: cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('cabal.project.freeze') }} - restore-keys: | - cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('package.yaml') }}- - cabal-2-${{ runner.os }}-ghc-${{ env.ghc_version }}- - - - name: 'Set up Docker' - uses: ./.github/actions/with-docker - with: - tag: hs-booster-ci-cabal-unit-buster-${{ github.run_id }} - os: ubuntu - distro: jammy - fourmolu: ${{ env.fourmolu_version }} - hlint: ${{ env.hlint_version }} - hpack: ${{ env.hpack_version }} - ghc: ${{ env.ghc_version }} - - - name: 'Run hpack' - run: | - docker exec -t hs-booster-ci-cabal-unit-buster-${{ github.run_id }} /bin/bash -c 'hpack' - - - name: 'Build and run unit tests' - run: | - docker exec -t hs-booster-ci-cabal-unit-buster-${{ github.run_id }} \ - /bin/bash -c 'cabal --store-dir /opt/workspace/cabal-cache/store v2-test unit-tests --enable-tests --test-show-details=direct' - - - name: 'Configure with profiling' - run: | - docker exec -t hs-booster-ci-cabal-unit-buster-${{ github.run_id }} \ - /bin/bash -c 'cabal --store-dir /opt/workspace/cabal-cache/store v2-configure --enable-profiling -f-threaded' - - - name: 'Tear down Docker' - if: always() - run: | - docker stop --time=0 hs-booster-ci-cabal-unit-buster-${{ github.run_id }} - style: name: 'Formatting and Style' runs-on: [self-hosted, linux, normal] @@ -213,55 +161,24 @@ jobs: run: | nix --version export JQ=$(nix-build '' -A jq --no-link)/bin/jq - booster=$(nix build .#hs-backend-booster:exe:kore-rpc-booster --extra-experimental-features 'nix-command flakes' --print-build-logs --json | $JQ -r '.[].outputs | to_entries[].value') + booster=$(nix build .#kore-rpc-booster --extra-experimental-features 'nix-command flakes' --print-build-logs --json | $JQ -r '.[].outputs | to_entries[].value') drv=$(nix-store --query --deriver ${booster}) nix-store --query --requisites --include-outputs ${drv} | cachix push k-framework - nix build .#hs-backend-booster:exe:parsetest --extra-experimental-features 'nix-command flakes' --print-build-logs - nix build .#hs-backend-booster:exe:rpc-client --extra-experimental-features 'nix-command flakes' --print-build-logs - - name: Run unit tests - env: - GC_DONT_GC: '1' - run: nix run .#hs-backend-booster:test:unit-tests --extra-experimental-features 'nix-command flakes' --print-build-logs + - name: 'Cache Cabal package database and store' + uses: actions/cache@v3 + with: + path: | + cabal-cache/packages + cabal-cache/store + key: cabal-nix-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('cabal.project.freeze') }} + restore-keys: | + cabal-nix-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('package.yaml') }}- + cabal-nix-${{ runner.os }}-ghc-${{ env.ghc_version }}- + - name: Unit Tests + run: GC_DONT_GC=1 nix develop .#cabal --command bash -c "hpack && cabal update && cabal test --enable-tests --test-show-details=direct all" - - name: Run integration tests + - name: Integration tests if: ${{ matrix.os != 'macos-12' }} ## takes long on public runner, already tested in MacM1 - env: - GC_DONT_GC: '1' - GH_TOKEN: ${{ github.token }} - run: | - export JQ=$(nix-build '' -A jq --no-link)/bin/jq - K_VERSION=$(cat deps/k_release) - PLUGIN_VERSION=$(cat deps/blockchain-k-plugin_release) - export PATH="$(nix build github:runtimeverification/k/v$K_VERSION#k.openssl.procps --no-link --json | $JQ -r '.[].outputs | to_entries[].value')/bin:$PATH" - nix run .#hs-backend-booster:test:llvm-integration --extra-experimental-features 'nix-command flakes' --print-build-logs - - # The runDirectoryTest.sh script expects the following env vars to be set - export PLUGIN_DIR=$(nix build github:runtimeverification/blockchain-k-plugin/$PLUGIN_VERSION --no-link --json | $JQ -r '.[].outputs | to_entries[].value') - KORE_RPC_BOOSTER=$(nix build .#kore-rpc-booster --no-link --json | $JQ -r '.[].outputs | to_entries[].value')/bin/kore-rpc-booster - BOOSTER_DEV=$(nix build .#hs-backend-booster:exe:booster-dev --no-link --json | $JQ -r '.[].outputs | to_entries[].value')/bin/booster-dev - KORE_RPC_DEV=$(nix build .#hs-backend-booster:exe:kore-rpc-dev --no-link --json | $JQ -r '.[].outputs | to_entries[].value')/bin/kore-rpc-dev - export CLIENT=$(nix build .#hs-backend-booster:exe:rpc-client --no-link --json | $JQ -r '.[].outputs | to_entries[].value')/bin/rpc-client - - cd test/rpc-integration - for dir in $(ls -d test-*); do - name=${dir##test-} - echo "Running $name..." - if [ "$name" = "a-to-f" ] || [ "$name" = "diamond" ]; then - SERVER=$BOOSTER_DEV ./runDirectoryTest.sh test-$name --time - SERVER=$KORE_RPC_DEV ./runDirectoryTest.sh test-$name --time - SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time - elif [ "$name" = "vacuous" ]; then - SERVER=$KORE_RPC_DEV ./runDirectoryTest.sh test-$name - SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name - elif [ "$name" = "substitutions" ]; then - SERVER=$KORE_RPC_DEV ./runDirectoryTest.sh test-$name --time - SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time - elif [ "$name" = "no-evaluator" ]; then - SERVER=$BOOSTER_DEV ./runDirectoryTest.sh test-$name --time - else - SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time - fi - done - + run: GC_DONT_GC=1 nix develop .#cabal --command bash -c "scripts/integration-tests.sh" \ No newline at end of file diff --git a/flake.lock b/flake.lock index f34521450..b4d507c8d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,578 +1,70 @@ { "nodes": { - "HTTP": { - "flake": false, - "locked": { - "lastModified": 1451647621, - "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", - "owner": "phadej", - "repo": "HTTP", - "rev": "9bc0996d412fef1787449d841277ef663ad9a915", - "type": "github" - }, - "original": { - "owner": "phadej", - "repo": "HTTP", - "type": "github" - } - }, - "cabal-32": { - "flake": false, - "locked": { - "lastModified": 1603716527, - "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", - "owner": "haskell", - "repo": "cabal", - "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.2", - "repo": "cabal", - "type": "github" - } - }, - "cabal-34": { - "flake": false, - "locked": { - "lastModified": 1645834128, - "narHash": "sha256-wG3d+dOt14z8+ydz4SL7pwGfe7SiimxcD/LOuPCV6xM=", - "owner": "haskell", - "repo": "cabal", - "rev": "5ff598c67f53f7c4f48e31d722ba37172230c462", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.4", - "repo": "cabal", - "type": "github" - } - }, - "cabal-36": { - "flake": false, - "locked": { - "lastModified": 1669081697, - "narHash": "sha256-I5or+V7LZvMxfbYgZATU4awzkicBwwok4mVoje+sGmU=", - "owner": "haskell", - "repo": "cabal", - "rev": "8fd619e33d34924a94e691c5fea2c42f0fc7f144", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.6", - "repo": "cabal", - "type": "github" - } - }, - "cardano-shell": { - "flake": false, - "locked": { - "lastModified": 1608537748, - "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", - "owner": "input-output-hk", - "repo": "cardano-shell", - "rev": "9392c75087cb9a3d453998f4230930dea3a95725", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "cardano-shell", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1672831974, - "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", - "owner": "input-output-hk", - "repo": "flake-compat", - "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "hkm/gitlab-fix", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1679360468, - "narHash": "sha256-LGnza3cfXF10Biw3ZTg0u9o9t7s680Ww200t5KkHTh8=", - "owner": "hamishmack", - "repo": "flake-utils", - "rev": "e1ea268ff47ad475443dbabcd54744b4e5b9d4f5", - "type": "github" - }, - "original": { - "owner": "hamishmack", - "ref": "hkm/nested-hydraJobs", - "repo": "flake-utils", - "type": "github" - } - }, - "ghc-8.6.5-iohk": { - "flake": false, - "locked": { - "lastModified": 1600920045, - "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", - "owner": "input-output-hk", - "repo": "ghc", - "rev": "95713a6ecce4551240da7c96b6176f980af75cae", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "release/8.6.5-iohk", - "repo": "ghc", - "type": "github" - } - }, - "hackage": { - "flake": false, - "locked": { - "lastModified": 1691972564, - "narHash": "sha256-KrCj/gH4aQx3kYgfmq+E9qgcP/rspo5A+YiSBpqmAR8=", - "owner": "input-output-hk", - "repo": "hackage.nix", - "rev": "7949053c10f5d7ae40564b57d0464bbfbd223e7d", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "hackage.nix", - "type": "github" - } - }, "haskell-backend": { "inputs": { - "flake-compat": "flake-compat_2", - "haskell-nix": "haskell-nix", - "nixpkgs": [ - "haskell-backend", - "haskell-nix", - "nixpkgs-unstable" - ], - "z3-src": "z3-src" + "nixpkgs": "nixpkgs", + "stacklock2nix": "stacklock2nix", + "z3": "z3" }, "locked": { - "lastModified": 1697220192, - "narHash": "sha256-S28zhfxcxpuSN2oTC9t3aZ0HjxuZe7E/PuJPtem4Koc=", + "lastModified": 1697454961, + "narHash": "sha256-NiEpxJswB25ZjrNtiwoqUmYROo3nXaeyQ/EJEO9E0Kk=", "owner": "runtimeverification", "repo": "haskell-backend", - "rev": "3e1dd2a92e8a1f537260fe347f2d93462235d229", + "rev": "3cd32d15ebe78b37c58c419a9552aca9b799dd32", "type": "github" }, "original": { "owner": "runtimeverification", "repo": "haskell-backend", - "rev": "3e1dd2a92e8a1f537260fe347f2d93462235d229", - "type": "github" - } - }, - "haskell-nix": { - "inputs": { - "HTTP": "HTTP", - "cabal-32": "cabal-32", - "cabal-34": "cabal-34", - "cabal-36": "cabal-36", - "cardano-shell": "cardano-shell", - "flake-compat": "flake-compat_3", - "flake-utils": "flake-utils", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "hackage": "hackage", - "hls-1.10": "hls-1.10", - "hls-2.0": "hls-2.0", - "hpc-coveralls": "hpc-coveralls", - "hydra": "hydra", - "iserv-proxy": "iserv-proxy", - "nixpkgs": [ - "haskell-backend", - "haskell-nix", - "nixpkgs-unstable" - ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-2205": "nixpkgs-2205", - "nixpkgs-2211": "nixpkgs-2211", - "nixpkgs-2305": "nixpkgs-2305", - "nixpkgs-unstable": "nixpkgs-unstable", - "old-ghc-nix": "old-ghc-nix", - "stackage": "stackage" - }, - "locked": { - "lastModified": 1691974241, - "narHash": "sha256-SpeS/lPy5pxCszTQyGf8WozKEWIA4xGrHFtr/TguZjU=", - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "71f026dc5e42931c7d517ee30e79292670c3ac34", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "haskell.nix", - "type": "github" - } - }, - "hls-1.10": { - "flake": false, - "locked": { - "lastModified": 1680000865, - "narHash": "sha256-rc7iiUAcrHxwRM/s0ErEsSPxOR3u8t7DvFeWlMycWgo=", - "owner": "haskell", - "repo": "haskell-language-server", - "rev": "b08691db779f7a35ff322b71e72a12f6e3376fd9", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "1.10.0.0", - "repo": "haskell-language-server", - "type": "github" - } - }, - "hls-2.0": { - "flake": false, - "locked": { - "lastModified": 1687698105, - "narHash": "sha256-OHXlgRzs/kuJH8q7Sxh507H+0Rb8b7VOiPAjcY9sM1k=", - "owner": "haskell", - "repo": "haskell-language-server", - "rev": "783905f211ac63edf982dd1889c671653327e441", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "2.0.0.1", - "repo": "haskell-language-server", - "type": "github" - } - }, - "hpc-coveralls": { - "flake": false, - "locked": { - "lastModified": 1607498076, - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", - "type": "github" - }, - "original": { - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "type": "github" - } - }, - "hydra": { - "inputs": { - "nix": "nix", - "nixpkgs": [ - "haskell-backend", - "haskell-nix", - "hydra", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1671755331, - "narHash": "sha256-hXsgJj0Cy0ZiCiYdW2OdBz5WmFyOMKuw4zyxKpgUKm4=", - "owner": "NixOS", - "repo": "hydra", - "rev": "f48f00ee6d5727ae3e488cbf9ce157460853fea8", - "type": "github" - }, - "original": { - "id": "hydra", - "type": "indirect" - } - }, - "iserv-proxy": { - "flake": false, - "locked": { - "lastModified": 1688517130, - "narHash": "sha256-hUqfxSlo+ffqVdkSZ1EDoB7/ILCL25eYkcCXW9/P3Wc=", - "ref": "hkm/remote-iserv", - "rev": "9151db2a9a61d7f5fe52ff8836f18bbd0fd8933c", - "revCount": 13, - "type": "git", - "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" - }, - "original": { - "ref": "hkm/remote-iserv", - "type": "git", - "url": "https://gitlab.haskell.org/hamishmack/iserv-proxy.git" - } - }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1661606874, - "narHash": "sha256-9+rpYzI+SmxJn+EbYxjGv68Ucp22bdFUSy/4LkHkkDQ=", - "owner": "NixOS", - "repo": "nix", - "rev": "11e45768b34fdafdcf019ddbd337afa16127ff0f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "2.11.0", - "repo": "nix", + "rev": "3cd32d15ebe78b37c58c419a9552aca9b799dd32", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1657693803, - "narHash": "sha256-G++2CJ9u0E7NNTAi9n5G8TdDmGJXcIjkJ3NF8cetQB8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "365e1b3a859281cf11b94f87231adeabbdd878a2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.05-small", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2003": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105": { - "locked": { - "lastModified": 1659914493, - "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=", + "lastModified": 1696983906, + "narHash": "sha256-L7GyeErguS7Pg4h8nK0wGlcUTbfUMDu+HMf1UcyP72k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf", + "rev": "bd1cde45c77891214131cbbea5b1203e485a9d51", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2111": { - "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2205": { - "locked": { - "lastModified": 1685573264, - "narHash": "sha256-Zffu01pONhs/pqH07cjlF10NnMDLok8ix5Uk4rhOnZQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "380be19fbd2d9079f677978361792cb25e8a3635", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2211": { - "locked": { - "lastModified": 1688392541, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2305": { - "locked": { - "lastModified": 1690680713, - "narHash": "sha256-NXCWA8N+GfSQyoN7ZNiOgq/nDJKOp5/BHEpiZP8sUZw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "b81af66deb21f73a70c67e5ea189568af53b1e8c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-23.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1690720142, - "narHash": "sha256-GywuiZjBKfFkntQwpNQfL+Ksa2iGjPprBGL0/psgRZM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3acb5c4264c490e7714d503c7166a3fde0c51324", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "old-ghc-nix": { - "flake": false, - "locked": { - "lastModified": 1631092763, - "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", - "owner": "angerman", - "repo": "old-ghc-nix", - "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", - "type": "github" - }, - "original": { - "owner": "angerman", - "ref": "master", - "repo": "old-ghc-nix", - "type": "github" + "id": "nixpkgs", + "ref": "nixos-23.05", + "type": "indirect" } }, "root": { "inputs": { - "flake-compat": "flake-compat", "haskell-backend": "haskell-backend", - "haskell-nix": [ + "nixpkgs": [ "haskell-backend", - "haskell-nix" + "nixpkgs" ], - "nixpkgs": [ + "stacklock2nix": [ "haskell-backend", - "haskell-nix", - "nixpkgs-unstable" + "stacklock2nix" ] } }, - "stackage": { - "flake": false, + "stacklock2nix": { "locked": { - "lastModified": 1691971763, - "narHash": "sha256-P98EuYKYhKLRTwHQTW7vvpNtHxEDwc7T5EUEMgoWH14=", - "owner": "input-output-hk", - "repo": "stackage.nix", - "rev": "4f3ebb68981d7bec84f010a950a85bd360d7b3af", + "lastModified": 1696895532, + "narHash": "sha256-QXQ7frsy7D8V81oE6HQBZhlL48Vr7iPR5fSZfNaTdg0=", + "owner": "cdepillabout", + "repo": "stacklock2nix", + "rev": "10d531672cada2e02ac49b1b18293e7a94938a38", "type": "github" }, "original": { - "owner": "input-output-hk", - "repo": "stackage.nix", + "owner": "cdepillabout", + "repo": "stacklock2nix", "type": "github" } }, - "z3-src": { + "z3": { "flake": false, "locked": { "lastModified": 1674011426, diff --git a/flake.nix b/flake.nix index 8e83f6bc8..f6a3c3724 100644 --- a/flake.nix +++ b/flake.nix @@ -2,237 +2,136 @@ description = "hs-backend-booster"; inputs = { - haskell-backend.url = "github:runtimeverification/haskell-backend/3e1dd2a92e8a1f537260fe347f2d93462235d229"; - haskell-nix.follows = "haskell-backend/haskell-nix"; - nixpkgs.follows = "haskell-backend/haskell-nix/nixpkgs-unstable"; - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; + haskell-backend.url = + "github:runtimeverification/haskell-backend/3cd32d15ebe78b37c58c419a9552aca9b799dd32"; + stacklock2nix.follows = "haskell-backend/stacklock2nix"; + nixpkgs.follows = "haskell-backend/nixpkgs"; }; - outputs = - { self, nixpkgs, haskell-nix, haskell-backend, ... }@inputs: + outputs = { self, nixpkgs, stacklock2nix, haskell-backend }: let - inherit (nixpkgs) lib; - perSystem = lib.genAttrs nixpkgs.lib.systems.flakeExposed; - nixpkgsForSystem = system: + perSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed; + nixpkgsCleanFor = system: import nixpkgs { inherit system; }; + nixpkgsFor = system: import nixpkgs { - inherit (haskell-nix) config; inherit system; overlays = - [ haskell-nix.overlays.combined haskell-backend.overlays.z3 ]; + [ stacklock2nix.overlay self.overlay haskell-backend.overlays.z3 ]; }; - allNixpkgsFor = perSystem nixpkgsForSystem; - nixpkgsFor = system: allNixpkgsFor.${system}; - index-state = "2023-06-26T23:55:21Z"; - - boosterBackendFor = { compiler, pkgs, profiling ? false }: - pkgs.haskell-nix.cabalProject { - name = "hs-backend-booster"; - supportHpack = true; - compiler-nix-name = compiler; - src = pkgs.applyPatches { - name = "booster-backend-src"; - src = pkgs.nix-gitignore.gitignoreSourcePure [ - '' - /test/parser - /test/internalisation - /test/rpc-integration - /test/jsonrpc-examples - /scripts - /.github - '' - ./.gitignore - ] ./.; - postPatch = '' - substituteInPlace library/Booster/VersionInfo.hs \ - --replace '$(GitRev.gitHash)' '"${self.rev or "dirty"}"' - ''; - }; - inherit index-state; - - shell = { - withHoogle = true; - tools = { - cabal = "latest"; - haskell-language-server = "latest"; - fourmolu = { - inherit index-state; - version = "0.12.0.0"; - }; - hlint = "latest"; + withZ3 = pkgs: pkg: exe: + pkgs.stdenv.mkDerivation { + name = exe; + phases = [ "installPhase" ]; + buildInputs = with pkgs; [ makeWrapper ]; + installPhase = '' + mkdir -p $out/bin + makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} --prefix PATH : ${pkgs.z3}/bin + ''; + }; + in { + overlay = final: prev: { + booster-backend = final.stacklock2nix { + stackYaml = ./stack.yaml; + # This should based on the compiler version from the resolver in stack.yaml. + baseHaskellPkgSet = final.haskell.packages.ghc928; + cabal2nixArgsOverrides = args: + args // { + # The Haskell package `"graphviz"` depends on the _system_ + # package `graphviz`, and takes the system package `graphviz` as one of its build + # inputs, but it is actually getting passed _itself_ (not the system package + # `graphviz`), which causes the infinite recursion. + "graphviz" = _: { graphviz = final.graphviz; }; }; - nativeBuildInputs = with nixpkgs.legacyPackages.${pkgs.system}; [ - nixpkgs-fmt - hpack - zlib - secp256k1 - ]; - shellHook = "rm -f *.cabal && hpack"; - }; - modules = [{ - enableProfiling = profiling; - enableLibraryProfiling = profiling; - packages = { - hs-backend-booster = { - components.exes.kore-rpc-booster = { - build-tools = with pkgs; lib.mkForce [ makeWrapper ]; - postInstall = '' - wrapProgram $out/bin/kore-rpc-booster --prefix PATH : ${ - with pkgs; - lib.makeBinPath [ z3 ] - } + additionalHaskellPkgSetOverrides = hfinal: hprev: + with final.haskell.lib; { + decision-diagrams = dontCheck hprev.decision-diagrams; + fgl = dontCheck hprev.fgl; + haskeline = dontCheck hprev.haskeline; + hs-backend-booster = overrideCabal hprev.hs-backend-booster + (drv: { + doCheck = false; + postPatch = '' + ${drv.postPatch or ""} + substituteInPlace library/Booster/VersionInfo.hs \ + --replace '$(GitRev.gitHash)' '"${self.rev or "dirty"}"' ''; - }; - components.exes.kore-rpc-dev = { - build-tools = with pkgs; lib.mkForce [ makeWrapper ]; - postInstall = '' - wrapProgram $out/bin/kore-rpc-dev --prefix PATH : ${ - with pkgs; - lib.makeBinPath [ z3 ] - } - ''; - }; - components.tests.unit-tests = { - postInstall = '' - wrapProgram $out/bin/unit-tests --prefix PATH : ${ - with pkgs; - lib.makeBinPath [ nixpkgs.legacyPackages.${pkgs.system}.diffutils ] - } - ''; - }; + buildTarget = "kore-rpc-booster"; + }); + json-rpc = dontCheck hprev.json-rpc; + kore = (overrideCabal hprev.kore (drv: { + doCheck = false; + buildTarget = "kore"; + # Patch kore to remove Paths_kore from GlobalMain, which prevents nix stripping kore as a runtime dependency. + # This happens because Paths_kore hard-codes paths to the kore library in the nix store and + # ghc does not optimise these away even though they are not used by the booster; hence they end up in the executables + postPatch = '' + ${drv.postPatch or ""} + substituteInPlace kore.cabal \ + --replace 'Paths_kore' ' ' + sed -i -z 's|import Paths_kore qualified as MetaData (\n version,\n )||' app/share/GlobalMain.hs + sed -i 's|packageVersion = showVersion MetaData.version|packageVersion = ""|' app/share/GlobalMain.hs + ''; + })).override { + # bit pathological, but ghc-compact is already included with the ghc compiler + # and depending on another copy of ghc-compact breaks HLS in the dev shell. + ghc-compact = null; }; - ghc.components.library.doHaddock = false; + tar = dontCheck hprev.tar; }; - }]; + # Additional packages that should be available for development. + additionalDevShellNativeBuildInputs = stacklockHaskellPkgSet: + with final; [ + haskell.packages.ghc928.cabal-install + haskellPackages.fourmolu_0_12_0_0 + (let + ghc-lib-parser = haskellPackages.ghc-lib-parser_9_4_5_20230430; + ghc-lib-parser-ex = + haskellPackages.ghc-lib-parser-ex_9_4_0_0.override { + inherit ghc-lib-parser; + }; + in haskellPackages.hlint_3_5.override { + inherit ghc-lib-parser ghc-lib-parser-ex; + }) + (haskell-language-server.override { + supportedGhcVersions = [ "928" ]; + }) + final.z3 + final.hpack + ]; + all-cabal-hashes = final.fetchurl { + url = + "https://github.com/commercialhaskell/all-cabal-hashes/archive/779bc22f8c7f8e3566edd5a4922750b73a0e5ed5.tar.gz"; + sha256 = "sha256-qJ/rrdjCTil5wBlcJQ0w+1NP9F/Cr7X/pAfnnx/ahLc="; + }; }; + }; - defaultCompiler = "ghc928"; - - # Get flake outputs for different GHC versions - flakesFor = pkgs: - let compilers = [ defaultCompiler ]; - - in builtins.listToAttrs (lib.lists.forEach compilers (compiler: - lib.attrsets.nameValuePair compiler - ((boosterBackendFor { inherit compiler pkgs; }).flake { })) - ++ lib.lists.forEach compilers (compiler: - lib.attrsets.nameValuePair (compiler + "-prof") - ((boosterBackendFor { - inherit compiler pkgs; - profiling = true; - }).flake { }))); - - # Takes an attribute set mapping compiler versions to `flake`s generated - # by `haskell.nix` (see `flakesFor` above) and suffixes each derivation - # in all flake outputs selected by `attr` with the corresponding compiler - # version, then flattens the resulting structure to combine all derivations - # into a single set - # - # collectOutputs - # "checks" - # { - # ghc8107 = { checks = { x:y:z = ; }; }; - # ghc924 = { checks = { x:y:z = ; }; }; - # } - # - # => { ghc8107:x:y:z = ; ghc924:x:y:z = ; } - collectOutputs = attr: flakes: - let - outputsByCompiler = lib.mapAttrsToList - (compiler: flake: { "${compiler}" = flake.${attr} or { }; }) flakes; - addPrefix = compiler: - lib.attrsets.mapAttrs' (output: drv: - lib.attrsets.nameValuePair "${compiler}:${output}" drv); - withPrefixes = - builtins.map (builtins.mapAttrs addPrefix) outputsByCompiler; - justOutputs = builtins.concatMap builtins.attrValues withPrefixes; - in builtins.foldl' (x: y: x // y) { } justOutputs; - - in { packages = perSystem (system: let - inherit (flakes.${defaultCompiler}) packages; pkgs = nixpkgsFor system; - flakes = flakesFor pkgs; + hs-backend-booster = with pkgs; + haskell.lib.justStaticExecutables + booster-backend.pkgSet.hs-backend-booster; in { - kore-rpc-booster = packages."hs-backend-booster:exe:kore-rpc-booster"; - booster-dev = packages."hs-backend-booster:exe:booster-dev"; - rpc-client = packages."hs-backend-booster:exe:rpc-client"; - parsetest = packages."hs-backend-booster:exe:parsetest"; - } // packages // collectOutputs "packages" flakes); - - apps = perSystem (system: - let - inherit (flakes.${defaultCompiler}) apps; - flakes = - flakesFor (nixpkgsFor system); - pkgs = nixpkgsFor system; - scripts = pkgs.symlinkJoin { - name = "scripts"; - paths = [ ./scripts ]; - buildInputs = [ pkgs.makeWrapper ]; - postBuild = '' - wrapProgram $out/update-haskell-backend.sh \ - --prefix PATH : ${ - with pkgs; - lib.makeBinPath [ nix gnused gnugrep jq ] - } - ''; - }; - - in { - kore-rpc-booster = apps."hs-backend-booster:exe:kore-rpc-booster"; - booster-dev = apps."hs-backend-booster:exe:booster-dev"; - rpc-client = apps."hs-backend-booster:exe:rpc-client"; - parsetest = apps."hs-backend-booster:exe:parsetest"; - parsetest-binary = apps."hs-backend-booster:exe:parsetest-binary"; - update-haskell-backend = { - type = "app"; - program = "${scripts}/update-haskell-backend.sh"; - }; - } // apps // collectOutputs "apps" flakes); - - # To enter a development environment for a particular GHC version, use - # the compiler name, e.g. `nix develop .#ghc8107` - devShells = perSystem (system: - let - flakes = - flakesFor (nixpkgsFor system); - in { - default = flakes.${defaultCompiler}.devShell; - } // lib.attrsets.mapAttrs' - (compiler: v: lib.attrsets.nameValuePair compiler v.devShell) flakes); - - # `nix build .#hs-backend-booster:test:unit-tests` - # - # To run a check for a particular compiler version, prefix the derivation - # name with the GHC version, e.g. - # - # `nix build .#ghc8107:hs-backend-booster:test:unit-tests` - checks = perSystem (system: - let - flakes = - flakesFor (nixpkgsFor system); - in flakes.${defaultCompiler}.checks // collectOutputs "checks" flakes); - - overlays.default = lib.composeManyExtensions [ - (final: prev: - lib.optionalAttrs (!(prev ? haskell-nix)) - (inputs.haskell-nix.overlays.combined final prev)) - (_: prev: - let - inherit (flakesFor prev) packages; - in { - kore-rpc-booster = - packages."hs-backend-booster:exe:kore-rpc-booster"; - rpc-client = packages."hs-backend-booster:exe:rpc-client"; - }) - ]; - - formatter = - perSystem (system: nixpkgs.legacyPackages.${system}.nixpkgs-fmt); + kore-rpc-booster = withZ3 pkgs hs-backend-booster "kore-rpc-booster"; + }); + + devShells = perSystem (system: { + # Separate cabal shell just for CI + cabal = let pkgs = nixpkgsFor system; + in pkgs.booster-backend.pkgSet.shellFor { + packages = pkgs.booster-backend.localPkgsSelector; + nativeBuildInputs = [ + pkgs.diffutils + pkgs.haskell.packages.ghc928.cabal-install + pkgs.hpack + pkgs.jq + pkgs.z3 + ]; + }; + }); + devShell = + perSystem (system: (nixpkgsFor system).booster-backend.devShell); }; } From a36279a75893ee16ab990d5d69c98cde945bafcd Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Wed, 18 Oct 2023 15:41:27 +0100 Subject: [PATCH 2/8] fix tests --- .github/workflows/test.yml | 4 ++-- scripts/integration-tests.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 scripts/integration-tests.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4fb7f6977..1445d9331 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -177,8 +177,8 @@ jobs: cabal-nix-${{ runner.os }}-ghc-${{ env.ghc_version }}- - name: Unit Tests - run: GC_DONT_GC=1 nix develop .#cabal --command bash -c "hpack && cabal update && cabal test --enable-tests --test-show-details=direct all" + run: GC_DONT_GC=1 nix develop .#cabal --command bash -c "hpack && cabal update && cabal test unit-tests --enable-tests --test-show-details=direct" - - name: Integration tests + - name: Integration Tests if: ${{ matrix.os != 'macos-12' }} ## takes long on public runner, already tested in MacM1 run: GC_DONT_GC=1 nix develop .#cabal --command bash -c "scripts/integration-tests.sh" \ No newline at end of file diff --git a/scripts/integration-tests.sh b/scripts/integration-tests.sh new file mode 100755 index 000000000..18d45d53b --- /dev/null +++ b/scripts/integration-tests.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -e +K_VERSION=$(cat deps/k_release) +PLUGIN_VERSION=$(cat deps/blockchain-k-plugin_release) +export PATH="$(nix build github:runtimeverification/k/v$K_VERSION#k.openssl.procps --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH" +cabal update +cabal test llvm-integration + +# The runDirectoryTest.sh script expects the following env vars to be set +export PLUGIN_DIR=$(nix build github:runtimeverification/blockchain-k-plugin/$PLUGIN_VERSION --no-link --json | jq -r '.[].outputs | to_entries[].value') +KORE_RPC_BOOSTER=$(cabal exec which kore-rpc-booster) +BOOSTER_DEV=$(cabal exec which booster-dev) +KORE_RPC_DEV=$(cabal exec which kore-rpc-dev) +export CLIENT=$(cabal exec which rpc-client) + +cd test/rpc-integration +for dir in $(ls -d test-*); do + name=${dir##test-} + echo "Running $name..." + if [ "$name" = "a-to-f" ] || [ "$name" = "diamond" ]; then + SERVER=$BOOSTER_DEV ./runDirectoryTest.sh test-$name --time + SERVER=$KORE_RPC_DEV ./runDirectoryTest.sh test-$name --time + SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time + elif [ "$name" = "vacuous" ]; then + SERVER=$KORE_RPC_DEV ./runDirectoryTest.sh test-$name + SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name + elif [ "$name" = "substitutions" ]; then + SERVER=$KORE_RPC_DEV ./runDirectoryTest.sh test-$name --time + SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time + elif [ "$name" = "no-evaluator" ]; then + SERVER=$BOOSTER_DEV ./runDirectoryTest.sh test-$name --time + else + SERVER=$KORE_RPC_BOOSTER ./runDirectoryTest.sh test-$name --time + fi +done \ No newline at end of file From e126c197eff243388e696f8e6825049d7472b65b Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Wed, 18 Oct 2023 15:41:42 +0100 Subject: [PATCH 3/8] fix cabal shell --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index d0333dbe5..9b54a1671 100644 --- a/flake.nix +++ b/flake.nix @@ -125,6 +125,7 @@ pkgs.haskell.packages.ghc928.cabal-install pkgs.hpack pkgs.jq + pkgs.nix pkgs.z3 ]; }; From ccdb93225576b9fb69843cde820e54e965abefb9 Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Wed, 18 Oct 2023 15:58:03 +0100 Subject: [PATCH 4/8] fix up script --- scripts/integration-tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/integration-tests.sh b/scripts/integration-tests.sh index 18d45d53b..a3f8213ec 100755 --- a/scripts/integration-tests.sh +++ b/scripts/integration-tests.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash -set -e +set -euxo pipefail + K_VERSION=$(cat deps/k_release) PLUGIN_VERSION=$(cat deps/blockchain-k-plugin_release) export PATH="$(nix build github:runtimeverification/k/v$K_VERSION#k.openssl.procps --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH" From 635440cde9c4ade910f37931bb3ec1ee05e313f4 Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Wed, 18 Oct 2023 16:02:50 +0100 Subject: [PATCH 5/8] fix up script --- scripts/integration-tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/integration-tests.sh b/scripts/integration-tests.sh index a3f8213ec..0a8a2ec69 100755 --- a/scripts/integration-tests.sh +++ b/scripts/integration-tests.sh @@ -9,6 +9,7 @@ cabal test llvm-integration # The runDirectoryTest.sh script expects the following env vars to be set export PLUGIN_DIR=$(nix build github:runtimeverification/blockchain-k-plugin/$PLUGIN_VERSION --no-link --json | jq -r '.[].outputs | to_entries[].value') +cabal build all KORE_RPC_BOOSTER=$(cabal exec which kore-rpc-booster) BOOSTER_DEV=$(cabal exec which booster-dev) KORE_RPC_DEV=$(cabal exec which kore-rpc-dev) From d767445e0f04743e5aefb12b9881d6d30dd3f2ab Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Wed, 18 Oct 2023 16:28:26 +0100 Subject: [PATCH 6/8] fix jq --- test/rpc-integration/test-logTiming/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rpc-integration/test-logTiming/test.sh b/test/rpc-integration/test-logTiming/test.sh index 046254249..cccafdffe 100755 --- a/test/rpc-integration/test-logTiming/test.sh +++ b/test/rpc-integration/test-logTiming/test.sh @@ -28,5 +28,5 @@ done echo "Running a request which gets stuck, with logTiming enabled" ${client} \ execute $dir/state-c.execute ${client_args} -O log-timing=true | \ - $JQ 'del(.result.logs[].time)' | \ + jq 'del(.result.logs[].time)' | \ ${diff} $dir/response-c.json From 7c34aed5a9f72b80053f8b9bf5101bcdbb45da80 Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Thu, 19 Oct 2023 09:31:43 +0100 Subject: [PATCH 7/8] update haskell backend to current master --- cabal.project | 4 +-- cabal.project.freeze | 69 +----------------------------------- deps/haskell-backend_release | 2 +- flake.lock | 8 ++--- flake.nix | 2 +- stack.yaml | 2 +- stack.yaml.lock | 10 +++--- 7 files changed, 15 insertions(+), 82 deletions(-) diff --git a/cabal.project b/cabal.project index ff2389e9e..b3e9c1e8d 100644 --- a/cabal.project +++ b/cabal.project @@ -17,7 +17,7 @@ source-repository-package source-repository-package type: git location: https://github.com/runtimeverification/haskell-backend.git - tag: c209383c259aee0ca8b0859a4160d5c5757721b6 - --sha256: sha256-GOf7T8VeC3sdpxNf5QyjzDWHAYeIZfbyCLd1aJVvfTI= + tag: 03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb + --sha256: subdir: kore kore-rpc-types diff --git a/cabal.project.freeze b/cabal.project.freeze index 534876c13..e29ec11c2 100644 --- a/cabal.project.freeze +++ b/cabal.project.freeze @@ -5,23 +5,16 @@ constraints: any.Cabal ==3.6.3.0, any.OneTuple ==0.3.1, any.Only ==0.1, any.QuickCheck ==2.14.3, - QuickCheck -old-random +templatehaskell, any.StateVar ==1.2.2, any.adjunctions ==4.4.2, any.aeson ==2.0.3.0, - aeson -cffi +ordered-keymap, any.aeson-pretty ==0.8.9, - aeson-pretty -lib-only, any.ansi-terminal ==0.11.4, - ansi-terminal -example +win32-2-13-1, any.ansi-wl-pprint ==0.6.9, - ansi-wl-pprint -example, any.array ==0.5.4.0, any.assoc ==1.0.2, any.async ==2.2.4, - async -bench, any.attoparsec ==0.14.4, - attoparsec -developer, any.auto-update ==0.1.6, any.barbies ==2.0.4.0, any.base ==4.16.4.0, @@ -31,42 +24,29 @@ constraints: any.Cabal ==3.6.3.0, any.base16 ==0.3.2.1, any.basement ==0.0.16, any.bifunctors ==5.5.15, - bifunctors +semigroups +tagged, any.binary ==0.8.9.0, any.blaze-builder ==0.4.2.2, any.blaze-html ==0.9.1.2, any.blaze-markup ==0.8.2.8, any.blaze-textual ==0.2.3.1, - blaze-textual -developer -integer-simple +native, any.boring ==0.2.1, - boring +tagged, any.bytebuild ==0.3.13.0, - bytebuild -checked, any.byteslice ==0.2.7.0, - byteslice +avoid-rawmemchr, any.bytesmith ==0.3.9.1, any.bytestring ==0.11.4.0, any.bz2 ==1.0.1.0, - bz2 -cross +with-bzlib, - any.c2hs ==0.28.8, - c2hs +base3 -regression, any.cabal-doctest ==1.0.9, any.call-stack ==0.4.0, any.case-insensitive ==1.2.1.0, any.casing ==0.1.4.1, any.cereal ==0.5.8.3, - cereal -bytestring-builder, any.cereal-conduit ==0.8.0, any.chronos ==1.1.5, any.clock ==0.8.3, - clock -llvm, - any.cmdargs ==0.10.22, - cmdargs +quotation -testprog, any.co-log ==0.5.0.0, any.co-log-core ==0.3.2.0, any.colour ==2.3.6, any.comonad ==5.0.8, - comonad +containers +distributive +indexed-traversable, any.concurrent-output ==1.10.18, any.conduit ==1.3.5, any.conduit-extra ==1.3.6, @@ -74,9 +54,7 @@ constraints: any.Cabal ==3.6.3.0, any.containers ==0.6.5.1, any.contiguous ==0.6.3.0, any.contravariant ==1.5.5, - contravariant +semigroups +statevar +tagged, any.cryptonite ==0.30, - cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes, any.data-array-byte ==0.1.0.1, any.data-default ==0.7.1.1, any.data-default-class ==0.1.2.0, @@ -88,22 +66,17 @@ constraints: any.Cabal ==3.6.3.0, any.deepseq ==1.4.6.1, any.deriving-aeson ==0.2.9, any.direct-sqlite ==2.3.28, - direct-sqlite +fulltextsearch +haveusleep +json1 -systemlib +urifilenames, any.directory ==1.3.6.2, any.distributive ==0.6.2.1, - distributive +semigroups +tagged, any.dlist ==1.0, - dlist -werror, any.easy-file ==0.2.5, any.entropy ==0.4.1.10, - entropy -donotgetentropy, any.erf ==2.0.0.0, any.errors ==2.3.0, any.exceptions ==0.10.4, any.extra ==1.7.13, any.fast-logger ==3.1.2, any.fgl ==5.7.0.3, - fgl +containers042, any.filepath ==1.4.2.2, any.free ==5.1.10, any.generic-lens ==2.2.2.0, @@ -120,13 +93,9 @@ constraints: any.Cabal ==3.6.3.0, any.ghci ==9.2.8, any.gitrev ==1.3.1, any.graphviz ==2999.20.1.0, - graphviz -test-parsing, any.hashable ==1.4.2.0, - hashable +integer-gmp -random-initial-seed, any.hashtables ==1.3.1, - hashtables -bounds-checking -debug -detailed-profiling -portable -sse42 +unsafe-tricks, any.haskeline ==0.8.2.1, - haskeline +examples +terminfo, any.haskell-lexer ==1.1.1, any.haskell-src-exts ==1.23.1, any.haskell-src-meta ==0.8.12, @@ -145,7 +114,6 @@ constraints: any.Cabal ==3.6.3.0, any.indexed-traversable-instances ==0.1.1.2, any.integer-gmp ==1.1, any.integer-logarithms ==1.0.3.1, - integer-logarithms -check-bounds +integer-gmp, any.intern ==0.9.4, any.invariant ==0.6.1, any.json-rpc ==1.0.4, @@ -155,29 +123,21 @@ constraints: any.Cabal ==3.6.3.0, kore +threaded, any.kore-rpc-types ==0.60.0.0, any.language-c ==0.9.2, - language-c -allwarnings +iecfpextension +usebytestrings, any.lens ==5.1.1, - lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy, any.libyaml ==0.1.2, - libyaml -no-unicode -system-libyaml, any.lifted-async ==0.10.2.4, any.lifted-base ==0.2.3.12, any.logict ==0.8.0.0, any.loop ==0.3.0, any.markdown-unlit ==0.5.1, any.math-functions ==0.3.4.2, - math-functions +system-erf +system-expm1, any.matrix ==0.3.6.1, any.megaparsec ==9.2.2, - megaparsec -dev, any.memory ==0.17.0, - memory +support_bytestring +support_deepseq, any.mmorph ==1.2.0, any.monad-control ==1.0.3.1, any.monad-logger ==0.3.40, - monad-logger +template_haskell, any.monad-loops ==0.4.3, - monad-loops +base4, any.monad-validate ==1.2.0.1, any.mono-traversable ==1.0.15.3, any.mtl ==2.2.2, @@ -185,22 +145,18 @@ constraints: any.Cabal ==3.6.3.0, any.mwc-random ==0.15.0.2, any.natural-arithmetic ==0.1.4.0, any.network ==3.1.4.0, - network -devel, any.network-run ==0.2.5, any.old-locale ==1.0.0.7, any.old-time ==1.1.0.3, any.optparse-applicative ==0.17.1.0, - optparse-applicative +process, any.parallel ==3.2.2.0, any.parsec ==3.1.15.0, any.parser-combinators ==1.3.0, - parser-combinators -dev, any.polyparse ==1.13, any.pqueue ==1.4.3.0, any.pretty ==1.1.3.6, any.pretty-show ==1.10, any.prettyprinter ==1.7.1, - prettyprinter -buildreadme +text, any.primitive ==0.7.3.0, any.primitive-addr ==0.1.0.2, any.primitive-offset ==0.2.0.0, @@ -210,9 +166,7 @@ constraints: any.Cabal ==3.6.3.0, any.quickcheck-io ==0.2.0, any.random ==1.2.1.1, any.recursion-schemes ==5.2.2.4, - recursion-schemes +template-haskell, any.reflection ==2.1.7, - reflection -slow +template-haskell, any.regex-base ==0.94.0.2, any.regex-pcre-builtin ==0.95.2.3.8.44, any.resourcet ==1.2.6, @@ -221,34 +175,25 @@ constraints: any.Cabal ==3.6.3.0, any.safe ==0.3.19, any.safe-exceptions ==0.1.7.3, any.scientific ==0.3.7.0, - scientific -bytestring-builder -integer-simple, any.secp256k1-haskell ==0.6.1, any.semialign ==1.2.0.1, - semialign +semigroupoids, any.semigroupoids ==5.3.7, - semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, any.semigroups ==0.20, - semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers, any.setenv ==0.1.1.3, any.sop-core ==0.5.0.2, any.split ==0.2.3.5, any.splitmix ==0.1.0.4, - splitmix -optimised-mixer, any.sqlite-simple ==0.4.18.2, any.stm ==2.5.0.2, any.stm-chans ==3.0.0.9, any.stm-conduit ==4.0.1, any.streaming-commons ==0.2.2.6, - streaming-commons -use-bytestring-builder, any.streams ==3.3.2, any.strict ==0.4.0.1, - strict +assoc, any.string-conversions ==0.4.0.1, any.syb ==0.7.2.3, any.tagged ==0.8.6.1, - tagged +deepseq +transformers, any.tar ==0.5.1.1, - tar -old-bytestring -old-time, any.tasty ==1.4.3, tasty +unix, any.tasty-discover ==5.0.0, @@ -263,7 +208,6 @@ constraints: any.Cabal ==3.6.3.0, any.terminfo ==0.4.1.5, any.text ==1.2.5.0, any.text-short ==0.1.5, - text-short -asserts, any.tf-random ==0.5, any.th-abstraction ==0.4.5.0, any.th-compat ==0.1.4, @@ -272,36 +216,27 @@ constraints: any.Cabal ==3.6.3.0, any.th-orphans ==0.13.14, any.th-reify-many ==0.1.10, any.these ==1.1.1.1, - these +assoc, any.time ==1.11.1.1, any.time-compat ==1.9.6.1, - time-compat -old-locale, any.torsor ==0.1, any.transformers ==0.5.6.2, any.transformers-base ==0.4.6, - transformers-base +orphaninstances, any.transformers-compat ==0.7.2, - transformers-compat -five +five-three -four +generic-deriving +mtl -three -two, any.tuples ==0.1.0.0, any.type-equality ==1, any.typed-process ==0.2.11.0, any.typerep-map ==0.5.0.0, any.unix ==2.7.2.2, any.unix-compat ==0.5.4, - unix-compat -old-time, any.unix-time ==0.4.9, any.unliftio ==0.2.25.0, any.unliftio-core ==0.2.1.0, any.unordered-containers ==0.2.19.1, - unordered-containers -debug, any.utf8-string ==1.0.2, any.uuid-types ==1.0.5, any.vector ==0.12.3.1, - vector +boundschecks -internalchecks -unsafechecks -wall, any.vector-algorithms ==0.8.0.4, - vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, any.void ==0.7.3, - void -safe, any.wide-word ==0.1.5.0, any.witherable ==0.4.2, any.wl-pprint-annotated ==0.1.0.1, @@ -309,8 +244,6 @@ constraints: any.Cabal ==3.6.3.0, any.xml-conduit ==1.9.1.2, any.xml-types ==0.3.8, any.yaml ==0.11.11.1, - yaml +no-examples +no-exe, any.zigzag ==0.0.1.0, - any.zlib ==0.6.3.0, - zlib -bundled-c-zlib -non-blocking-ffi -pkg-config + any.zlib ==0.6.3.0 index-state: hackage.haskell.org 2023-06-28T20:31:18Z diff --git a/deps/haskell-backend_release b/deps/haskell-backend_release index ac02d2d44..8bfe5e8d7 100644 --- a/deps/haskell-backend_release +++ b/deps/haskell-backend_release @@ -1 +1 @@ -c209383c259aee0ca8b0859a4160d5c5757721b6 +03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb diff --git a/flake.lock b/flake.lock index b4d507c8d..4bdcf120b 100644 --- a/flake.lock +++ b/flake.lock @@ -7,17 +7,17 @@ "z3": "z3" }, "locked": { - "lastModified": 1697454961, - "narHash": "sha256-NiEpxJswB25ZjrNtiwoqUmYROo3nXaeyQ/EJEO9E0Kk=", + "lastModified": 1697702407, + "narHash": "sha256-r9c5qpgoejKJePbxqq01QkHx/wZNypY/fUSugsapF8w=", "owner": "runtimeverification", "repo": "haskell-backend", - "rev": "3cd32d15ebe78b37c58c419a9552aca9b799dd32", + "rev": "03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb", "type": "github" }, "original": { "owner": "runtimeverification", "repo": "haskell-backend", - "rev": "3cd32d15ebe78b37c58c419a9552aca9b799dd32", + "rev": "03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 9b54a1671..04a97813d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "hs-backend-booster"; inputs = { - haskell-backend.url = "github:runtimeverification/haskell-backend/3cd32d15ebe78b37c58c419a9552aca9b799dd32"; + haskell-backend.url = "github:runtimeverification/haskell-backend/03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb"; stacklock2nix.follows = "haskell-backend/stacklock2nix"; nixpkgs.follows = "haskell-backend/nixpkgs"; }; diff --git a/stack.yaml b/stack.yaml index ecf60347d..9317a20b2 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,7 +11,7 @@ extra-deps: - typerep-map-0.5.0.0 - monad-validate-1.2.0.1 - git: https://github.com/runtimeverification/haskell-backend.git - commit: c209383c259aee0ca8b0859a4160d5c5757721b6 + commit: 03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb subdirs: - kore - kore-rpc-types diff --git a/stack.yaml.lock b/stack.yaml.lock index b8c0c9555..415822cd3 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -40,20 +40,20 @@ packages: original: hackage: monad-validate-1.2.0.1 - completed: - commit: c209383c259aee0ca8b0859a4160d5c5757721b6 + commit: 03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb git: https://github.com/runtimeverification/haskell-backend.git name: kore pantry-tree: - sha256: a6d0a2d6a079a06a1988249ced87ce7ddd58ab6bf151e3a8861f18b263f66f32 + sha256: 192e508342512877e3e3268d07d9ab6545470c4aa5de2396ff9d9c4b74080f10 size: 44685 subdir: kore version: 0.60.0.0 original: - commit: c209383c259aee0ca8b0859a4160d5c5757721b6 + commit: 03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb git: https://github.com/runtimeverification/haskell-backend.git subdir: kore - completed: - commit: c209383c259aee0ca8b0859a4160d5c5757721b6 + commit: 03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb git: https://github.com/runtimeverification/haskell-backend.git name: kore-rpc-types pantry-tree: @@ -62,7 +62,7 @@ packages: subdir: kore-rpc-types version: 0.60.0.0 original: - commit: c209383c259aee0ca8b0859a4160d5c5757721b6 + commit: 03a6228f78d7f4805fee4b9d9c45208dcbe0c9fb git: https://github.com/runtimeverification/haskell-backend.git subdir: kore-rpc-types snapshots: From a97d156db9176c4cb9486e994ade82fcb54bb23b Mon Sep 17 00:00:00 2001 From: Sam Balco Date: Thu, 19 Oct 2023 09:43:21 +0100 Subject: [PATCH 8/8] remove hacks around Paths_kore --- flake.nix | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 04a97813d..681722f72 100644 --- a/flake.nix +++ b/flake.nix @@ -57,20 +57,7 @@ buildTarget = "kore-rpc-booster"; }); json-rpc = dontCheck hprev.json-rpc; - kore = (overrideCabal hprev.kore (drv: { - doCheck = false; - buildTarget = "kore"; - # Patch kore to remove Paths_kore from GlobalMain, which prevents nix stripping kore as a runtime dependency. - # This happens because Paths_kore hard-codes paths to the kore library in the nix store and - # ghc does not optimise these away even though they are not used by the booster; hence they end up in the executables - postPatch = '' - ${drv.postPatch or ""} - substituteInPlace kore.cabal \ - --replace 'Paths_kore' ' ' - sed -i -z 's|import Paths_kore qualified as MetaData (\n version,\n )||' app/share/GlobalMain.hs - sed -i 's|packageVersion = showVersion MetaData.version|packageVersion = ""|' app/share/GlobalMain.hs - ''; - })).override { + kore = (dontCheck hprev.kore).override { # bit pathological, but ghc-compact is already included with the ghc compiler # and depending on another copy of ghc-compact breaks HLS in the dev shell. ghc-compact = null;