Tree-sitter: Cannot install tree-sitter-cli with cargo

Created on 6 Jun 2019  路  4Comments  路  Source: tree-sitter/tree-sitter

When I run cargo install tree-sitter-cli, I get:

error: failed to run custom build command for `tree-sitter-cli v0.14.5`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installeMCZ9V/release/build/tree-sitter-cli-2fa18cef284d7c79/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'assertion failed: repo_path.pop()', /home/calixte/.cargo/registry/src/github.com-1ecc6299db9ec823/tree-sitter-cli-0.14.5/build.rs:22:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `tree-sitter-cli v0.14.5`, intermediate artifacts can be found at `/tmp/cargo-installeMCZ9V`

Caused by:
  build failed
bug

Most helpful comment

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.90. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 4 comments

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.90. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Oh, it's trying to find the .git file so that it can append the git SHA to the CLI's version number. I should probably make this optional, so that you can build the CLI without necessarily being inside the tree-sitter git repository.

I am running into the same issue

error: failed to run custom build command for `tree-sitter-cli v0.14.5`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installCCrrKL/release/build/tree-sitter-cli-90cc99a1f1b1f73c/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'assertion failed: repo_path.pop()', /home/marius/.cargo/registry/src/github.com-1ecc6299db9ec823/tree-sitter-cli-0.14.5/build.rs:22:13

I should probably make this optional, so that you can build the CLI without necessarily being inside the tree-sitter git repository.

Is the issue closed because it has been fixed? cargo install should definitely work without cloning the repo -- happy to try to fix if you could point me in the right direction.

What's happening here is that it has been fixed in the build.rs in this repo, but the tree-sitter-cli crate hasn't been updated on github in more than a year, so it doesn't have the fix. The version in the repo right now is 0.16.5 but the crate is 0.14.4.

I got this error when doing cargo install tree-sitter-cli in the root dirctory of tree-sitter. It's been a little while since I used cargo, so I didn't realize this would try to build the crate not the local thing.

The solution is to only do cargo build, as described in https://tree-sitter.github.io/tree-sitter/contributing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ubolonton picture ubolonton  路  3Comments

BonaBeavis picture BonaBeavis  路  3Comments

fwcd picture fwcd  路  6Comments

ubolonton picture ubolonton  路  3Comments

Aerijo picture Aerijo  路  3Comments