These are chat archives for rust-lang/rust

30th
Nov 2015
Pete Hayes
@petehayes102
Nov 30 2015 10:19
Hey guys, I have a Rust project that depends on another Rust project. I've made changes to both and want to test them in a staging env before going to prod. However if I've locked my dependent project at 0.1, how do I test 0.2 without deploying it first?
panicbit
@panicbit
Nov 30 2015 10:22
petehayes102: What you probably want to do is to override the dependency http://doc.crates.io/guide.html#overriding-dependencies
You basically creata a ".cargo/config" file in the project directory (or any parent directory thereof) and specify the path to your local crate
using paths = ["/path/to/dependency"]
Pete Hayes
@petehayes102
Nov 30 2015 10:24
Oh nice. That would work well. I guess the CD would set that up as part of its build steps?
Kevin K.
@kbknapp
Nov 30 2015 10:24
You can also clone v0.2 of the dep locally and use a path to test i.e. dep = { version = "0.2", path = "../dep_clone_dor" } in your cargo.toml
panicbit
@panicbit
Nov 30 2015 10:24
cd?
Pete Hayes
@petehayes102
Nov 30 2015 10:25
Sorry - continuous deployment
I have a lot of interdependencies and changes can touch lots of project simultaneously
Hence trying to automate some of the manual labour :)
@kbknapp If I added that change to Cargo.toml, I’d have to then remove it again before deploying. I was hoping for something a little more streamlined.
In other package management solutions you can specify dependencies for various environments, e.g. dev, integration, stage, prod
I can’t find something equivalent for Cargo
panicbit
@panicbit
Nov 30 2015 10:32
petehayes102: I don't think there is something like that yet. But I could imagine a tool that swaps out the .cargo/config to do what you want.
Pete Hayes
@petehayes102
Nov 30 2015 10:32
Yeah I guess I’ll have to script it as part of my build for now
Cheers for the help mate