Where does Cargo put the git requirements?

孤者浪人 提交于 2019-12-11 11:44:18

问题


When compiling a project, cargo automatically downloads the requirements, specified in the Cargo.toml, given as a git-repository.

E.g.

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

will result in

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

when compiling. Where does it save those repositories on my disk? I'm using Windows, does this change anything?


回答1:


man cargo gives:

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.

Doing a git grep for CARGO_HOME finds https://github.com/rust-lang/cargo/blob/3533ff11c505017751d1e466685efe7084cbd96b/src/cargo/util/config.rs#L380-L384

which uses http://doc.rust-lang.org/nightly/std/os/fn.homedir.html



来源:https://stackoverflow.com/questions/28069678/where-does-cargo-put-the-git-requirements

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!