Cargo-udeps: panicked on cargo-metadata

Hello there,

This seems like an issue originating from the build-script file, How can i fix it?

I'm trying to run cargo +nightly udeps on a project.

Caused by:
  process didn't exit successfully: `/Users/apple/Documents/Personal/darwinia/target/debug/build/darwinia-runtime-7dc0ceade68badee/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '`cargo metadata` can not fail on project `Cargo.toml`; qed: CargoMetadata { stderr: "error: Found argument 'metadata' which wasn't expected, or isn't valid in this context\n\nUSAGE:\n    cargo <SUBCOMMAND>\n\nFor more information try --help\n" }', /Users/apple/.cargo/git/checkouts/substrate-a7fa553ead635512/816fc31/utils/wasm-builder/src/wasm_project.rs:83:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

That seems strange because the metadata sub-command has been in cargo for several years now. Are you able to run cargo metadata from the command line?

Yes, that works fine.

sample:

.com/rust-lang/crates.io-index)","static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"futures","pkg":"futures 0.3.21 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"log","pkg":"log 0.4.17 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"nohash_hasher","pkg":"nohash-hasher 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"parking_lot","pkg":"parking_lot 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"rand","pkg":"rand 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"static_assertions","pkg":"static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":[]},{"id":"zeroize 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["zeroize_derive 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"zeroize_derive","pkg":"zeroize_derive 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["alloc","default","zeroize_derive"]},{"id":"zeroize_derive 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["proc-macro2 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)","quote 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)","syn 1.0.96 (registry+https://github.com/rust-lang/crates.io-index)","synstructure 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"proc_macro2","pkg":"proc-macro2 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"quote","pkg":"quote 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"syn","pkg":"syn 1.0.96 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"synstructure","pkg":"synstructure 0.12.6 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":[]},{"id":"zstd 0.9.2+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["zstd-safe 4.1.3+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"zstd_safe","pkg":"zstd-safe 4.1.3+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":[]},{"id":"zstd-safe 4.1.3+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["libc 0.2.126 (registry+https://github.com/rust-lang/crates.io-index)","zstd-sys 1.6.2+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"libc","pkg":"libc 0.2.126 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]},{"name":"zstd_sys","pkg":"zstd-sys 1.6.2+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["std"]},{"id":"zstd-sys 1.6.2+zstd.1.5.1 (registry+https://github.com/rust-lang/crates.io-index)","dependencies":["cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)","libc 0.2.126 (registry+https://github.com/rust-lang/crates.io-index)"],"deps":[{"name":"cc","pkg":"cc 1.0.73 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":"build","target":null}]},{"name":"libc","pkg":"libc 0.2.126 (registry+https://github.com/rust-lang/crates.io-index)","dep_kinds":[{"kind":null,"target":null}]}],"features":["std"]}],"root":"darwinia 0.12.4-3 (path+file:///Users/apple/Documents/Personal/darwinia)"},"target_directory":"/Users/apple/Documents/Personal/darwinia/target","version":1,"workspace_root":"/Users/apple/Documents/Personal/darwinia","metadata":null}

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.