Skip to content

Commit 9c0594b

Browse files
committed
Add CI, nix build, pin nixpkgs.
In lieu of the dap updates, and ghc-whole-program-compiler project updates (to GHC-9.6.6+), we should now be able to test the haskell-debugger with our new dap changes. This is the second PR in a set to upgrade and abstract some facilities for preparing a dap release. - Put project under CI (for both cabal and nix) - Introduce a nixpkgs infra w/ pinning - Add builds for the souffle static analysis C++ code (will make avaialble during runtime)
1 parent 90146ef commit 9c0594b

File tree

6 files changed

+217
-20
lines changed

6 files changed

+217
-20
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Haskell Debugger CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
if: github.ref != 'refs/heads/master'
12+
steps:
13+
- uses: DeterminateSystems/nix-installer-action@main
14+
15+
- name: Nix channel update
16+
run: nix-channel --update
17+
18+
- name: Cabal install
19+
run: nix-env -iA cabal-install -f .
20+
21+
- name: Cabal update
22+
run: cabal update
23+
24+
- name: Install ghc, bzip2 and zlib as build-time dependencies
25+
run: nix-env -iA pkgs.ghc pkgs.bzip2.dev pkgs.zlib.dev -f .
26+
27+
- name: (x86 - C++) Build ext-stg-gc (souffle-produced reachability analysis for GC)
28+
run: nix-build -A ext-stg-gc
29+
30+
- name: (x86 - GHC 9.6.6) Build dap-estgi-server w/ cabal
31+
run: cabal build dap-estgi-server
32+
33+
- name: (x86 - GHC 9.6.6) Build dap-estgi-server w/ nix
34+
run: nix-build -A dap-estgi-server

cabal.project

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1-
packages: dap-estgi-server
1+
packages:
2+
dap-estgi-server
23

34
source-repository-package
4-
type: git
5-
location: https://github.com/TeofilC/digest
6-
tag: ac9616b94cb8c4a9e07188d19979a6225ebd5a10
5+
type: git
6+
location: https://github.com/david-christiansen/final-pretty-printer
7+
tag: 048e8fa2d8b2b7a6f9e4e209db4f67361321eec8
78

89
source-repository-package
9-
type: git
10-
location: https://github.com/haskell-debugger/dap
11-
tag: 3784cc0e703cbe300d4e4874328b8b8dd998ea5f
10+
type: git
11+
location: https://github.com/luc-tielen/souffle-haskell
12+
tag: 268a11283ca9293b5eacabf7a0b79d9368232478
13+
14+
source-repository-package
15+
type: git
16+
location: https://github.com/TeofilC/digest
17+
tag: ac9616b94cb8c4a9e07188d19979a6225ebd5a10
18+
19+
source-repository-package
20+
type: git
21+
location: https://github.com/haskell-debugger/dap
22+
tag: 56d44d27c0cc509fc3e8198de448dbb2e9a6380f
1223

1324
source-repository-package
1425
type: git
15-
location: https://github.com/grin-compiler/ghc-whole-program-compiler-project
16-
tag: 80e408ebdeaf5c1cea72bfbf86823c32d4fdafbe
26+
location: https://github.com/haskell-debugger/ghc-whole-program-compiler-project
27+
tag: d058105b0bee1ab2e7c7aefd36bf9e0be6e840b7
1728
subdir:
1829
external-stg
1930
external-stg-syntax
2031
external-stg-interpreter
2132

22-
source-repository-package
23-
type: git
24-
location: https://github.com/luc-tielen/souffle-haskell
25-
tag: f8c9fc45eed709110af3d3301393f63f4535c71e
26-
27-
constraints:
28-
type-errors-pretty == 0.0.1.2,
29-
souffle-haskell == 3.4.0
33+
package external-stg-interpreter
34+
flags: +external-ext-stg-gc
3035

31-
package digest
32-
flags: -pkg-config
36+
package external-stg-compiler
37+
flags: +external-ext-stg-liveness
3338

34-
allow-newer: type-errors-pretty:base
39+
allow-newer: type-errors-pretty:base

default.nix

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
with (builtins.fromJSON (builtins.readFile ./nixpkgs.json));
2+
3+
{ nixpkgs ? builtins.fetchTarball {
4+
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
5+
inherit sha256;
6+
}
7+
}:
8+
9+
let
10+
# all the nix things
11+
pkgs = import nixpkgs {};
12+
sources = builtins.fromJSON (builtins.readFile ./source.json);
13+
14+
ghc-wpo-src =
15+
pkgs.fetchFromGitHub sources.ghc-whole-program-compiler-project;
16+
17+
# this is the reachability analysis binary (cretaed by souffle) that runs
18+
# the mark n' sweep GC pass. This is call by the external-stg-intepreter.
19+
ext-stg-gc =
20+
pkgs.stdenv.mkDerivation {
21+
name = "ext-stg-gc";
22+
src = "${ghc-wpo-src}/external-stg-interpreter";
23+
buildInputs = with pkgs; [ souffle openmpi ];
24+
buildPhase = ''
25+
mkdir -pv $out/bin
26+
g++ -fopenmp $src/datalog/ext-stg-gc.cpp \
27+
-D_OPENMP -std=c++17 \
28+
-o $out/bin/ext-stg-gc
29+
'';
30+
};
31+
32+
overrides = self: super: with pkgs.haskell.lib; {
33+
34+
type-errors-pretty = dontCheck (
35+
doJailbreak (
36+
self.callCabal2nix
37+
"type-errors-pretty"
38+
(pkgs.fetchFromGitHub sources.type-errors-pretty)
39+
{}
40+
)
41+
);
42+
43+
digest =
44+
self.callCabal2nix
45+
"digest"
46+
(pkgs.fetchFromGitHub sources.digest)
47+
{};
48+
49+
final-pretty-printer = doJailbreak (
50+
self.callCabal2nix
51+
"final-pretty-printer"
52+
(pkgs.fetchFromGitHub sources.final-pretty-printer)
53+
{}
54+
);
55+
56+
dap = doJailbreak (
57+
self.callCabal2nix
58+
"dap"
59+
(pkgs.fetchFromGitHub sources.dap)
60+
{}
61+
);
62+
63+
dap-estgi-server =
64+
self.callCabal2nix
65+
"dap-estgi-server"
66+
./dap-estgi-server
67+
{};
68+
69+
external-stg =
70+
self.callCabal2nix
71+
"external-stg"
72+
"${ghc-wpo-src}/external-stg"
73+
{};
74+
75+
external-stg-syntax =
76+
self.callCabal2nix
77+
"external-stg-syntax"
78+
"${ghc-wpo-src}/external-stg-syntax"
79+
{};
80+
81+
external-stg-interpreter =
82+
self.callCabal2nixWithOptions
83+
"external-stg-interpreter"
84+
"${ghc-wpo-src}/external-stg-interpreter"
85+
"-fexternal-ext-stg-gc"
86+
{};
87+
88+
souffle-haskell =
89+
dontCheck
90+
(doJailbreak
91+
(self.callCabal2nix "souffle-haskell"
92+
(pkgs.fetchFromGitHub sources.souffle-haskell) {}
93+
));
94+
};
95+
96+
hPkgs =
97+
pkgs.haskellPackages.override { inherit overrides; };
98+
99+
in
100+
101+
# this is the set we export for CI, and for shell.nix
102+
{
103+
inherit (hPkgs) dap-estgi-server;
104+
inherit ext-stg-gc;
105+
inherit pkgs;
106+
}

nixpkgs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"rev" : "88e992074d86",
3+
"sha256" : "sha256:1k5iv13faiyar5bsfw5klaz898662kcfyn85w5jrl2qkavf6y0y7"
4+
}

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(import ./default.nix {}).dap-estgi-server.env

source.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"dap": {
3+
"fetchSubmodules": true,
4+
"leaveDotGit": false,
5+
"owner": "haskell-debugger",
6+
"repo": "dap",
7+
"rev": "56d44d27c0cc509fc3e8198de448dbb2e9a6380f",
8+
"sha256": "sha256-/FKfSyYJuzXqyBu/yFTlVBQYJ4SXgLGDzQ5xAdXajCE="
9+
},
10+
"digest": {
11+
"fetchSubmodules": true,
12+
"leaveDotGit": false,
13+
"owner": "TeofilC",
14+
"repo": "digest",
15+
"rev": "ac9616b94cb8c4a9e07188d19979a6225ebd5a10",
16+
"sha256": "sha256-2n2SV4GYAwd09QfWynlxgeCrsj49UI3He6X66ynqfSA="
17+
},
18+
"final-pretty-printer": {
19+
"fetchSubmodules": true,
20+
"leaveDotGit": false,
21+
"owner": "david-christiansen",
22+
"repo": "final-pretty-printer",
23+
"rev": "048e8fa2d8b2b7a6f9e4e209db4f67361321eec8",
24+
"sha256": "0d5ya1n85qgs59p2wlx501qa1nrlk7y20riydfknfqkr0fswcpnf"
25+
},
26+
"ghc-whole-program-compiler-project": {
27+
"fetchSubmodules": true,
28+
"leaveDotGit": false,
29+
"owner": "dmjio",
30+
"repo": "ghc-whole-program-compiler-project",
31+
"rev": "d058105b0bee1ab2e7c7aefd36bf9e0be6e840b7",
32+
"sha256": "sha256-lNNZRaJwHVPRi59pXEsWzxGrOJqwiAR2g56khKq8bic="
33+
},
34+
"souffle-haskell" : {
35+
"owner" : "luc-tielen",
36+
"repo" : "souffle-haskell",
37+
"rev" : "268a11283ca9293b5eacabf7a0b79d9368232478",
38+
"hash" : "sha256-n8qqNmrDNxLlM7FRfa1Da58jGCNWjBp9+B/yV3U98gg="
39+
},
40+
"type-errors-pretty": {
41+
"fetchSubmodules": false,
42+
"owner": "kowainik",
43+
"repo": "type-errors-pretty",
44+
"rev": "c85d6d0a7bf2278ddb03abddb5782a5b6095d343",
45+
"sha256": "1yylw5c8ffzybcv7cm6ff0k88an4iz0fhc59md09s9zlns03f3d0"
46+
}
47+
}

0 commit comments

Comments
 (0)