From fc40b23b5ca4de2c1404595b0739ee15a023fea4 Mon Sep 17 00:00:00 2001 From: chenyukang Date: Fri, 16 Jul 2021 13:30:49 +0800 Subject: [PATCH 1/4] print more detailed message for cache directory creation --- lib/cache/src/filesystem.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/cache/src/filesystem.rs b/lib/cache/src/filesystem.rs index 1d6987191b9..cbd30c1cdbb 100644 --- a/lib/cache/src/filesystem.rs +++ b/lib/cache/src/filesystem.rs @@ -63,8 +63,15 @@ impl FileSystemCache { } } else { // Create the directory and any parent directories if they don't yet exist. - create_dir_all(&path)?; - Ok(Self { path, ext: None }) + let res = create_dir_all(&path); + if res.is_err() { + Err(io::Error::new( + io::ErrorKind::Other, + format!("failed to create cache directory: {}", path.display()), + )) + } else { + Ok(Self { path, ext: None }) + } } } From c1ad5922df1441a3da1d536ff5d28e2b370afc39 Mon Sep 17 00:00:00 2001 From: yukang Date: Fri, 16 Jul 2021 20:13:22 +0800 Subject: [PATCH 2/4] fix #2454, won't set WASMER_CACHE_DIR for Windows --- scripts/windows-installer/wasmer.iss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/windows-installer/wasmer.iss b/scripts/windows-installer/wasmer.iss index 772c24aacad..b6b0f6c6711 100644 --- a/scripts/windows-installer/wasmer.iss +++ b/scripts/windows-installer/wasmer.iss @@ -17,8 +17,6 @@ DisableWelcomePage=no [Registry] Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "WASMER_DIR"; \ ValueData: "{app}"; Flags: preservestringtype -Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "WASMER_CACHE_DIR"; \ - ValueData: "{app}\cache"; Flags: preservestringtype [Files] Source: "..\..\package\bin\*"; DestDir: "{app}\bin" @@ -28,9 +26,6 @@ Source: "..\..\package\LICENSE"; DestDir: "{app}" Source: "..\..\package\ATTRIBUTIONS"; DestDir: "{app}" Source: "wax.cmd"; DestDir: "{app}\bin" -[Dirs] -Name: "{app}\cache" - [Code] const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'; From 6cd570f1a82a344fc3b36f125601711f6bf5b5f1 Mon Sep 17 00:00:00 2001 From: yukang Date: Fri, 16 Jul 2021 20:15:15 +0800 Subject: [PATCH 3/4] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c55fae80ef..aae8baf0d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C - [#2427](https://github.com/wasmerio/wasmer/pull/2427) Update `loupe` to 0.1.3. ### Fixed +- [#2454](https://github.com/wasmerio/wasmer/issues/2454) Won't set `WASMER_CACHE_DIR` for Windows. - [#2426](https://github.com/wasmerio/wasmer/pull/2426) Fix the `wax` script generation. ## 2.0.0 - 2021/06/16 From 68518213bc57b6a2b94dedea1cad96d938a72914 Mon Sep 17 00:00:00 2001 From: yukang Date: Mon, 19 Jul 2021 20:39:47 +0800 Subject: [PATCH 4/4] set WASMER_CACHE_DIR to user profile cache --- scripts/windows-installer/wasmer.iss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/windows-installer/wasmer.iss b/scripts/windows-installer/wasmer.iss index b6b0f6c6711..753c259ba6c 100644 --- a/scripts/windows-installer/wasmer.iss +++ b/scripts/windows-installer/wasmer.iss @@ -17,6 +17,8 @@ DisableWelcomePage=no [Registry] Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "WASMER_DIR"; \ ValueData: "{app}"; Flags: preservestringtype +Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName: "WASMER_CACHE_DIR"; \ + ValueData: "{%USERPROFILE}\.wasmer\cache"; Flags: preservestringtype [Files] Source: "..\..\package\bin\*"; DestDir: "{app}\bin" @@ -26,6 +28,9 @@ Source: "..\..\package\LICENSE"; DestDir: "{app}" Source: "..\..\package\ATTRIBUTIONS"; DestDir: "{app}" Source: "wax.cmd"; DestDir: "{app}\bin" +[Dirs] +Name: "{%USERPROFILE}\.wasmer" + [Code] const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';