I wonder if people would find it worth having a GitHub action that installs the latest development version of Zig to the runner. I’ve seen some actions that exist only to install python, for example.
2 Likes
Is this what you’re looking for?
3 Likes
Note that the caching is currently broken for goto-bus-stop/setup-zig
(Caching not working · Issue #72 · goto-bus-stop/setup-zig · GitHub , Caching Failure · Issue #59 · goto-bus-stop/setup-zig · GitHub ).
There’s a fork with a fix as detailed in this comment:
opened 09:27PM - 18 Oct 23 UTC
This has been working great except the cache never seems to work so it downloads… new every time.
```
Run goto-bus-stop/setup-zig@v[2](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:2)
with:
version: 0.12.0-dev.1092+68ed78775
cache: true
attempting restore of zig-zig-windows-x86_64-0.12.0-dev.1092+68ed78775 to C:\hostedtoolcache\windows\zig\0.12.0-dev.1092+68ed78775\x64
no cached version found. downloading zig zig-windows-x86_64-0.12.0-dev.1092+68ed78775
"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\cc549bce-4de7-4f1b-bbb9-95518[3](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:3)05898c', 'D:\a\_temp\9e02c0[4](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:4)d-874[5](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:5)-46a6-84ff-f477fe680a[5](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:6)9', $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\cc549bce-4de7-4f1b-bbb9-95518305898c' -DestinationPath 'D:\a\_temp\9e02c04d-8745-4[6](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:7)a6-84ff-f4[7](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:8)7fe6[8](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:9)0a5[9](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:10)' -Force } else { throw $_ } } ;"
adding zig 0.12.0-dev.[10](https://github.com/britown88/chron4/actions/runs/6566761611/job/17838117964#step:3:11)92+68ed78775 at C:\hostedtoolcache\windows\zig\0.12.0-dev.1092\x64 to local cache zig-zig-windows-x86_64-0.12.0-dev.1092+68ed78775
"C:\Program Files\Git\usr\bin\tar.exe" --posix -cf cache.tzst --exclude cache.tzst -P -C D:/a/chron4/chron4 --files-from manifest.txt --force-local --use-compress-program "zstd -T0"
Failed to save: Unable to reserve cache with key zig-zig-windows-x86_64-0.12.0-dev.1092+68ed78775, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/master, Key: zig-zig-windows-x86_64-0.12.0-dev.1092+68ed78775, Version: 3c01fb4cea4efcddb92bea7a65ce5b1f03c58bf039a2b2f7521c77414d872b2f
zig installed at C:\hostedtoolcache\windows\zig\0.12.0-dev.1092\x64
```
Any idea?
4 Likes
dimdin
March 13, 2024, 1:38pm
5
It works using the latest v2 branch.
Run goto-bus-stop/setup-zig@v2
with:
version: master
cache: true
attempting restore of zig-zig-linux-x86_64-0.12.0-dev.3282+da5b16f9e to /opt/hostedtoolcache/zig/master/x64
Cache Size: ~66 MB (68864476 B)
/usr/bin/tar -xf /home/runner/work/_temp/62fe8742-a997-4d48-ae46-96cb042e0b99/cache.tzst -P -C /home/runner/work/zig-recover/zig-recover --use-compress-program unzstd
Received 68864476 of 68864476 (100.0%), 65.7 MBs/sec
Cache restored successfully
using cached zig install: /opt/hostedtoolcache/zig/master/x64
zig installed at /opt/hostedtoolcache/zig/master/x64
2 Likes
It works as long as you don’t specify a specific dev build, so master
and 0.11.0
work, but 0.12.0-dev.3284+153ba46a5
doesn’t cache properly (it fails due to extracting as 0.12.0-dev.3284
but being cached as 0.12.0-dev.3284+153ba46a5
IIUC).
3 Likes