Repository navigation
id: give sandboxed check phases a CA bundle so http_fetch tests pass in the nix build (#12608) - #12620
Merged
Conversation
…tp_fetch tests can construct their reqwest client (#12608)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 8 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 22, 2026
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.
Closes #12608. Unblocks #1372's close condition (a completed full-nightly verdict) and #1374's readiness evidence.
Diagnosis
The three
http_fetch_*schedule tests fetch plain HTTP from a localTcpListener— they never touch TLS — but constructing the production reqwest client is what fails in the nix build sandbox:id-worldspins reqwest 0.13 with therustlsfeature, which routes through rustls-platform-verifier 0.7.1. On Unix that verifier builds its root store only fromrustls_native_certs::load_native_certs()and returnsGeneral("No CA certificates were loaded from the system")when the store comes back empty (rustls-platform-verifierverification/others.rs)./etc/ssl/certs, and nothing setsSSL_CERT_FILE— so the store is always empty there.world/http_fetch.rs'sclient()treats a builder error as recoverable and falls back toreqwest::blocking::Client::new(), which panics on the same error (reqwestblocking/client.rs:1278). The panic lands on the fetch thread, the join turns it intofetch_failed, and the three tests fail their assertions — failing theid(id-web) derivation's checkPhase and, with it, the dependency build of every NixOS VM check. Evidence: nightly run 45035241965, log lines 2026-11-22T15:35:53Z (panics) and 15:36:03Z (cascade fromid-0.1.0.drv).Fix
Give the sandboxed check environments a CA bundle instead of touching the client or the tests (assertions unchanged, production behavior unchanged — nothing outside the sandbox sets this):
pkgs/id/nix-common.nix: new sharedtestSslCertFile= the nixpkgscacertbundle path, with the mechanism documented. rustls-native-certs honoursSSL_CERT_FILE, so this is the loader's own supported route to a non-system store.pkgs/id/flake.nix:id-webandid-libpreCheckexportSSL_CERT_FILE— their checkPhases run the workspace suite that contains the three tests (id-web is the derivation whose failure cascaded).mkCheckWithsetsSSL_CERT_FILEas a derivation attribute (theID_TEST_FAKE_SHpattern), covering the just-recipe checks —test,test-unit, the shards,crash-gate,ci— which run the same lib tests under nextest in the sandbox and would panic identically in a fullnix flake check.Not covered, deliberately:
pkgs/id/default.nixis the legacy standalonenix-buildpath (not used by the flake or the nightly) and carries the same latent shape; noted here rather than silently fixed out of scope.Verification
id-lib,id-web,checks.test-unitandchecks.nixos-serveall instantiate.nix build .#id-libon unfixedmain(fleet-run 45042161414) passes with the three testsok, so that venue's build sandbox is evidently not cert-free the way the GitHub-hosted nightly sandbox is. The before/after verdict therefore comes from the venue that produced the failure:main, real nightly sandbox): run 45035241965 — the three tests panic,id-0.1.0.drvcheckPhase fails, VM checks never start (Lane I's evidence on id: http_fetch schedule tests panic in the nix build sandbox — reqwest finds no system CA certificates #12608).id e2e nightlydispatch, run 45045565708 withonly_checks=nixos-serve test-unit— conclusion: success.[nightly] check 'nixos-serve' passed(17:21:39Z): theidderivation's checkPhase is green — all three testsokin the real sandbox (http_fetch_refuses_redirects_off_the_list_and_past_the_hop_cap,http_fetch_round_trip_through_the_actor,http_fetches_journal_nothing_and_replay_is_unaffected, log lines 17:20:16Z) — and the build proceeded intovm-test-run-id-serve, which started its VM ("start all VMs", "server: starting vm") and passed. Zerotest result: FAILEDlines and zero "No CA certificates" occurrences in the full 4.7 MB log.[nightly] check 'test-unit' passed(17:33:43Z): themkCheckWithhalf of the fix verified in the same sandbox. Targeted summary: "failed checks: none".nix-fmt-checkon this branch (fleet-run 45045965815, HEADa6339d9): passed.