8 releases (4 breaking)

✓ Uses Rust 2018 edition

0.5.0 Aug 21, 2019
0.4.2 Aug 8, 2019
0.3.4 Jan 15, 2019
0.3.3 May 11, 2018
0.1.0 Jul 18, 2017
Download history 9199/week @ 2019-05-08 10105/week @ 2019-05-15 13647/week @ 2019-05-22 13989/week @ 2019-05-29 14621/week @ 2019-06-05 14735/week @ 2019-06-12 14305/week @ 2019-06-19 10254/week @ 2019-06-26 9950/week @ 2019-07-03 8445/week @ 2019-07-10 8863/week @ 2019-07-17 11228/week @ 2019-07-24 9373/week @ 2019-07-31 9851/week @ 2019-08-07 10861/week @ 2019-08-14

48,957 downloads per month
Used in 67 crates (13 directly)

MIT/Apache

12KB
145 lines

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 libraries 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/Apache-2.0


lib.rs:

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.

See also the dirs crate.

Note that as of 2019/08/06 it appears that cargo uses this crate, but rustup does not.

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 libraries 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.

Dependencies

~30KB