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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to parse manifest file #39

Open
ndmitchell opened this issue Jun 4, 2021 · 5 comments
Open

Failure to parse manifest file #39

ndmitchell opened this issue Jun 4, 2021 · 5 comments

Comments

@ndmitchell
Copy link

Given:

cargo-features = ['named-profiles']

[workspace]
members = [
    "foo",
]

I get the error:

ndmitchell@ndmitchell-mbp buck2 % cargo instruments
failed to parse manifest at `/Users/ndmitchell/fbsource/fbcode/buck2/Cargo.toml`

It would be great if this tool could properly parse such manifest files.

@cmyr
Copy link
Owner

cmyr commented Jun 7, 2021

cargo check also fails to parse this manifest.

More specifically, my manifest is:

[package]
name = "test-instruments-parse-issue"
version = "0.1.0"
authors = ["Colin Rofls <[email protected]>"]
edition = "2018"

cargo-features = ['named-profiles']

[workspace]
members = [
    "inner",
]

and my package structure is,

test-instruments-parse-issue
├── Cargo.toml
└── inner
    ├── Cargo.toml
    └── src
        └── main.rs

2 directories, 3 files

I would like to handle workspaces better, but I need more information in this particular case.

@ndmitchell
Copy link
Author

Sorry for taking so long to get back to you. I reinstalled everything with a newer toolchain, and recompiled cargo-instruments and it worked this time - so I assume a newer Cargo dependency or similar fixed it?

In general, for better support for workspaces, allowing the user to be in the root and run --bin=whatever_binary rather than changing directory to the inner Cargo.toml would be super useful.

@cmyr
Copy link
Owner

cmyr commented Jul 4, 2021

I agree that would be a nice improvement.

@BratSinot
Copy link
Contributor

BratSinot commented Oct 25, 2021

Sorry for taking so long to get back to you. I reinstalled everything with a newer toolchain, and recompiled cargo-instruments and it worked this time - so I assume a newer Cargo dependency or similar fixed it?

Greetings!

Could you please give some additional info about how you solved this? I'm facing the same problem now.
Ok, my problem was edition = 2021: #53

@tizee
Copy link
Contributor

tizee commented Apr 9, 2022

Here is my demonstration.

.
├── Cargo.lock
├── Cargo.toml
├── bar
│   ├── Cargo.toml
│   ├── benches
│   │   └── my_bench.rs
│   └── src
│       └── main.rs
├── foo
│   ├── Cargo.toml
│   ├── benches
│   │   └── my_bench.rs
│   └── src
│       └── main.rs
├── rust-toolchain.toml
└── src
    └── main.rs

7 directories, 10 files

The manifest is like:

[package]
name = "cargo-instruments-workspace-issue"
version = "0.1.0"
edition = "2021"
# cargo-features = ['named-profiles']

[workspace]
members = ["foo", "bar"]

Only comment out cargo-features = ['named-profiles'] can cargo check work.

It could also applies to manifest with only [workspace] block like this:

[workspace]
members = ["foo", "bar"]

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

No branches or pull requests

4 participants