cmyr / cargo-instruments

A cargo plugin to generate Xcode Instruments trace files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure to parse manifest file

ndmitchell opened this issue · comments

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.

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 <colin@cmyr.net>"]
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.

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.

I agree that would be a nice improvement.

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

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"]