8000 Add CI, nix, incorporate GHC updates by dmjio · Pull Request #23 · haskell-debugger/haskell-estgi-debugger · GitHub
[go: up one dir, main page]

Skip to content

Add CI, nix, incorporate GHC updates #23

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

Merged
merged 11 commits into from
May 1, 2025
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Haskell Debugger CI
on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
- uses: DeterminateSystems/nix-installer-action@main
- uses: actions/checkout@v3.5.3
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixpkgs-unstable

- name: Nix channel update
run: nix-channel --update

- name: Cabal install
run: nix-env -iA pkgs.cabal-install -f .

- name: Cabal update
run: cabal update

- name: (x86 - C++) Build ext-stg-gc (souffle-produced reachability analysis for GC)
run: nix-build -A ext-stg-gc

- name: (x86 - GHC 9.6.6) Build dap-estgi-server w/ nix
run: nix-build -A dap-estgi-server

# - name: (x86 - GHC 9.6.6) Build dap-estgi-server w/ cabal
# run: nix-shell -p pkgs.ghc -p pkgs.bzip2.dev -p pkgs.zlib.dev --run 'cabal build dap-estgi-server' -I=.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Haskell ESTGi Debugger
# Haskell ESTGi Debugger ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/haskell-debugger/haskell-estgi-debugger/main.yml?style=flat-square)


# Table of Contents
1. [Introduction](#introduction)
Expand Down
42 changes: 25 additions & 17 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
packages: dap-estgi-server
packages:
dap-estgi-server

source-repository-package
type: git
location: https://github.com/TeofilC/digest
tag: ac9616b94cb8c4a9e07188d19979a6225ebd5a10
type: git
location: https://github.com/david-christiansen/final-pretty-printer
tag: 048e8fa2d8b2b7a6f9e4e209db4f67361321eec8

source-repository-package
type: git
location: https://github.com/haskell-debugger/dap
tag: 3784cc0e703cbe300d4e4874328b8b8dd998ea5f
type: git
location: https://github.com/luc-tielen/souffle-haskell
tag: 268a11283ca9293b5eacabf7a0b79d9368232478

source-repository-package
type: git
location: https://github.com/TeofilC/digest
tag: 27ffb6396ef322c5185bc919cae563ac449ba235

source-repository-package
type: git
location: https://github.com/haskell-debugger/dap
tag: 99543ed

source-repository-package
type: git
location: https://github.com/grin-compiler/ghc-whole-program-compiler-project
tag: 80e408ebdeaf5c1cea72bfbf86823c32d4fdafbe
location: https://github.com/haskell-debugger/ghc-whole-program-compiler-project
tag: d058105b0bee1ab2e7c7aefd36bf9e0be6e840b7
subdir:
external-stg
external-stg-syntax
external-stg-interpreter

source-repository-package
type: git
location: https://github.com/luc-tielen/souffle-haskell
tag: f8c9fc45eed709110af3d3301393f63f4535c71e
package external-stg-interpreter
flags: +external-ext-stg-gc

constraints:
type-errors-pretty == 0.0.1.2,
souffle-haskell == 3.4.0
package external-stg-compiler
flags: +external-ext-stg-liveness

package digest
flags: -pkg-config

allow-newer: type-errors-pretty:base
allow-newer: type-errors-pretty:base
107 changes: 107 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
with (builtins.fromJSON (builtins.readFile ./nixpkgs.json));

{ nixpkgs ? builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
inherit sha256;
}
}:

let
# all the nix things
pkgs = import nixpkgs {};
sources = builtins.fromJSON (builtins.readFile ./source.json);

ghc-wpo-src =
pkgs.fetchFromGitHub sources.ghc-whole-program-compiler-project;

# this is the reachability analysis binary (cretaed by souffle) that runs
# the mark n' sweep GC pass. This is call by the external-stg-intepreter.
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 \
-Wl,-u,__factory_Sf_ext_stg_gc_instance \
-std=c++17 \
-o $out/bin/ext-stg-gc
'';
};

overrides = self: super: with pkgs.haskell.lib; {

type-errors-pretty = dontCheck (
doJailbreak (
self.callCabal2nix
"type-errors-pretty"
(pkgs.fetchFromGitHub sources.type-errors-pretty)
{}
)
);

digest =
self.callCabal2nix
"digest"
(pkgs.fetchFromGitHub sources.digest)
{};

final-pretty-printer = doJailbreak (
self.callCabal2nix
"final-pretty-printer"
(pkgs.fetchFromGitHub sources.final-pretty-printer)
{}
);

dap = doJailbreak (
self.callCabal2nix
"dap"
(pkgs.fetchFromGitHub sources.dap)
{}
);

dap-estgi-server =
self.callCabal2nix
"dap-estgi-server"
./dap-estgi-server
{};

external-stg =
self.callCabal2nix
"external-stg"
"${ghc-wpo-src}/external-stg"
{};

external-stg-syntax =
self.callCabal2nix
"external-stg-syntax"
"${ghc-wpo-src}/external-stg-syntax"
{};

external-stg-interpreter =
self.callCabal2nixWithOptions
"external-stg-interpreter"
"${ghc-wpo-src}/external-stg-interpreter"
"-fexternal-ext-stg-gc"
{};

souffle-haskell =
dontCheck
(doJailbreak
(self.callCabal2nix "souffle-haskell"
(pkgs.fetchFromGitHub sources.souffle-haskell) {}
));
};

hPkgs =
pkgs.haskellPackages.override { inherit overrides; };

in

# this is the set we export for CI, and for shell.nix
{
inherit (hPkgs) dap-estgi-server;
inherit ext-stg-gc;
inherit pkgs;
}
4 changes: 4 additions & 0 deletions nixpkgs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"rev" : "88e992074d86",
"sha256" : "sha256:1k5iv13faiyar5bsfw5klaz898662kcfyn85w5jrl2qkavf6y0y7"
}
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import ./default.nix {}).dap-estgi-server.env
47 changes: 47 additions & 0 deletions source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"dap": {
"fetchSubmodules": true,
"leaveDotGit": false,
"owner": "haskell-debugger",
"repo": "dap",
"rev": "56d44d27c0cc509fc3e8198de448dbb2e9a6380f",
"sha256": "sha256-/FKfSyYJuzXqyBu/yFTlVBQYJ4SXgLGDzQ5xAdXajCE="
},
"digest": {
"fetchSubmodules": true,
"leaveDotGit": false,
"owner": "TeofilC",
"repo": "digest",
"rev": "ac9616b94cb8c4a9e07188d19979a6225ebd5a10",
"sha256": "sha256-2n2SV4GYAwd09QfWynlxgeCrsj49UI3He6X66ynqfSA="
},
"final-pretty-printer": {
"fetchSubmodules": true,
"leaveDotGit": false,
"owner": "david-christiansen",
"repo": "final-pretty-printer",
"rev": "048e8fa2d8b2b7a6f9e4e209db4f67361321eec8",
"sha256": "0d5ya1n85qgs59p2wlx501qa1nrlk7y20riydfknfqkr0fswcpnf"
},
"ghc-whole-program-compiler-project": {
"fetchSubmodules": true,
"leaveDotGit": false,
"owner": "haskell-debugger",
"repo": "ghc-whole-program-compiler-project",
"rev": "65ecaed",
"sha256": "sha256-T9dUWUrGeva8ghwQ5Pu1paBbBgyjoTp3SQreHs94WRQ="
},
"souffle-haskell" : {
"owner" : "luc-tielen",
"repo" : "souffle-haskell",
"rev" : "268a11283ca9293b5eacabf7a0b79d9368232478",
"hash" : "sha256-n8qqNmrDNxLlM7FRfa1Da58jGCNWjBp9+B/yV3U98gg="
},
"type-errors-pretty": {
"fetchSubmodules": false,
"owner": "kowainik",
"repo": "type-errors-pretty",
"rev": "c85d6d0a7bf2278ddb03abddb5782a5b6095d343",
"sha256": "1yylw5c8ffzybcv7cm6ff0k88an4iz0fhc59md09s9zlns03f3d0"
}
}
0