ada*_*ahn 5 gfx rust rust-cargo
我在一个货物工作区中有两个项目my_project和my_inner_project。它们都依赖于gfx(以及gfx_core和gfx_device_gl)。我在gfx_device_core中发现了一个错误,因此我已经对其进行了分叉,克隆,本地修补,并希望在提交之前对其进行测试。
项目结构:
-my_project
--my_inner_project
---Cargo.toml
--Cargo.toml
-gfx
--src
---core
----Cargo.toml #package gfx_core
---backend
----gl
-----Cargo.toml #package gfx_device_gl
---render
----Cargo.toml #package gfx
--Cargo.toml
Run Code Online (Sandbox Code Playgroud)
现在,我希望货物在my_project构建期间使用gfx的本地副本:
第三种方法(覆盖本地路径):我在.cargo / config中的路径中添加了gfx。也有必要将我的.tomls中的gfx软件包的源从crate.io更改为git信息库,因为被覆盖的软件包中的版本和.toml中引用的版本必须匹配。这在稳定的锈蚀1.13中也不起作用。我得到警告:
warning: path override for crate `gfx_device_gl` has altered the original list of dependencies; the dependency on `gfx_core` was either added or modified to not match the previously resolved version
This is currently allowed but is known to produce buggy behavior with spurious recompiles and changes to the crate graph. Path overrides unfortunately were never intended to support this feature, so for now this message is just a warning. In the future, however, this message will become a hard error.
To change the dependency graph via an override it's recommended to use the `[replace]` feature of Cargo instead of the path override feature. This is documented online at the url below for more information.
Run Code Online (Sandbox Code Playgroud)
错误:
error: failed to find lock source of gfx_core
Run Code Online (Sandbox Code Playgroud)
我在项目内的Cargo.toml中指向的gfx和存储库的本地副本是相同的,因此我不明白为什么会发出此警告。
该错误已在每晚的rust中修复,因此我已经安装了该错误,最终能够使用本地gfx副本编译项目。
因此,经过一天相对艰苦的工作后,我有了一个解决方案,该解决方案仅在夜间运行,并承诺在功能发布中将不起作用。
我的问题:
结束话题;此讨论解决了该问题: https ://github.com/rust-lang/cargo/issues/3192
现在,指向工作区目录外部的路径不会隐式包含在工作区中。此外,exclude
工作区配置也很关键。