-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
WASM build fails with error #53
Comments
Compiling
Compiling with |
The issue is that diff --git a/lib/binding_web/exports.json b/lib/binding_web/exports.json
index e0b3f718..36342e52 100644
--- a/lib/binding_web/exports.json
+++ b/lib/binding_web/exports.json
@@ -3,6 +3,15 @@
"_free",
"_malloc",
+ "__ZNSt3__24cerrE",
+ "__ZNSt3__25ctypeIcE2idE",
+ "__ZTVN10__cxxabiv117__class_type_infoE",
+ "__ZTVN10__cxxabiv120__si_class_type_infoE",
+ "__ZTVN10__cxxabiv120__function_type_infoE",
+ "__ZTVN10__cxxabiv119__pointer_type_infoE",
+ "__ZTVN10__cxxabiv121__vmi_class_type_infoE",
+ "___cxa_pure_virtual",
+
"__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm",
"__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv",
"__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm", However, I suppose such a patch is unlikely to be accepted. Is the use of these functions really worth the hassle? |
With the above patch applied to
|
To help reproducing these errors, here is a simple script which uses the generated wasm, to be called as #!/usr/bin/env node
const fs = require('fs')
const Parser = require('web-tree-sitter');
if (process.argv.length < 3) {
console.log('Usage: script/parse-example.js <haskell-file>')
process.exit(1)
}
const fileName = process.argv[2]
const sourceCode = fs.readFileSync(fileName, 'utf8')
Parser.init().then(() => {
Parser.Language.load('tree-sitter-haskell.wasm').then((Haskell) => {
const parser = new Parser;
parser.setLanguage(Haskell);
const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
});
}); |
The following patch to diff --git a/lib/binding_web/exports.json b/lib/binding_web/exports.json
index e0b3f718..3a43ae33 100644
--- a/lib/binding_web/exports.json
+++ b/lib/binding_web/exports.json
@@ -3,6 +3,17 @@
"_free",
"_malloc",
+ "__ZNSt3__24cerrE",
+ "__ZNSt3__25ctypeIcE2idE",
+ "__ZTVN10__cxxabiv117__class_type_infoE",
+ "__ZTVN10__cxxabiv120__si_class_type_infoE",
+ "__ZTVN10__cxxabiv120__function_type_infoE",
+ "__ZTVN10__cxxabiv119__pointer_type_infoE",
+ "__ZTVN10__cxxabiv121__vmi_class_type_infoE",
+ "__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm",
+ "__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE25__init_copy_ctor_externalEPKcm",
+ "___cxa_pure_virtual",
+
"__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm",
"__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv",
"__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm", |
Created two issues which may help debug such problems in the future (tree-sitter/tree-sitter#1565 and tree-sitter/tree-sitter#1566). |
Using the wasm generated with
npx tree-sitter build-wasm
fails with the following error:The text was updated successfully, but these errors were encountered: