rust - 在而不是包清单
问题描述
[rust] "instead of a package manifest"
在询问之前我在这个网站上搜索过,没有找到任何点击。我还在这里阅读了有关虚拟清单的信息,但没有解决我的问题。
我的目标是对azul进行更改。
为了实现这一点,我在这里阅读了有关修补依赖项的信息,现在我有了这个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
中,我检查了 azul 项目git clone
。在main.rs
我遵循这个得到,
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" }
您可能需要那里的所有/部分成员。
推荐阅读
- python-3.x - 数据类中 Pydantic 的 BaseModel 字段别名行为
- c# - 通过 c# 按名称搜索多个按钮
- mongodb - 修改后如何在 MongoDB 中查询字段
- css - Ant Design Table VueJS 问题
- eclipse - Eclipse PDE:java.lang.NoClassDefFoundError:org/eclipse/core/resources/ResourcesPlugin
- javascript - 反应:当另一个子菜单打开时关闭其他子菜单
- reactjs - Swiper Js 垂直循环无法正常工作以进行反应
- c++ - std::common_type 的复杂度是多少?
- java - 在android中,如何释放directByteBuff?
- python - 如何检查列的每个单词是否存在于同一 DataFrame 的多个列中?