Cargo, workspace and temporary local dependency

I have two projects my_project and my_inner_project in one workspace. Both of them depend on gfx (and gfx_core and gfx_device_gl). I found an error in gfx_device_core, so I forked it, cloned it, fixed it locally and wanted to test it before committing.

Project Structure:

-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

Now I want the load to use a local copy of gfx during the build of my_project:

  • ( Cargo.toml): gfx Cargo.tomls . \ , ( ), , "path", , . , , gfx * , . AFAIK, " ".
  • ([replace]): , . , [replace], .
  • ( ): gfx .cargo/config. gfx .tomls 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 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
    

    gfx , Cargo.toml , , , .

    , , , gfx.

, , promises .

:

  • ?
  • ?
+4
1
0

Source: https://habr.com/ru/post/1663088/


All Articles