uyha / tree-sitter-cmake

A Tree-sitter parser for CMake
MIT License
41 stars 9 forks source link

The binding of cmake cannot be used #4

Closed Decodetalkers closed 2 years ago

Decodetalkers commented 2 years ago

I run cargo test, however failed, report link error. I know little about treesitter and cannot find what happened.

Decodetalkers commented 2 years ago

and after I remove the src of the repo, re generate the cmake , it cannot parse any of my code

Decodetalkers commented 2 years ago

I think the gammer is broken

uyha commented 2 years ago

could you provide the commands you ran and their output?

Decodetalkers commented 2 years ago

could you provide the commands you ran and their output?

First, I clean the src and binding under the repo

rm -rf src
rm -rf bindings
rm -rf Cargo.toml

Then I regenerate the repo

tree-sitter generate

and run the parse

tree-sitter parse CMakeList.txt

output is

Failed to load language in current directory

Caused by:
    0: Error opening dynamic library "/home/cht/.cache/tree-sitter/lib/cmake.so"
    1: /home/cht/.cache/tree-sitter/lib/cmake.so: undefined symbol: tree_sitter_cmake_external_scanner_create

and Run the cargo test

  = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
Decodetalkers commented 2 years ago

The parse generated by tree-sitter is different with the src under the repo .Maybe tree-sitter has updated?

Decodetalkers commented 2 years ago

Any update now?

uyha commented 2 years ago

I’m on vacation now so I will take a look later

Decodetalkers commented 2 years ago

I found out what happened , it is the line of externals

Decodetalkers commented 2 years ago

Maybe the externals session is broken in tree-sitter?

Decodetalkers commented 2 years ago

Sorry , I miss the scanner.cc

Decodetalkers commented 2 years ago

My problem ,sorry