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

#21 in Operating systems

Download history 1123158/week @ 2024-08-02 1145343/week @ 2024-08-09 1183867/week @ 2024-08-16 1199528/week @ 2024-08-23 1157497/week @ 2024-08-30 1230264/week @ 2024-09-06 1151334/week @ 2024-09-13 1425066/week @ 2024-09-20 1403600/week @ 2024-09-27 1890884/week @ 2024-10-04 1756832/week @ 2024-10-11 1866999/week @ 2024-10-18 1395596/week @ 2024-10-25 1323107/week @ 2024-11-01 1390525/week @ 2024-11-08 1424907/week @ 2024-11-15

5,791,597 downloads per month
Used in 5,604 crates (625 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–7.5MB
~57K SLoC