zigfetch
zigfetch behaves similarly to zig fetch, but utilizing the capabilities of libcurl for its functionality.
HTTP support within Zig's standard library isn't currently stable, this proxy issue make it even harder, resulting in multiple errors occurring during dependency downloads when building Zig projects. This poses a significant challenge for Chinese developers owing to the Great Firewall.

As a consequence, zigfetch was developed. It operates via libcurl to ensure that both the http_proxy and https_proxy environment variables function correctly.
Usage
| |
USAGE:
./zig-out/bin/zigfetch [OPTIONS] [--] [package-dir or url]
OPTIONS:
-h, --help Show help
-V, --version Show version
-v, --verbose Show verbose log
-t, --timeout INTEGER Libcurl http timeout in seconds(default: 60)
-n, --no-dep Disable fetch dependencies
-d, --debug-hash Print hash for each file
If the argument is a local directory, zigfetch will attempt to open build.zig.zon, download dependencies specified in the .dependencies fields, and then calculate hashes for each package. If these hashes match those in the .hash fields, zigfetch will move them to ~/.cache/zig/p/{hash} after completion.
If zigfetch succeeds, zig build will build the project directly, assuming the dependencies already exist.
Proxy config
This is a demo for socks5 proxy setup:
| |
GIT_SSH_COMMAND is used for fetch git+http(s) dependencies.