cargo-ebuild icon indicating copy to clipboard operation
cargo-ebuild copied to clipboard

--manifest-path flag behaves differently from expected when used from inside a directory that contains a Cargo.toml

Open MachineFossil opened this issue 5 years ago • 1 comments

I have a repo with two workspaces, structured like so:

my_repo
├── Cargo.toml
├── a
│   ├── Cargo.toml
│   └── src
└── b
     ├── Cargo.toml
     └── src

I want to make an ebuild for each workspace. When I use the --manifest-path flag, cargo ebuild uses the Cargo.toml in the root of the repo instead of the one in the argument, ex.

machinefossil@pc ~/my_repo $ cargo ebuild --manifest-path a/Cargo.toml
Error: cargo metadata failed: Error during execution of `cargo metadata`: error: failed to parse manifest at `/home/machinefossil/my_repo/Cargo.toml`

If I rename/remove the Cargo.toml in the root of the repo, --manifest-path then uses the path given to it as an argument.

MachineFossil avatar Jun 28 '20 06:06 MachineFossil

At least by looking your directory structure, it seems that there is only a single workspace containing two crates a and b. If you want to have two different workspaces, then it is not necessary to have a Cargo.toml at the repository root, but only inside the directories which the workspaces are in.

leonardohn avatar Aug 18 '20 07:08 leonardohn