13 releases

0.5.9 Dec 15, 2023
0.5.5 Apr 25, 2023
0.5.4 Oct 11, 2022
0.5.3 Jan 7, 2020
0.3.0 Jul 19, 2017

#15 in Operating systems

Download history 994691/week @ 2024-01-25 1025869/week @ 2024-02-01 1014837/week @ 2024-02-08 968892/week @ 2024-02-15 1016631/week @ 2024-02-22 1032529/week @ 2024-02-29 1012605/week @ 2024-03-07 1017666/week @ 2024-03-14 1011357/week @ 2024-03-21 958315/week @ 2024-03-28 996754/week @ 2024-04-04 1006369/week @ 2024-04-11 985914/week @ 2024-04-18 952303/week @ 2024-04-25 977190/week @ 2024-05-02 794672/week @ 2024-05-09

3,891,616 downloads per month
Used in 4,566 crates (533 directly)

MIT/Apache

15KB
152 lines

Documentation crates.io

Canonical definitions of home_dir, cargo_home, and rustup_home.

This provides the definition of home_dir used by Cargo and rustup, as well functions to find the correct value of CARGO_HOME and RUSTUP_HOME.

The definition of home_dir provided by the standard library is incorrect because it considers the HOME environment variable on Windows. This causes surprising situations where a Rust program will behave differently depending on whether it is run under a Unix emulation environment like Cygwin or MinGW. Neither Cargo nor rustup use the standard library's definition - they use the definition here.

This crate further provides two functions, cargo_home and rustup_home, which are the canonical way to determine the location that Cargo and rustup store their data.

See rust-lang/rust#43321.

License

MIT OR Apache-2.0

Dependencies

~0–8.5MB
~63K SLoC