fix(nix): give moq-relay's check phase a CA bundle via cacert#1919
Merged
Conversation
Auth::new builds a rustls client config up front, and tls.rs now hard-errors when rustls-native-certs finds no roots. The Nix build sandbox has no system trust store, so `nix build .#moq-relay` (which runs doCheck=true) failed in the relay auth tests, including the plain-http wiremock helpers that never actually make a TLS connection. Point SSL_CERT_FILE at cacert's bundle (and add cacert to nativeBuildInputs) for the moq-relay build so rustls-native-certs has a root to load. Scoped to moq-relay since it's the only crane package that constructs a TLS client during tests; the cross x86_64-darwin output sets doCheck=false so the extra env is inert there. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Nix overlay for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches✨ Simplify code
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. Comment |
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.
Summary
nix build .#moq-relayfails during its check phase (doCheck = true) in the relay auth tests. The root cause:Auth::newalways builds a rustls client config up front (auth.rs:688).rustls-native-certsreturns no roots and the tests blow up, including plain-http://wiremock helpers (e.g.key_dir: Some(format!("{}/keys/", server.uri()))) that never make a TLS connection.This wires a CA bundle into the
moq-relaycrane build so the check phase passes:Notes for reviewers
moq-relaysince it's the only crane package that constructs a TLS client during tests.moq-cli/moq-token-clialso rundoCheck = truebut don't hit this path.x86_64-apple-darwinrelay output inherits these args but setsdoCheck = false, so the extra env is inert there.nativeBuildInputsentry is redundant given the explicitSSL_CERT_FILE, but keeps the cacert dependency visible/idiomatic.Test plan
nixfmtclean, flake still evaluates (nix eval .#moq-relay.drvPath).SSL_CERT_FILE=…/nss-cacert-3.123/etc/ssl/certs/ca-bundle.crt,nss-cacertinnativeBuildInputs, anddoCheck=1withcargo test -p moq-relayin the check phase.nix build .#moq-relay(not run locally; long source build).🤖 Generated with Claude Code
(Written by Claude)