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(Expand-Archive): import it from Microsoft.PowerShell.Archive module #350

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
fix(Expand-Archive): import it from Microsoft.PowerShell.Archive module
For PowerShell 5.1, Expand-Archive default from Pscx module use -OutputPath
instead of -DestinationPath parameter.

```
Downloading WasmEdge 0.14.0 from GitHub; installing to C:\Users\Administrator\AppData\Roaming\moxin-org\moly\data\WasmEdge-0.14.0-Windows
 --> Using WASI-NN plugin at: https://github.com/second-state/WASI-NN-GGML-PLUGIN-REGISTRY/releases/download/b3499/WasmEdge-plugin-wasi_nn-ggml
-noavx-0.14.0-windows_x86_64.zip
Successfully installed wasmedge to: C:\Users\Administrator\AppData\Roaming\moxin-org\moly\data\WasmEdge-0.14.0-Windows
thread 'main' panicked at moly-runner\src\main.rs:242:10:
failed to find or install wasmedge dylibs
```

Also see: PowerShell/Microsoft.PowerShell.Archive#52
zjp-CN committed Jan 18, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 77bd79a0e86eba96d6f974b20294cd859f9dfd21
4 changes: 2 additions & 2 deletions moly-runner/src/main.rs
Original file line number Diff line number Diff line change
@@ -434,10 +434,10 @@ fn install_wasmedge<P: AsRef<Path>>(install_path_ref: P) -> Result<PathBuf, std:
r#"
$ProgressPreference = 'SilentlyContinue' ## makes downloads much faster
Invoke-WebRequest -Uri "{WASMEDGE_0_14_0_WINDOWS_URL}" -OutFile "$env:TEMP\WasmEdge-0.14.0-windows.zip"
Expand-Archive -Force -Path "$env:TEMP\WasmEdge-0.14.0-windows.zip" -DestinationPath "{}"
Microsoft.PowerShell.Archive\Expand-Archive -Force -Path "$env:TEMP\WasmEdge-0.14.0-windows.zip" -DestinationPath "{}"

Invoke-WebRequest -Uri "{wasi_nn_plugin_url}" -OutFile "$env:TEMP\{wasi_nn_dir_name}.zip"
Expand-Archive -Force -Path "$env:TEMP\{wasi_nn_dir_name}.zip" -DestinationPath "$env:TEMP\{wasi_nn_dir_name}"
Microsoft.PowerShell.Archive\Expand-Archive -Force -Path "$env:TEMP\{wasi_nn_dir_name}.zip" -DestinationPath "$env:TEMP\{wasi_nn_dir_name}"
Copy-Item -Recurse -Force -Path "$env:TEMP\{wasi_nn_dir_name}\{wasi_nn_dir_name}\lib\wasmedge" -Destination "{}"
$ProgressPreference = 'Continue' ## restore default progress bars
"#,