Skip to content

Commit

Permalink
Fix Starting debugger crashes with WASM error (#1249)
Browse files Browse the repository at this point in the history
* refactor: clean up wasm copy scripts

* feat-fix: fix vscode debugger config running the wrong build task
  • Loading branch information
Ellpeck authored Jan 21, 2025
1 parent ec0a462 commit 45bc943
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"node_modules/**"
],
"program": "${workspaceFolder}/src/cli/flowr.ts",
"preLaunchTask": "npm: build:bundle-flowr",
"preLaunchTask": "npm: build-dev",
"console": "integratedTerminal",
},
{
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"stats-helper": "ts-node src/cli/statistics-helper-app.ts",
"slicer": "ts-node src/cli/slicer-app.ts",
"benchmark-helper": "ts-node src/cli/benchmark-helper-app.ts",
"benchmark": "npm run build && npm run build:copy-wasm && node dist/src/cli/benchmark-app.js",
"benchmark": "npm run build-dev && node dist/src/cli/benchmark-app.js",
"summarizer": "ts-node src/cli/summarizer-app.ts",
"export-quads": "ts-node src/cli/export-quads-app.ts",
"capabilities-markdown": "ts-node src/documentation/print-capabilities-markdown.ts",
Expand All @@ -33,9 +33,10 @@
"wiki:linting-and-testing": "ts-node src/documentation/print-linting-and-testing-wiki.ts",
"wiki:interface": "ts-node src/documentation/print-interface-wiki.ts",
"build": "tsc --project .",
"build-dev": "npm run build && npm run build:copy-wasm",
"build:bundle-flowr": "npm run build && esbuild --bundle dist/src/cli/flowr.js --platform=node --bundle --minify --target=node22 --outfile=dist/src/cli/flowr.min.js && npm run build:copy-wasm-min",
"build:copy-wasm": "cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm dist/src/r-bridge/lang-4.x/tree-sitter/ && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/r-bridge/lang-4.x/tree-sitter/",
"build:copy-wasm-min": "cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm dist/src/cli && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/cli",
"build:copy-wasm": "mkdir -p dist/src/r-bridge/lang-4.x/tree-sitter/ && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/r-bridge/lang-4.x/tree-sitter/",
"build:copy-wasm-min": "mkdir -p dist/src/cli && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/cli",
"lint-local": "npx eslint --version && npx eslint src/ test/ --rule \"no-warning-comments: off\"",
"lint": "npm run license-compat -- --summary && npx eslint --version && npx eslint src/ test/",
"license-compat": "license-checker --onlyAllow 'MIT;MIT OR X11;GPLv2;LGPL;GNUGPL;ISC;Apache-2.0;FreeBSD;BSD-2-Clause;clearbsd;ModifiedBSD;BSD-3-Clause;Python-2.0;Unlicense;WTFPL;BlueOak-1.0.0;CC-BY-4.0;CC-BY-3.0;CC0-1.0;0BSD'",
Expand Down Expand Up @@ -166,7 +167,7 @@
"npm run lint",
"npm run test-full"
],
"after:bump": "npm run build && npm run build:copy-wasm",
"after:bump": "npm run build-dev",
"after:git:release": "echo After git push, before github release",
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
},
Expand Down

4 comments on commit 45bc943

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"artificial" Benchmark Suite

Benchmark suite Current: 45bc943 Previous: a877df7 Ratio
Retrieve AST from R code 253.41813763636364 ms (112.2580307175049) 239.49771736363638 ms (101.48800821636837) 1.06
Normalize R AST 18.257677045454546 ms (33.073289664167596) 17.41336081818182 ms (30.981566426513265) 1.05
Produce dataflow information 68.99865213636365 ms (147.2760658884895) 68.728513 ms (151.94316854576633) 1.00
Total per-file 871.6038503181819 ms (1580.9386558307374) 837.9476761818181 ms (1510.9729062977526) 1.04
Static slicing 2.0663322155002146 ms (1.1881033019517928) 2.0034774339582415 ms (1.1691051705207822) 1.03
Reconstruct code 0.24283720149117013 ms (0.18699860803859075) 0.22634653062782062 ms (0.168666676054442) 1.07
Total per-slice 2.3235464010224938 ms (1.266418248551769) 2.24374443748002 ms (1.2384172691894533) 1.04
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.7891949660994808 # 0.7891949660994808 # 1
reduction (normalized tokens) 0.7665650684287274 # 0.7665650684287274 # 1
memory (df-graph) 95.19682173295455 KiB (244.24808975931026) 95.19682173295455 KiB (244.24808975931026) 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"social-science" Benchmark Suite

Benchmark suite Current: 45bc943 Previous: a877df7 Ratio
Retrieve AST from R code 239.88749792 ms (42.510672015697345) 240.34012847999998 ms (43.93673078226616) 1.00
Normalize R AST 18.46387402 ms (13.397109013558966) 18.87248132 ms (14.186278380523435) 0.98
Produce dataflow information 77.577963 ms (71.4034434364096) 78.15406248000001 ms (73.48454316898545) 0.99
Total per-file 7494.86156074 ms (29324.805340023402) 7582.25710378 ms (29767.39189439267) 0.99
Static slicing 15.119248634912267 ms (44.27796094548865) 15.270449566508105 ms (44.94967789767313) 0.99
Reconstruct code 0.2450450517635606 ms (0.14536107233477363) 0.2585950662014173 ms (0.1532502183629028) 0.95
Total per-slice 15.371969907762043 ms (44.31396474488626) 15.537331197364793 ms (44.98374295831238) 0.99
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.8760481407790371 # 0.8760481407790371 # 1
reduction (normalized tokens) 0.8152466834674152 # 0.8152466834674152 # 1
memory (df-graph) 99.6448046875 KiB (113.2159841674677) 99.6448046875 KiB (113.2159841674677) 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"artificial" Benchmark Suite (tree-sitter)

Benchmark suite Current: 45bc943 Previous: a877df7 Ratio
Retrieve AST from R code 7.751095772727273 ms (8.4843428320717) 8.145506545454547 ms (9.786080094734778) 0.95
Normalize R AST 17.278249727272726 ms (22.2001034943193) 17.78099590909091 ms (23.820712056308647) 0.97
Produce dataflow information 68.9831544090909 ms (148.23995328381562) 70.83680254545455 ms (150.5207252208632) 0.97
Total per-file 620.5811484090909 ms (1397.5988115533219) 627.2099676818182 ms (1407.4477264884629) 0.99
Static slicing 2.11303529503617 ms (1.5878568011567504) 2.0248883955065318 ms (1.1173257361688766) 1.04
Reconstruct code 0.23376687054302014 ms (0.18118682677534453) 0.23812396339689798 ms (0.1785232875956438) 0.98
Total per-slice 2.362030799538881 ms (1.6618636612333453) 2.2780515267109083 ms (1.198556469122308) 1.04
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.7891949660994808 # 0.7891949660994808 # 1
reduction (normalized tokens) 0.7665650684287274 # 0.7665650684287274 # 1
memory (df-graph) 95.19682173295455 KiB (244.24808975931026) 95.19682173295455 KiB (244.24808975931026) 1

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"social-science" Benchmark Suite (tree-sitter)

Benchmark suite Current: 45bc943 Previous: a877df7 Ratio
Retrieve AST from R code 10.547709933333334 ms (6.452240294524094) 10.4682258 ms (6.536909762375299) 1.01
Normalize R AST 24.51936617777778 ms (13.124192011982853) 23.515930466666664 ms (11.460003796895084) 1.04
Produce dataflow information 79.05211044444445 ms (66.67805072532207) 77.72576402222222 ms (66.68368526289126) 1.02
Total per-file 7771.511917266666 ms (31591.573933172807) 7557.427238355555 ms (30739.010883053157) 1.03
Static slicing 16.23587956682418 ms (46.94504554840104) 15.83153546219062 ms (45.672079288893144) 1.03
Reconstruct code 0.3039445624298602 ms (0.17237115780445736) 0.2510293465879067 ms (0.15539877495324173) 1.21
Total per-slice 16.548415729363747 ms (46.98577718834835) 16.090141405670494 ms (45.71466701697095) 1.03
failed to reconstruct/re-parse 0 # 0 # 1
times hit threshold 0 # 0 # 1
reduction (characters) 0.8685107303274813 # 0.8685107303274813 # 1
reduction (normalized tokens) 0.8049905198879769 # 0.8049905198879769 # 1
memory (df-graph) 97.50590277777778 KiB (111.14577334743846) 97.50590277777778 KiB (111.14577334743846) 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.