elohmeier / ptsd

6 stars 0 forks source link

tree-sitter `undefined symbol: isnumber` error #1

Open tylerjl opened 1 week ago

tylerjl commented 1 week ago

Hey @elohmeier! I know this is your personal repo for your nix configuration, but your aider package looked really useful and after trying to use it I ran into something you might be able to help pin down. Feel free to insta-close this if you don't feel like providing OSS support, this just seemed like the easiest way to start a conversation with you about the package :smile:

When running your latest aider package either via a nix profile installation or nix build, I get the following after submitting the first prompt:

<snip>
OSError: /nix/store/nk1kxg3rbmfrij82qzniw3vr0z6dfhk4-python3.11-tree-sitter-languages-1.10.2/lib/python3.11/site-packages/tree_sitter_languages/languages.so: undefined symbol: isnumber

I thought I might need tree-sitter in my environment (as a guess) but got the same error running aider in a nix-shell -p tree-sitter.

Any idea what may be going on?

elohmeier commented 1 week ago

Hi @tylerjl! That's probably related to a difference between the tree-sitter-grammar aider expects via py-tree-sitter-languages and the one used in the nix package via the nixpkgs tree-sitter-grammars package. I had similar issues with the javascript grammar, therefore I disabled the javascript tags in the package.

What type of file are you trying to edit? Does it work with other file types?

tylerjl commented 1 week ago

Hmm, that makes sense. I've been working with Python source files, but I just tested with some Rust source code and just to get more information (I assume it'd fail based upon your note about removing the .js grammar) I also tried it with some .vue files (same failure there, too) and a reStructured text file. So I'm seeing the error with .py, .rs , .rst, and .vue files (which makes me think that they're all broken and something is missing in my environment somewhere).

Could I be missing something in my shell or environment that might be set in your system profile? The error looks like it's finding languages.so but failing to lookup a specific symbol; maybe there's a library path mismatch somewhere? Or maybe the error is covering up the fact that it actually can't find languages.so, but if your package works, that seems doubtful.