tree-sitter-php
tree-sitter-php copied to clipboard
bug: wasm build error
Did you check existing issues?
- [X] I have read all the tree-sitter docs if it relates to using the parser
- [X] I have searched the existing issues of tree-sitter-php
Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)
tree-sitter 0.22.1 (1c38d34deac5ae7ea797a559f596fb4ec9008eb4)
Describe the bug
run tree-sitter build-wasm ./temp/tree-sitter/php/php
scanner.c:1:10: fatal error: '../../common/scanner.h' file not found
#include "../../common/scanner.h"
^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
emcc: error: '/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fPIC -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -Werror=implicit-function-declaration --sysroot=/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -Os -fno-exceptions -fvisibility=hidden -I. scanner.c -c -o /tmp/emscripten_temp_5w46mjsx/scanner_0.o' failed (returned 1)
emcc command failed
Steps To Reproduce/Bad Parse Tree
- tree-sitter build-wasm ./temp/tree-sitter/php/php
- throw error
Expected Behavior/Parse Tree
success build
Repro
// Example code that causes the issue
function foo() {
// Code that fails to parse, or causes an error
}
Thoughts @amaanq? The path is correct from the viewpoint of scanner.c but the relative path is likely being applied where tree-sitter build-wasm finds the grammar.js (or wherever it is building from).
docker issue w/ upstream, same issue in typescript/xml, I'll close as a dupe of the upstream https://github.com/tree-sitter/tree-sitter/issues/3233