From b91679539e7fbbd4ee4bccbdb5de5589c77cc322 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 27 Nov 2018 11:26:53 +0100 Subject: [PATCH] use proper platform cache dir --- src/bin/cargo-miri.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/cargo-miri.rs b/src/bin/cargo-miri.rs index 05d1bf322081..f06bb2d37235 100644 --- a/src/bin/cargo-miri.rs +++ b/src/bin/cargo-miri.rs @@ -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(); }