Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

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

Open
MachineFossil opened this issue Jun 28, 2020 · 1 comment

Comments

@MachineFossil
Copy link

MachineFossil commented Jun 28, 2020

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.

@leonardohn
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants