GHC 9.6+ updates
Hey @csabahruska,
In preparation for @mpickering and @alt-romes to release an alpha version of dap integration w/ GHC, I'd like to ensure that our work with the haskell-estgi-debugger is building along with the coming dap changes.
This PR updates the external-stg-interpreter, external-stg and external-stg-syntax to build with GHC 9.6+.
Things done:
- [x] Adjusted primops and tests for 64-bit
WordandIntsinceghc-primhad slightly changed (primop tests pass now ✅ ) - [x]
cabal.projectfile was added and it does build with the latestsouffle-haskell-0.4.0.0and a working version offinal-pretty - [x] A cabal flag was introduced (
-fexternal-ext-stg-gcand-fexternal-ext-liveness-analysis-- disabled by default in the cabal file - but enabled by default incabal.project) to allow users to build thesoufflegenerated C++ by hand. This simplifies the build, andrunSouffleis able to find theext-stg-gcbinary in$PATH. - [x] Re-introduced
import Control.Monad, it was decided thatControl.Monadshould no longer be re-exported frommtlmodules. - [x] Adds a github workflow file. This workflow will use cabal's resolver to build the Haskell code, and nix to acquire
bzip2andzlib. - [x] Adds a github workflow badge to the README.md
neWord16# [✔]
+++ OK, passed 100 tests.
Finished in 0.0904 seconds
240 examples, 0 failures
Test suite primop-test: PASS
Test suite logged to:
/home/dmjio/Desktop/ghc-whole-program-compiler-project/dist-newstyle/build/x86_64-linux/ghc-9.6.6/external-stg-interpreter-0.1.0.1/t/primop-test/test/external-stg-interpreter-0.1.0.1-primop-test.log
1 of 1 test suites (1 of 1 test cases) passed.
^ these tests should run in CI now
Then in the haskell-debugger I'm able to make ext-stg-gc available on PATH so runSouffle will always be able to find it, when we call the external-stg-interpreter from haskell-debugger.
ext-stg-gc =
pkgs.stdenv.mkDerivation {
name = "ext-stg-gc";
src = "${ghc-wpo-src}/external-stg-interpreter";
buildInputs = with pkgs; [ souffle openmpi ];
buildPhase = ''
mkdir -pv $out/bin
g++ -fopenmp $src/datalog/ext-stg-gc.cpp \
-D_OPENMP -std=c++17 \
-o $out/bin/ext-stg-gc
'';
};
```
Since we've updated souffle, we've regen'd the reachability analysis for GC (per the README.md instructions).
It seems to build and do the right thing (checks roots for mark and sweep)
❯ $(nix-build -A ext-stg-gc)/bin/ext-stg-gc
Error loading GCRoot data: Cannot open fact file GCRoot.facts