我在一个货物工作区中有两个项目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
现在我希望货物在my_project构建期间使用gfx的本地副本:
第三种方法(本地路径覆盖):我已经在.cargo / config中添加了gfx到路径。还有必要将我的.tomls中的gfx包的源代码从crate.io更改为git repository,因为.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.
错误:
error: failed to find lock source of gfx_core
我的项目中的Cargo.toml中指向的gfx和存储库的本地副本是相同的,所以我不明白为什么会发出此警告。
错误在每晚生锈中修复,所以我安装了它,最后能够使用我的本地gfx副本编译项目。
因此,经过一天与相对基本的任务的斗争,我有一个解决方案,只在夜间工作,并承诺它将无法在功能发布。
我的问题:
答案 0 :(得分:0)
关闭主题;这个讨论解决了这个问题: https://github.com/rust-lang/cargo/issues/3192
现在,指向工作空间目录外部的路径不会隐式包含在工作空间中。此外,工作区配置中有exclude
个键。