[英]Cargo, workspace and temporary local dependency
我在一個貨物工作區中有兩個項目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倉庫,因為被覆蓋的軟件包中的版本和.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和存儲庫的本地副本是相同的,因此我不明白為什么會發出此警告。
該錯誤已在每晚的rust中修復,因此我已經安裝了該錯誤,最終能夠使用本地gfx副本編譯項目。
因此,經過一天相對艱苦的基本工作之后,我有了一個解決方案,該解決方案僅在夜間運行,並承諾在功能發布中將不起作用。
我的問題:
結束話題; 該討論解決了該問題: https : //github.com/rust-lang/cargo/issues/3192
現在,指向工作空間目錄外部的路徑不會隱式包含在工作空間中。 此外,工作空間配置中沒有exclude
鍵。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.