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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] cargo install --path ./crates/cli failed #1118

Closed
tizee opened this issue May 4, 2024 · 4 comments
Closed

[bug] cargo install --path ./crates/cli failed #1118

tizee opened this issue May 4, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@tizee
Copy link
Contributor

tizee commented May 4, 2024

馃檨 Actual behavior

error[E0277]: the trait bound `TSLanguage: From<tree_sitter::Language>` is not satisfied
  --> crates/language/src/parsers.rs:36:34
   |
36 |     tree_sitter_html::language().into()
   |                                  ^^^^ the trait `From<tree_sitter::Language>` is not implemented for `TSLanguage`, which is required by `tree_sitter::Language: Into<_>`
   |
   = help: the trait `From<tree_sitter::Language>` is implemented for `TSLanguage`
   = help: for that trait implementation, expected `tree_sitter::Language`, found `tree_sitter::Language`
   = note: required for `tree_sitter::Language` to implement `Into<TSLanguage>`

馃檪 Expected behavior

Install ast-grep by building it from source using cargo install --path ./crates/cli

My workaround

My workaround is simple. Build ast-grep with cargo build --release -p ast-grep then copy the binary executable to ~/.cargo/bin manually.

@tizee tizee added the bug Something isn't working label May 4, 2024
@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented May 4, 2024

This is caused by incompatible tree-sitter version release.

You can try this

cargo install ast-grep --locked

@HerringtonDarkholme HerringtonDarkholme added documentation Improvements or additions to documentation question Further information is requested and removed bug Something isn't working labels May 4, 2024
HerringtonDarkholme added a commit to ast-grep/ast-grep.github.io that referenced this issue May 4, 2024
@jubalh
Copy link
Contributor

jubalh commented May 7, 2024

Will there be a new release which fixes this?

@HerringtonDarkholme
Copy link
Member

nope, this is tree-sitter's issue. Tree-sitter's version does not follow semver.

Instead, use cargo install --locked is recommended.

@jubalh
Copy link
Contributor

jubalh commented May 7, 2024

It won't be so easy for me. Our package pulls down all dependencies in a vendor tarball because the build system doesn't support having an internet connection. I'll try to research if I can somehow tell the service to use the locked versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants