tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter
MIT License
176 stars 58 forks source link

`build-wasm` fails to produce working parser #236

Closed savetheclocktower closed 4 months ago

savetheclocktower commented 1 year ago

This started on commit cbd998c and has affected this parser ever since.

These symptoms persist on both master and cbd998c:

tree-sitter build-wasm . && tree-sitter playground

The resulting browser window has this error in the console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'apply')
    at e.<computed> (tree-sitter.js:1:10370)
    at 007b624a:0x4130
    at tree-sitter.wasm:0x24b5b
    at Module._ts_parser_parse_wasm (tree-sitter.js:1:23097)
    at Parser.parse (tree-sitter.js:1:38110)
    at handleCodeChange (playground.js:115:28)
    at handleLanguageChange (playground.js:101:5)
    at async playground.js:78:3

My versions of tree-sitter and emcc:

$ tree-sitter --version 
tree-sitter 0.20.7 (b268e412ad4848380166af153300464e5a1cf83f)
$ emcc --version
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.24 (416685fb964c14cde4be3e8a45ad26d75bac3e33)

Using these same versions, 6fa6332 (parent of cbd998c) builds a working wasm file.

savetheclocktower commented 1 year ago

@ahlinc informs me that this is caused by https://github.com/tree-sitter/tree-sitter/issues/1906 — so until that's fixed, the only recourse would be to alter the change in cbd998c so that it doesn't use iswupper.

amaanq commented 11 months ago

this is fixed on ts master now, but I'll leave it up until there's a new release