Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 344044c

Browse files
authored
Flesh out protocol (#1)
* - Added support for external-stg-interpreter - Added logging - Added hello example (working build with wpc-plugin) - Session TVar Map is now global - Added local connection locking - Fleshed out Event / Responses API - Made SeqNum an IORef - Added registerDebugSession and facilities to both run a new debugger and cancel execution - Added more facilities for parsing JSON - Updated haddocking - Working nix and stack builds * Update top-level DAP.hs exports
1 parent 2bf312c commit 344044c

File tree

24 files changed

+1280
-399
lines changed

24 files changed

+1280
-399
lines changed

‎.gitignore‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ main
3232
# C
3333
./main
3434
*.dSYM
35-
a.out
35+
36+
# stg
37+
*.fullpak
38+
*.modpak
39+
40+
# tags
41+
tags

‎dap-extension/package.json‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"vscode": "^1.77.0"
88
},
99
"categories": [
10-
"Other"
10+
"Debuggers"
1111
],
1212
"activationEvents": [ "onDebug", "onDebugResolve:dap-extension" ],
1313
"main": "./out/extension.js",
@@ -16,18 +16,18 @@
1616
{
1717
"type": "dap-extension",
1818
"languages": [
19-
"C"
19+
"Haskell"
2020
],
21-
"program": "${workspaceFolder}/a.out",
21+
"program": "${workspaceFolder}/test.fullpak",
2222
"label": "dap-extension",
2323
"configurationAttributes": {
2424
"attach": {
2525
"required": ["program"],
2626
"properties": {
2727
"program": {
2828
"type": "string",
29-
"description": "Absolute path to the C program compiled with debugging (-g)",
30-
"default": "${workspaceFolder}/a.out"
29+
"description": "Absolute path to the program",
30+
"default": "${workspaceFolder}/test.fullpak"
3131
}
3232
}
3333
}
@@ -36,7 +36,7 @@
3636
{
3737
"type": "dap-extension",
3838
"request": "attach",
39-
"program": "${workspaceFolder}/a.out"
39+
"program": "${workspaceFolder}/test.fullpak"
4040
}
4141
]
4242
}

‎dap-extension/src/extension.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function runDebugger (context: vscode.ExtensionContext, factory: MockDebu
4646
});
4747

4848
vscode.debug.onDidReceiveDebugSessionCustomEvent((e) => {
49-
console.log(e, 'custom event received hit')
49+
console.log(e, 'custom event received hit');
5050
});
5151

5252
}

‎dap/cabal.project‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
packages: .
2+
3+
source-repository-package
4+
type: git
5+
location: https://github.com/TeofilC/digest
6+
tag: ac9616b94cb8c4a9e07188d19979a6225ebd5a10
7+
8+
source-repository-package
9+
type: git
10+
location: https://github.com/grin-compiler/ghc-whole-program-compiler-project
11+
tag: 9d7a96a0b831f980d8c9d5a30a9185b64fbbfa31
12+
subdir:
13+
external-stg
14+
external-stg-syntax
15+
external-stg-interpreter
16+
17+
source-repository-package
18+
type: git
19+
location: https://github.com/luc-tielen/souffle-haskell
20+
tag: f8c9fc45eed709110af3d3301393f63f4535c71e
21+
22+
constraints:
23+
type-errors-pretty == 0.0.1.2,
24+
souffle-haskell == 3.4.0
25+
26+
package digest
27+
flags: -pkg-config
28+
29+
allow-newer: type-errors-pretty:base

‎dap/cbits/main.c‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎dap/dap.cabal‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ executable dap
2525
base < 5
2626
, dap
2727
, bytestring
28-
, hgdbmi
28+
, external-stg-interpreter
29+
, lifted-base
2930
, network
31+
, unagi-chan
3032
, unordered-containers
3133
, aeson
3234
, text
@@ -53,12 +55,15 @@ library
5355
, aeson-pretty
5456
, base < 5
5557
, bytestring
58+
, lifted-base
5659
, mtl
60+
, monad-control
5761
, network
5862
, network-simple
5963
, stm
6064
, text
6165
, time
66+
, transformers-base
6267
, unordered-containers
6368
hs-source-dirs:
6469
src

‎dap/default.nix‎

Lines changed: 96 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,119 @@
44
with pkgs.haskell.lib;
55

66
let
7+
cabal-src = pkgs.fetchFromGitHub
8+
{ owner = "haskell";
9+
repo = "cabal";
10+
sha256 = "13x3dr257ivalhgiffjnyazffimn4a817dj3p96vvi50nx67cml2";
11+
rev = "3af1731c01c35614fd902ee5c1aec40f5587fde6";
12+
};
713
ghcidSrc = pkgs.fetchFromGitHub
814
{ owner = "ndmitchell";
915
repo = "ghcid";
1016
sha256 = "0bsjbb6n7ssg411k2xj4f881v392hvb7xln99bq1r3vkg14mqqsd";
1117
rev = "e2852979aa644c8fed92d46ab529d2c6c1c62b59";
1218
};
13-
hgdbmiSrc = pkgs.fetchFromGitHub
14-
{ owner = "copton";
15-
repo = "hgdbmi";
16-
sha256 = "1s6gqd1680sm4xlxy324s6vvdn90hrw17s57zl34ljcck3r5qj6x";
17-
rev = "faa0881cad2ac3cc3c28009fd589b9bd7866c8dc";
19+
zip-cmd-src = pkgs.fetchFromGitHub
20+
{ owner = "grin-compiler";
21+
repo = "zip-cmd";
22+
sha256 = "1gsdcip4qrd8bbxira7v9yz1b05c0y7jbbd440hwdh5z6y94ah9g";
23+
rev = "97a6a768803958faee855de115c0402f29bad32b";
24+
};
25+
external-stg-src = pkgs.fetchFromGitHub
26+
{ owner = "grin-compiler";
27+
repo = "ghc-whole-program-compiler-project";
28+
sha256 = "0a9qxm29cn0vy5v0d399944j0155ck8pqqk58w1y350g70anych0";
29+
rev = "9d7a96a0b831f980d8c9d5a30a9185b64fbbfa31";
30+
};
31+
souffle-haskell-src = pkgs.fetchFromGitHub
32+
{ owner = "luc-tielen";
33+
repo = "souffle-haskell";
34+
sha256 = "sha256-/BdDkSTlxh3m3ApxqdbDQ1yIGiE6mTfDljfpEYgE5Tg=";
35+
rev = "f8c9fc45eed709110af3d3301393f63f4535c71e";
36+
};
37+
type-errors-pretty-src = pkgs.fetchFromGitHub
38+
{ owner = "kowainik";
39+
repo = "type-errors-pretty";
40+
sha256 = "1yylw5c8ffzybcv7cm6ff0k88an4iz0fhc59md09s9zlns03f3d0";
41+
rev = "c85d6d0a7bf2278ddb03abddb5782a5b6095d343";
42+
};
43+
ghc-wpc-src = builtins.fetchGit
44+
{ url = "https://github.com/grin-compiler/ghc-wpc.git";
45+
ref = "ghc-whole-program-compiler";
46+
submodules = true;
1847
};
48+
ghc-patch = pkgs.fetchpatch {
49+
url = "https://gitlab.haskell.org/ghc/ghc/-/commit/ad2ef3a13f1eb000eab8e3d64592373b91a52806.patch";
50+
sha256 = "sha256-Dm9nOcS20wiA5Op4vF9Y8YqcgSSC3IKRlYusBukzf8Y=";
51+
};
52+
53+
overrides961 = self: super: {
54+
Cabal = self.callCabal2nix "Cabal" "${cabal-src}/Cabal" {};
55+
Cabal-syntax = self.callCabal2nix "Cabal-syntax" "${cabal-src}/Cabal-syntax" {};
56+
Cabal-tests = (self.callCabal2nix "Cabal-tests" "${cabal-src}/Cabal-tests" {});
57+
cabal-install-solver = (self.callCabal2nix "cabal-install-solver" "${cabal-src}/cabal-install-solver" {});
58+
cabal-install = (self.callCabal2nix "cabal-install" "${cabal-src}/cabal-install" {});
59+
Cabal-described = (self.callCabal2nix "Cabal-described" "${cabal-src}/Cabal-described" {});
60+
Cabal-QuickCheck = (self.callCabal2nix "Cabal-QuickCheck" "${cabal-src}/Cabal-QuickCheck" {});
61+
Cabal-tree-diff = (self.callCabal2nix "Cabal-tree-diff" "${cabal-src}/Cabal-tree-diff" {});
62+
zip-cmd = doJailbreak (self.callCabal2nix "zip-cmd" zip-cmd-src {});
63+
zip = dontCheck (doJailbreak (super.zip));
64+
wpc-plugin = self.callCabal2nix "wpc-plugin" "${external-stg-src}/wpc-plugin" {};
65+
external-stg = self.callCabal2nix "external-stg" "${external-stg-src}/external-stg" {};
66+
external-stg-syntax = self.callCabal2nix "external-stg-syntax" "${external-stg-src}/external-stg-syntax" {};
67+
hello = with self;
68+
pkgs.lib.overrideDerivation (addBuildDepends (callCabal2nix "hello" ./hello {}) [zip-cmd external-stg]) (drv: {
69+
postInstall = ''
70+
${external-stg}/bin/mkfullpak -a dist/build/hello/hello.o_ghc_stgapp
71+
mv -v dist/build/hello/hello.fullpak $out/bin/hello.fullpak
72+
'';
73+
});
74+
};
75+
76+
overrides924 = self: super: {
77+
type-errors-pretty =
78+
dontCheck (doJailbreak (self.callCabal2nix "type-errors-pretty" type-errors-pretty-src {}));
79+
external-stg =
80+
self.callCabal2nix "external-stg" "${external-stg-src}/external-stg" {};
81+
external-stg-interpreter = with pkgs.haskell.lib;
82+
self.callCabal2nix "external-stg-interpreter" "${external-stg-src}/external-stg-interpreter"
83+
(pkgs.lib.optionalAttrs (pkgs.stdenv.isDarwin) { omp = pkgs.llvmPackages.openmp; });
84+
external-stg-syntax =
85+
self.callCabal2nix "external-stg-syntax" "${external-stg-src}/external-stg-syntax" {};
86+
souffle-haskell = with pkgs;
87+
overrideCabal
88+
(addBuildTool (self.callCabal2nix "souffle-haskell" souffle-haskell-src { }) souffle)
89+
(o: {
90+
doCheck = true;
91+
checkPhase = ''
92+
runHook preCheck
93+
DATALOG_DIR="${o.src}/tests/fixtures/" SOUFFLE_BIN="${souffle}/bin/souffle" ./Setup test
94+
runHook postCheck
95+
'';
96+
});
1997

20-
overrides = self: super: {
2198
ghcid =
2299
doJailbreak (self.callCabal2nix "ghcid" ghcidSrc {});
23-
hgdbmi =
24-
dontCheck (doJailbreak (self.callCabal2nix "hgdbmi" hgdbmiSrc {}));
25100
dap =
26101
self.callCabal2nix "dap" ./. {};
27102
};
28103

29-
hPkgs =
30-
pkgs.haskell.packages.ghc924.override { inherit overrides; };
104+
hPkgs924 = pkgs.haskell.packages.ghc924.override { overrides = overrides924; };
105+
hPkgs961 = pkgs.haskell.packages.ghc961.override { overrides = overrides961; };
106+
31107
in
32108
{
33109
inherit pkgs;
34-
inherit (hPkgs)
35-
hgdbmi
110+
inherit (hPkgs961)
111+
hello
112+
zip-cmd
113+
cabal-install
114+
wpc-plugin;
115+
inherit (hPkgs924)
116+
external-stg
117+
external-stg-interpreter
118+
external-stg-syntax
119+
souffle-haskell
36120
ghcid
37121
dap;
38122
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /