Skip to content

fix!: build against rind 0.4 and its corrected adapters - #8432

Draft
kixelated wants to merge 6 commits into
mainfrom
quest/m0/rind-adapters
Draft

kixelated wants to merge 6 commits into
mainfrom
quest/m0/rind-adapters

Conversation

@kixelated

@kixelated kixelated commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Moves MoQ to rind 0.4 and the adapter releases that publish with it (kixel-ai/rind#511), so main keeps building the day they publish. Finishes quest/m0/rind-adapters.md.

Problem

rind 0.4.0 is breaking, and every adapter MoQ uses moves to it in the same release: once they publish, the first Cargo.lock update breaks MoQ's build. rind holds that release until this PR is ready, so the two land together.

Approach

  • Cargo.toml: rind 0.4.0 (its wipe feature is gone, since keys always wipe: kixel-ai/rind#609), rind-jsonwebtoken 12.0.0 with jsonwebtoken 12 (kixel-ai/rind#948), rind-object-store 0.14.4, rind-rcgen 0.14.4, rind-rustls 0.23.4, rind-str0m 0.25.3 (bringing rind-dimpl 0.9.4). Cargo.lock stays main's: those versions are not on crates.io yet, so CI cannot resolve this branch until they publish.
  • Adapter call sites, in shipped code, tests, and benches (kixel-ai/rind#521, kixel-ai/rind#519, kixel-ai/rind#515): rind_rustls::default_provider(), rind_object_store::default_provider(), and rind_str0m::default_provider() lose their .unwrap()/.expect(..)/?; rind_jsonwebtoken::DEFAULT_PROVIDER is a static; KeyPair::generate(&alg) becomes generate_for(&alg); to_pkcs8().secret_pkcs8_der() becomes serialize_der()/serialized_der().
  • rind's own API (kixel-ai/rind#781, kixel-ai/rind#758): moq-auth moves from rind::signature::{EcdsaKeyPair, Ed25519KeyPair, RsaKeyPair, sign} to rind::{ecdsa, ed25519, rsa}. HKDF's Salt::extract and Prk::expand now return a Result that rind documents as never failing (rind-fips, which shares the API, refuses an empty salt or info), so moq-quic and moq-e2ee .expect it; a length-only expand becomes Prk::fill. MoQ calls no ML-KEM (kixel-ai/rind#606).
  • jsonwebtoken 12: EncodingKey::from_secret and DecodingKey::from_secret refuse an empty key and so return a Result, which moq-auth propagates; moq-auth already refuses an HMAC secret below its minimum at import, so no key it accepts changes.
  • rind 0.4 drops the runtime CPU check, so every CPU check in MoQ goes:
    • moq_crypto::cpu::check and moq_crypto::cpu::UnsupportedCpu are deleted; moq_crypto::cpu keeps only the Dit re-export, and moq-crypto drops thiserror.
    • moq_crypto::provider::provider() returns Provider and install_default() returns (), since neither can fail now. moq_tokio::crypto follows, and its check/UnsupportedCpu re-exports go.
    • The UnsupportedCpu error variants go from moq-auth, moq-e2ee, moq-hls, moq-quic, moq-rtmp, moq-tokio (TLS, mdns, QUIC backend), moq-uring, moq-webrtc, and qmux, with the doc comments that named them. moq-webrtc's private rtc_config(), rtc_config_with_codecs, and rtc_with_codecs lose their Result.
    • moq-e2ee and moq-rtmp drop their now-unused moq-crypto dependency; moq-auth and moq-hls take it only with the features that use the provider (client, async).
    • doc/bin/relay/index.md no longer says an unsupported CPU fails startup.
  • Deletes the quest and its links from quest/m3/release/cut.md.

Impact

Breaking (!):

  • moq-crypto: cpu::check and cpu::UnsupportedCpu removed; provider::provider() returns Provider instead of Result<Provider, UnsupportedCpu>; provider::install_default() returns ().
  • moq-tokio: crypto::check and crypto::UnsupportedCpu removed; crypto::provider()/install_default() as above; UnsupportedCpu variants removed from its TLS, mdns, and QUIC backend errors.
  • moq-auth, moq-hls, moq-quic, moq-rtmp, moq-uring, moq-webrtc, qmux: each error enum loses its UnsupportedCpu variant (moq-e2ee too, unpublished).

Migration: drop calls to cpu::check(), drop the ?/.unwrap() after provider() and install_default(), and delete match arms on UnsupportedCpu. rind 0.4 requires only the CPU features its target enables at compile time, so there is nothing left to refuse at run time.

Behavior: moq-auth's verify now refuses a token whose header has a crit naming anything but b64, or b64: false, as jsonwebtoken 12 does and RFC 7515 requires; js/auth's jose already refuses them. jsonwebtoken 12's stricter sub/iss/aud checks reach no MoQ path, since moq-auth validates those claims itself.

Wire: none.

Alternatives

  • Keep cpu::check as a check that cannot fail: rejected, since a Result that is never Err is the compatibility shim the guidelines forbid.
  • Propagate HKDF's never-failing Result as a new error variant: rejected, since callers would match an error rind says cannot happen.

Decisions

  • 2026-11-23 (maintainer): this session brings the PR up to rind 0.4.0's final scope ✅ (rejected: leave it to the release). The rind release stays held until it is ready.
  • 2026-11-09 (maintainer, the quest): one rind 0.4 carrying all of its breaking changes, with this PR ready before it publishes ✅ (rejected: the 0.4 quest alone, accepting a broken build until fixed; leaving both to release-plz).
  • 2026-11-24 (maintainer, via the coordinator): require rind-rcgen 0.14.4 ✅ (rejected: 0.14.5), since kixel-ai/rind#992 undid the adapters' double version bump and chore(moq-lite): release v0.6.1 #511 (head cc72a1ed94) now publishes 0.14.4.
  • Taken without asking, from the quest's recommendation: delete cpu::check and UnsupportedCpu ✅ (rejected: keep a check that cannot fail). That made provider() and install_default() infallible, which the quest's "moq_crypto::provider keeps its signatures" did not anticipate.
  • Taken without asking: .expect HKDF's never-failing Result ✅ (rejected: a new error variant per crate), and accept jsonwebtoken 12's crit refusal as is ✅ (rejected: working around it), since RFC 7515 requires it and js/auth already refuses.

Validation

rind 0.4 is not published, so the branch was checked against kixel-ai/rind main (1072fa4f7e) plus #511's version bumps, i.e. #511's head db8643e97e, exported with git archive and patched in through an uncommitted [patch.crates-io] for rind, rind-rustls, rind-jsonwebtoken, rind-object-store, rind-rcgen, rind-str0m, and rind-dimpl. cargo tree resolves one rind, 0.4.0, and jsonwebtoken 12.0.0.

Commands, run in the dev shell through quest gate, with the [patch.crates-io] appended to the root Cargo.toml and Cargo.lock resolved against it (both restored before committing):

  • cargo check --workspace --all-targets --all-features: passes with no warnings.
  • CHECK_MODULES="rs rs_cross toml markdown quest text" just ci origin/main: check rs (fmt, clippy, shear, sort, hakari), check rs_cross, markdown, quest, text, and toml pass. Its test rs stopped at fail-fast on two moq-net tests (late_lower_group::an_unfloored_lite05_join_drops_a_group_created_below_the_first_served_group, late_tail_reader::a_latest_reader_reads_a_finished_untimed_group) that timed out waiting on the host's test scheduler under load; moq-net does not depend on rind.
  • just rs test --no-fail-fast over every crate that reaches rind (moq-auth, moq-crypto, moq-e2ee, moq-hls, moq-quic, moq-relay, moq-rtmp, moq-tokio, moq-webrtc, moq-cli, moq-uring, qmux, moq-archive, moq-bench): 3500 passed. Its first run caught a merge regression, the WHIP server building its str0m config without rind's provider (7 moq-webrtc failures, No crypto provider available), fixed by building it from session::rtc_config().
  • just rs test --no-fail-fast over the rest that reach rind through them (hang, libmoq, moq-audio, moq-boy, moq-ffi, moq-gst, moq-interop, moq-mux, moq-rtsp, moq-srt, moq-transcode, moq-video): 3862 passed.

After #992, the rind-rcgen 0.14.4 change was checked against #511's new head cc72a1ed94 under the same uncommitted patch: cargo check --workspace --all-features passes and resolves rind 0.4.0 and rind-rcgen 0.14.4. Plain cargo check --workspace stops in moq-net, which does not depend on rind: its fuzz module calls origin::Config::new, which only test-support builds; cargo check -p moq-net --features fuzz fails the same way, so the break is already on main (moq-dev/moq#9505 fixes it). The tests were not rerun for this version-only change.

Those tests drive the real surfaces end to end: the relay's TLS, QUIC, WebTransport, and JWT paths (moq-relay integration, auth_lifetime), WHIP/WHEP over DTLS on rind-str0m (whip_and_whep_round_trip_opus), and the archive's object-store clients. just ci over every module did not run here; it runs once the lockfile resolves.

Waiting

  • kixel-ai/rind: publishes kixel-ai/rind#511's release: rind 0.4.0, rind-jsonwebtoken 12.0.0, rind-object-store 0.14.4, rind-rcgen 0.14.4, rind-rustls 0.23.4, rind-str0m 0.25.3, and rind-dimpl 0.9.4 (with rind-aws-lc-rs 1.0.3, rind-ring 0.17.4, rind-rand-core 0.10.1, and rind-python 0.1.3, which MoQ does not use). Re-read chore(moq-lite): release v0.6.1 #511's body for the final list first. Check that cargo search rind shows 0.4.0 and that each adapter's release requires rind 0.4, from https://crates.io/api/v1/crates/<crate>/<version>/dependencies; correct the requirements in Cargo.toml if a version moved, run cargo update -p rind -p rind-rustls -p rind-jsonwebtoken -p rind-object-store -p rind-rcgen -p rind-str0m -p jsonwebtoken, then cargo hakari generate and just ci, and mark ready.

Follow-ups

  • None to plan. MIGRATE.md for moq-auth, moq-crypto, moq-hls, moq-rtmp, and moq-tokio still describe the unsupported-CPU error, and moq-auth's still links moq-dev/rind; the next release cut writes the migration above into them.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, unknown effort
Implementer: Claude Code, claude-opus-5-5, high effort (iterate, M)

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high)

kixelated and others added 4 commits November 10, 2026 01:13
Quest-Claim: 849684300b525059
Drop moq_crypto::cpu::check and UnsupportedCpu, since rind 0.4 has no
runtime CPU check, and move every caller to the adapters' upstream APIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the merge with main (upstream str0m with rind-str0m, moq-e2ee as
its own crate) and follows what rind 0.4.0 now carries: no `wipe` feature,
the per-algorithm signature modules, HKDF's fallible-in-FIPS extract and
expand, rind-jsonwebtoken 12 with jsonwebtoken 12, rind-rcgen 0.14.5, and
rind-str0m 0.25.3. Drops the CPU checks main added since, and the
moq-crypto dependencies they alone needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixel-ai/rind#992 undid the adapters' double version bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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