Open brainplot opened 4 years ago
Have you tried the --manifest-path <PATH> Path to Cargo.toml
option?
I just tried. It still doesn't work, unfortunately.
gian@mars ~/Projects/rust-analyzer $ cargo ebuild --manifest-path Cargo.toml
Error: cargo metadata failed to resolve the root package
gian@mars ~/Projects/rust-analyzer $ cargo ebuild
Error: cargo metadata failed to resolve the root package
First time I ran the command it hung there for 10 to 15 seconds and then output the error message. In all subsequent retries from there, the program exists immediately but with the same error message.
Works fine when given the proper path:
nightspc@hf ~/current/rust-analyzer $ cargo ebuild --manifest-path crates/rust-analyzer/Cargo.toml
Wrote: rust-analyzer-0.1.0.ebuild
There are issues with the generated ebuild since it has git-dependencies but the tool itself is works fine.
Heres a copy of the generated ebuild: https://gist.github.com/nightspc/4fbdfabaebb026dcca9afcfea6cedcd0
And here's a copy of one I manually created by inspecting ~/.cargo: https://gist.github.com/nightspc/d1cf6ef737b2c2a26aed18df7250b015
@brainplot the issue is the top level Cargo.toml is a workspace definition file. That's not something that cargo metadata
handles. It's merely links to other actual crates. So that's why @nightspc was able to make it work by providing the path to the actual crate.
Ultimately, cargo ebuild
just wraps cargo metadata
and in the future cargo build-plan
once it's stable so if it doesn't work with those commands. It won't work. I'll add some notes about this to the README.
Unfortunately github archive links aren't stable as Gentoo has discovered before. Their hashes change as github internally updates the version of git they use.
I don't have a good answer for chalk since it's a git dependency as the cargo.eclass doesn't yet support git dependencies. Once it does then cargo-ebuild can output the appropriate syntax for that.
Hi, I was looking into writing an ebuild script for
rust-analyzer
and use this tool to list all dependent crates, as per the Gentoo wiki. However, I cloned their repository, rancargo ebuild
in the project root but it failed withI tried
cargo ebuild
with a bunch of other popular Rust repos such asripgrep
andbat
; and it worked with all of them. There must be something with how therust-analyzer
code base is structured thatcargo-ebuild
doesn't like.