zigup icon indicating copy to clipboard operation
zigup copied to clipboard

remove zarc dependency in favor of powershell

Open marler8997 opened this issue 2 years ago • 1 comments

We can remove the zarc dependency (I no longer need to maintain it) by leveraging powershell, however, this appears to be ungodly slow. 7 times slower on the CI (test took 14 minutes instead of 2). It looks like this is a longtime known issue: https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/32

Another option would be to use System.IO.Compression.ZipFile from the .NET runtime with a fallback to powershell, this is what goto-bus-stop/setup-zig does, i.e.

> "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ; try { [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\0cb5b10f-ac04-4c24-b695-a765775d31fa', 'D:\a\_temp\245aed94-f57d-47db-8abe-29f7e193e5d6', $true) } catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath 'D:\a\_temp\0cb5b10f-ac04-4c24-b695-a765775d31fa' -DestinationPath 'D:\a\_temp\245aed94-f57d-47db-8abe-29f7e193e5d6' -Force } else { throw $_ } } ;"

see extractZip function in https://raw.githubusercontent.com/goto-bus-stop/setup-zig/default/dist/index.js

marler8997 avatar Jul 27 '23 07:07 marler8997

Extraction Performance for zig-windows-x86_64-0.12.0-dev.140+e078324db.zip (running on spinning hard disk):

  • 7Zip: 30 seconds
  • zarc: 40 seconds
  • .NET System.IO.Compression.ZipFile::ExtracttoDirectory: 2 minutes
  • Builtin "Right Click -> Extract All" from explorer: 4 minutes

marler8997 avatar Aug 19 '23 18:08 marler8997