Skip to content

fix(nix): allow local networking in the Darwin build sandbox - #22

Merged
paveq merged 1 commit into
mainfrom
fix/darwin-local-networking
Oct 29, 2026
Merged

paveq merged 1 commit into
mainfrom
fix/darwin-local-networking

Conversation

@paveq

@paveq paveq commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Problem

nix build (and any flake consuming packages.default) fails on macOS since Airlock v2: 37 proxy::server::tests panic at src/proxy/server/tests.rs:302 with Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" }.

The tests bind a TcpListener on 127.0.0.1, and the Darwin Nix build sandbox denies local networking unless the derivation opts in. The macOS CI job runs cargo test outside the Nix sandbox, so it doesn't see this.

Fix

Set __darwinAllowLocalNetworking = true; on the package. It permits localhost networking only — the build still has no internet access — and is the standard nixpkgs idiom for test suites that start a local server. The tests keep running under Nix rather than being skipped, which matters since they cover secret redaction and proxy auth.

Verification

nix build on aarch64-darwin: test result: ok. 882 passed; 0 failed; 4 ignored.

Not verified on Linux. The flag is a no-op there (the Linux sandbox already has its own loopback), but the system_curl_* tests call the system curl, which a Linux Nix build doesn't provide unless it's added to nativeCheckInputs — worth confirming those pass or skip cleanly.

🤖 Generated with Claude Code

The proxy unit tests bind listeners on 127.0.0.1. The Darwin Nix build
sandbox refuses that with EPERM unless the derivation opts in, so
`nix build` on macOS failed 37 proxy::server tests at
src/proxy/server/tests.rs:302. The flag only permits localhost
networking; the build stays offline.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@paveq
paveq merged commit 0bdf690 into main Oct 29, 2026
2 checks passed
@paveq
paveq deleted the fix/darwin-local-networking branch October 29, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant