Repository navigation
herdr-core, herdr-desktop: fetch Zig deps with Nix fetchers - #2
Open
iamppborah wants to merge 4 commits into
Open
iamppborah wants to merge 4 commits into
iamppborah wants to merge 4 commits into
Conversation
Assisted-by: Claude Code (claude-opus-5-5) Co-authored-by: Philip Munksgaard <[email protected]> Co-authored-by: Prasurjya Pran Borah <[email protected]>
Assisted-by: Claude Code (claude-opus-5-5) Co-authored-by: Philip Munksgaard <[email protected]> Co-authored-by: Prasurjya Pran Borah <[email protected]>
zig.fetchDeps runs `zig build --fetch`, and on Darwin Zig only loads root certificates from /System/Library/Keychains/SystemRootCertificates.keychain and /Library/Keychains/System.keychain. The sandbox hides the latter, so the fetch fails with CertificateBundleLoadFailure. Use the vendored Ghostty's build.zig.zon.nix (generated by zon2nix) instead, and put the packages in vendor/ghostty/zig-pkg, where Zig 0.16 looks for them. Copy the file again from vendor/ghostty when the vendored Ghostty changes.
Same change as for herdr-core: Zig's own fetch cannot load root certificates in the Darwin sandbox. Use the vendored Ghostty's build.zig.zon.nix and put the packages in vendor/ghostty/zig-pkg. Copy the file again from vendor/ghostty when the vendored Ghostty changes.
6 of 13 tasks
tophcodes
force-pushed
the
init-herdr
branch
2 times, most recently
from
November 2, 2026 11:52
1b4545c to
cccbcd4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the aarch64-darwin failure in matteo-pacini's
nixpkgs-reviewon NixOS#581031 (sandbox = true). My earlier review there passed only because thezig-depsoutputs were still in my store from an unsandboxed build; with them removed, it fails the same way here.Cause:
zig_0_16.fetchDepsrunszig build --fetch. On Darwin, Zig only loads root certificates from/System/Library/Keychains/SystemRootCertificates.keychainand/Library/Keychains/System.keychain(std/crypto/Certificate/Bundle/macos.zig), and the sandbox hides the second one, so every download fails withCertificateBundleLoadFailure.__impureHostDepscan't help:/Library/Keychainsisn't inallowed-impure-host-deps.Fix (one commit per package): use the vendored Ghostty's
build.zig.zon.nix(generated by zon2nix, the same approach aspkgs/by-name/gh/ghostty/deps.nix), copied asghostty-deps.nix, and copy the packages intovendor/ghostty/zig-pkg, where Zig 0.16 looks for them. Each package has its own copy, since herdr-core and herdr-app pin their Ghostty submodule separately; today both are identical. The file has to be copied again fromvendor/ghostty/build.zig.zon.nixwhen the vendored Ghostty changes; no update script yet.Tested on aarch64-darwin with
sandbox = true:--option substitute false. All 39 were fetched locally in the sandbox; the version check passes.Herdr.app/Contents/MacOS/Herdris the binary,bin/herdr-applinks to it.ghosttybuilds on Linux.herdr 0.9.5 (the TUI) has the same issue: its
zig-depsfails the same way when fetched in the Darwin sandbox, but cache.nixos.org already has it, so it doesn't show.🤖 Generated with Claude Code