Hi,
I was testing the paths override in the config as it is relevant to my scenario.
I did as was described Overriding Dependencies
But it doesnt seem to be working.
What I tried:
a - Cargo.toml
[package]
name = "a"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["staticlib", "rlib"]
[dependencies]
b - Cargo.toml
[package]
name = "b"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
a = { path = "../a" }
It compiled.
I moved the 'a' to another folder under abcd
so now I have the following structure
-
b
- Cargo.toml
- .cargo
- config.toml
-
abcd
- a
--Cargo.toml
- a
b/.cargo/config.toml
paths = ["../abcd/a"]
This doesnt compile, cargo keeps looking for '../a'. I thought the path would get overridden by what's specified in .cargo/config.toml
user@mc:~/blah/b$ cargo build --verbose
error: failed to get `a` as a dependency of package `b v0.1.0 (/home/blah/b)`
Caused by:
failed to load source for dependency `a`
Caused by:
Unable to update /home/blah/a
Caused by:
failed to read `/home/blah/a/Cargo.toml`
Caused by:
No such file or directory (os error 2)
As you can see it's still trying to get to '../a'
What am I doing wrong here, or have I understood this incorrectly?
Thanks,
Amol