Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows cache permission #2474

Merged
merged 4 commits into from
Jul 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions lib/cache/src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Hywan marked this conversation as resolved.
Show resolved Hide resolved
format!("failed to create cache directory: {}", path.display()),
))
} else {
Ok(Self { path, ext: None })
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions scripts/windows-installer/wasmer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DisableWelcomePage=no
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
ValueData: "{%USERPROFILE}\.wasmer\cache"; Flags: preservestringtype

[Files]
Source: "..\..\package\bin\*"; DestDir: "{app}\bin"
Expand All @@ -29,7 +29,7 @@ Source: "..\..\package\ATTRIBUTIONS"; DestDir: "{app}"
Source: "wax.cmd"; DestDir: "{app}\bin"

[Dirs]
Name: "{app}\cache"
Name: "{%USERPROFILE}\.wasmer"

[Code]
const EnvironmentKey = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment';
Expand Down