Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting TREE_SITTER_DIR causes ENOENT on tree-sitter 0.20.0 + macOS #1222

Closed
Julian opened this issue Jul 1, 2021 · 3 comments · Fixed by #1224
Closed

Setting TREE_SITTER_DIR causes ENOENT on tree-sitter 0.20.0 + macOS #1222

Julian opened this issue Jul 1, 2021 · 3 comments · Fixed by #1224

Comments

@Julian
Copy link
Contributor

Julian commented Jul 1, 2021

When trying to run either tree-sitter test or tree-sitter generate on macOS, I get:

~/Desktop/tree-sitter-lean is a git repository on main 
⊙  ../tree-sitter-macos-x64 test                                                   julian@Airm
No such file or directory (os error 2)

~/Desktop/tree-sitter-lean is a git repository on main 
⊙  ../tree-sitter-macos-x64 generate                                               julian@Airm
No such file or directory (os error 2)

which is due to having TREE_SITTER_DIR set to tell tree-sitter where to put its files.

Either brew install tree-sitter or the official release (wget https://github.com/tree-sitter/tree-sitter/releases/download/v0.20.0/tree-sitter-macos-x64.gz) seem to do so for me.

Minimal reproducer run on a tree sitter project:


~/Desktop/tree-sitter-lean is a git repository on main 
⊙  ls                                                                                                                                                                               julian@Airm
bindings  grammar  src  test  COPYING  Cargo.toml  README.rst  binding.gyp  grammar.js  package-lock.json  package.json

~/Desktop/tree-sitter-lean is a git repository on main 
⊙  mkdir foo                                                                                                                                                                        julian@Airm

~/Desktop/tree-sitter-lean is a git repository on main 
⊙  env -i TREE_SITTER_DIR=$PWD/foo =tree-sitter test | tail -n3                                                                                                                     julian@Airm
No such file or directory (os error 2)

~/Desktop/tree-sitter-lean is a git repository on main 
⊙  env -i =tree-sitter test | tail -n3                                                                                                                                              julian@Airm
    ✓ Interpolation
    ✓ Interpolation With Function Application
    ✓ Interpolation With Escape Sequences

~/Desktop/tree-sitter-lean is a git repository on main 
⊙  env -i TREE_SITTER_DIR= =tree-sitter test | tail -n3                                                                                                                             julian@Airm
No such file or directory (os error 2)
@CyberShadow
Copy link
Contributor

CyberShadow commented Jul 1, 2021

which is due to having TREE_SITTER_DIR set to tell tree-sitter where to put its files.

What does this refer to (where does the expectation for the behavior described here come from)?

Looking at the code, TREE_SITTER_DIR seems to be used only to indicate the location of a config.json file:
https://github.com/tree-sitter/tree-sitter/search?q=TREE_SITTER_DIR&type=code
If the variable is set, then it is expected to point to a valid location.

@Julian
Copy link
Contributor Author

Julian commented Jul 1, 2021

I've been doing it since #628 (comment) (and it worked with previous releases)

@Julian
Copy link
Contributor Author

Julian commented Jul 1, 2021

It looks like #1157 means I don't need to set it anymore, since now the files will default to ~/Library/ApplicationSupport which is where I was putting them, but I suspect someone else may run into the above.

Julian added a commit to Julian/dotfiles that referenced this issue Jul 1, 2021
Does so as of tree-sitter/tree-sitter#1157

And having this set seems to cause tree-sitter to fail,
see tree-sitter/tree-sitter#1222
CyberShadow added a commit to CyberShadow/tree-sitter that referenced this issue Jul 1, 2021
hendrikvanantwerpen pushed a commit to hendrikvanantwerpen/tree-sitter that referenced this issue Nov 23, 2021
Julian added a commit to Julian/dotfiles that referenced this issue Jun 18, 2022
Does so as of tree-sitter/tree-sitter#1157

And having this set seems to cause tree-sitter to fail,
see tree-sitter/tree-sitter#1222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants