gpt4 book ai didi

rust - "manifest path is a virtual manifest, but this command requires running against an actual package"是什么意思?

转载 作者:行者123 更新时间:2023-11-29 07:48:06 27 4
gpt4 key购买 nike

我正在尝试构建一个 Rust 项目 (xray)。运行 cargo run 时出现以下错误消息

error: manifest path D:\xray\building\xray\Cargo.toml is a virtualmanifest, but this command requires running against an actual packagein this workspace

这到底是什么意思,如何解决?我使用的是 Cargo 版本 0.25.0 和 Rust 版本 1.24.1。

最佳答案

你的 Cargo.tomlvirtual manifest .

In workspace manifests, if the package table is present, the workspace root crate will be treated as a normal package, as well as a workspace. If the package table is not present in a workspace manifest, it is called a virtual manifest.

When working with virtual manifests, package-related cargo commands, like cargo build, won't be available anymore. But, most of such commands support the --all option, will execute the command for all the non-virtual manifest in the workspace.

cargo run不起作用,因为 cargo 不知道要运行什么。有两种选择:

  1. --manifest-path <PATH> : 到Cargo.toml 的路径您要运行的 crate 。
  2. -p, --package <SPEC> : 您要运行的包。

您的情况可能是 cargo run --package xray_cli

关于rust - "manifest path is a virtual manifest, but this command requires running against an actual package"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49459821/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com