Zig package protocol errors on Github CI?

I have a strange problem since a couple of days in all my projects which use the Zig dev version on Github CI when trying to fetch packages:

/Users/runner/work/sokol-zig-imgui-sample/sokol-zig-imgui-sample/build.zig.zon:7:20: error: unable to create fetch stream: ProtocolError
            .url = "git+https://github.com/floooh/sokol-zig.git#6ed171f4b0fd637cb80aa70d9dcc5f208c2e8035",

E.g. error: unable to create fetch stream: ProtocolError

Locally (on macOS) it works fine, the CI machine which breaks is also macOS though. nvm, this was just a caching effect, after deleting the global Zig cache the same problem happens locally.

This is the build.zig.zon (nothing has changed there though, except for updating the packages from time to time)

The Github Action to install Zig is mlugg/setup-zig (I don’t think this is at fault though).

Anybody else seeing this?

PS: this ticket seems to be related: fetch regressions · Issue #24732 · ziglang/zig · GitHub… and towards the end I see that at least @kj4tmp runs into the same issue (now I’m not sure though if I’ve been seeing the exact same problem since the beginning, or if the actual error has changed from one to another).

1 Like

Yep, I’ve also been seeing error: unable to create fetch stream: ProtocolError in CI (Github actions windows and ubuntu latest) and locally on MacOS.

I had just assumed it’s related to fetch regressions · Issue #24732 · ziglang/zig · GitHub and figured it would start working again soon

1 Like

You should still be able to load a package into your cache from a local file (download it using your browser and pass a file path to zig fetch). This should at least unblock local development until the fetch regressions are fixed.

Or alternatively, you can also just clone the git source repository of the package and then do that same ‘fetch from local directory’. That’s what I usually do for local development on the dependencies (it’s similar to ‘npm link’, except it copies into the Zig cache instead of creating a filesystem link):

zig fetch --save=[depname] [path-to-pkg-directory]

…just don’t forget to fix your build.zig.zon afterwards back to URLs :slight_smile: