我在询问此内容之前在此网站上搜索了[rust] "instead of a package manifest"
,但没有找到匹配。我还阅读了有关虚拟清单here的信息,但没有解决我的问题。
我的目标是更改azul。
为此,我阅读了有关修补依赖项here的信息,现在我有了此Cargo.toml
[package]
name = "my_first_azul_app"
version = "0.1.0"
authors = ["Name <Email>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
azul = { git = "https://github.com/maps4print/azul" }
[patch."https://github.com/maps4print/azul"]
azul = { path = "../azul" }
在路径../azul
中,我已使用git clone
检出了Azul项目。在main.rs
中,我按照this进行了获取,
extern crate azul;
fn main() {
println!("Hello world!");
}
然后我尝试测试
$ cargo run
error: failed to resolve patches for `https://github.com/maps4print/azul`
Caused by:
failed to load source for a dependency on `azul`
Caused by:
Unable to update /home/name/projects/azul
Caused by:
found a virtual manifest at `/home/name/projects/azul/Cargo.toml` instead of a package manifest
我不明白最后一行造成的。如果删除[patch]
配置,它将“正常运行”。报价是因为它无法编译,所以这就是为什么我尝试将其签出并尝试修复。开发azul
依赖关系需要支付什么费用?
TIA,
好像azul正在使用工作空间,因此,如果要通过路径引用它,则必须指向该工作空间的确切成员。
azul的Cargo.toml包含
[workspace]
members = [
"cargo/azul",
"cargo/azul-css",
"cargo/azul-core",
"cargo/azul-layout",
"cargo/azul-text-layout",
"cargo/azul-widgets",
"cargo/azul-css-parser",
"cargo/azul-native-style",
]
所以我相信您应该可以执行以下操作:
[dependencies]
azul = { path = "../azul/cargo/azul"
azul-css = { path = "../azul/cargo/azul-css" }
您可能需要那里的所有/一些成员。