docs: Add Zig package cache guidance#76
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2844726b21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # git+https dependencies can use the Git proxy through Git's URL rewrite. | ||
| git config --global url."http://localhost:8080/git/github.com/".insteadOf "https://github.com/" |
There was a problem hiding this comment.
Use a Zig-visible proxy URL for git dependencies
When the dependency URL in build.zig.zon is git+https://github.com/..., this git config url.*.insteadOf setting is ignored because Zig's package fetcher handles git+http(s) itself (it strips the git+ prefix and opens its own HTTP Git session in Package/Fetch.zig:initResource) rather than invoking the Git CLI. In that scenario zig build still contacts GitHub directly, so users following this setup get no /git caching and CI environments relying on the proxy/allowlist will still fail or bypass content-cache.
Useful? React with 👍 / 👎.
Zig users can already route package source downloads through content-cache, but the README does not make that path obvious. That makes it easy to assume content-cache needs a new Zig-specific remote build cache protocol, even though Zig currently uses URL-based package fetches and local filesystem build caches.
This documents the supported setup: use the existing Git proxy for
git+httpsdependencies, use/fetchfor tarball dependencies, and keepZIG_GLOBAL_CACHE_DIRon persistent CI storage for compile output reuse.Validation:
git diff --checkmise run test