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

#20 in Operating systems

Download history 1085048/week @ 2024-07-21 1112435/week @ 2024-07-28 1117901/week @ 2024-08-04 1154337/week @ 2024-08-11 1185925/week @ 2024-08-18 1204991/week @ 2024-08-25 1170556/week @ 2024-09-01 1235232/week @ 2024-09-08 1188688/week @ 2024-09-15 1381343/week @ 2024-09-22 1534689/week @ 2024-09-29 1960148/week @ 2024-10-06 1826325/week @ 2024-10-13 1647648/week @ 2024-10-20 1338223/week @ 2024-10-27 1288060/week @ 2024-11-03

6,365,836 downloads per month
Used in 5,515 crates (618 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–8MB
~61K SLoC