use proper platform cache dir

This commit is contained in:
Ralf Jung 2018-11-27 11:26:53 +01:00
parent 4459d14243
commit b91679539e

View File

@ -145,8 +145,9 @@ fn setup(ask_user: bool) {
}
}
// Next, we need our own libstd. We will do this work in ~/.miri.
let dir = directories::UserDirs::new().unwrap().home_dir().join(".miri");
// Next, we need our own libstd. We will do this work in whatever is a good cache dir for this platform.
let dirs = directories::ProjectDirs::from("miri", "miri", "miri").unwrap();
let dir = dirs.cache_dir();
if !dir.exists() {
fs::create_dir(&dir).unwrap();
}