Cargo在哪里提出git要求?

时间:2015-01-21 14:31:19

标签: rust rust-cargo

在编译项目时,货物会自动下载Cargo.toml中指定的要求,作为git-repository提供。

E.g。

[dependencies.piston]
git = "https://github.com/PistonDevelopers/piston"

将导致

Updating git repository 'https://github.com/PistonDevelopers/opengl_graphics'

编译时。它在哪里将这些存储库保存在我的磁盘上?我使用Windows,这会改变什么吗?

1 个答案:

答案 0 :(得分:3)

man cargo给出:

FILES
       ~/.cargo
              Directory  in which Cargo stores repository data. Cargo can
              be instructed to use a .cargo subdirectory in  a  different
              location by setting the CARGO_HOME environment variable.

git grep执行CARGO_HOME查找https://github.com/rust-lang/cargo/blob/3533ff11c505017751d1e466685efe7084cbd96b/src/cargo/util/config.rs#L380-L384

使用http://doc.rust-lang.org/nightly/std/os/fn.homedir.html