Skip to content

ci: the merge gate lints macOS and Windows Rust from Linux - #9270

Draft
kixelated wants to merge 2 commits into
mainfrom
quest/m0/ci/platform-cross-lint
Draft

kixelated wants to merge 2 commits into
mainfrom
quest/m0/ci/platform-cross-lint

Conversation

@kixelated

@kixelated kixelated commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

just ci (and just check) now run clippy for aarch64-apple-darwin and x86_64-pc-windows-msvc from Linux over the Rust crates the diff changed plus their dependents, so a platform-gated compile error or unfulfilled #[expect] fails the merge queue instead of the nightly macOS and Windows lanes. Tests stay on Linux; real macOS and Windows runners stay out of the gate.

  • sh/dispatch.sh: new rs_cross module, same scope as rs, its own lane, running just rs cross-lint-changed.
  • sh/rs/select.sh: new cross action sharing platform's selection and flags (moq-gst excluded, the cli's device and sound-server features on). Under --all it also excludes moq-auth-fuzz and qmux-fuzz, whose libFuzzer C++ includes sys/syscall.h, which zig's macOS libc lacks; fuzzing runs only on Linux.
  • sh/rs/cross-lint.sh: builds .#rust-cross (new in flake.nix: the pinned 1.98.1 toolchain with clippy and those two targets' std, kept out of the dev shell like rust-nightly), puts the mbx shim back in front, and runs one cargo clippy --target=… --target=… --all-targets -- -D warnings, so both targets share host build scripts and proc macros.
  • sh/rs/zig-cc.sh, zig-c++.sh, zig-ar.sh: the CC, CXX, and AR for build scripts on those targets. They strip the Apple and LLVM target flags cc-rs adds, which zig rejects, and pick the zig target from Cargo's TARGET.
  • Fixes the Windows-only dead code the lint found: test_util::Spent::peak in moq-video is read only by the hardware encoders' tests, so an openh264 build without VideoToolbox, NVENC, or VA-API never reads it. It now carries a cfg_attr-scoped expect(dead_code).
  • Deletes the code audit's manual cross-clippy step and rewords CONTRIBUTING.md: platform.yml now only needs dispatching to run tests.

Choices made without asking

  • msvc target, MinGW headers for C. The Rust code is linted as x86_64-pc-windows-msvc, the target release-binary.yml ships, so target_env = "msvc" cfgs are checked. Build-script C is compiled by zig against MinGW headers, because nixpkgs' windows.sdk (the MSVC CRT and SDK via xwin) is unfree and requires accepting Microsoft's license (xwin --accept-license). A lint links nothing, so the objects' ABI never matters. The gnu target was not needed.
  • Own lane, not inside the rs lane. Lanes run concurrently, so the cross build overlaps the rs lane's long test run instead of extending it. Cargo's build-directory lock barely contended in the runs below (one "Blocking waiting for file lock on build directory" over all of them).
  • just check runs it locally too, since it shares the module list with just ci. A host without nix or zig skips it (and fails under CI_STRICT), like any other module.
  • Adding cross-lint.sh and the zig wrappers to select.sh's "select everything" paths, the same as platform.sh.

Validation

  • just rs cross-lint-changed --all: passes for both targets (after the moq-video fix). Before that fix the Windows target failed with field 'peak' is never read in rs/moq-video/src/encode/backend/mod.rs.
  • Known break caught: I reverted fix(ci): just check passes on macOS #8538's moq-audio fix (all(test, not(target_os = "macos")) back to test on the clippy::large_enum_variant expectation in rs/moq-audio/src/capture.rs) and ran just rs cross-lint-changed on a list containing only that file. It failed with error: this lint expectation is unfulfilled at capture.rs:185, the same error the macOS lane reported.
  • cargo clippy -p moq-video --no-default-features --features openh264 --lib --tests -- -D warnings on Linux still passes (the new expectation is fulfilled there too).
  • python3 sh/rs/select.test.py passes; shellcheck, shfmt, nixfmt, and just --fmt --check are clean.

Cost to a queue run (local, 24 cores, shared with other agents, mbx cache warm for unchanged crates)

Each run appended a fresh comment to the edited file, so the edited crate and its dependents miss the cache. "rs" is just rs lint-changed plus test-changed, the rs lane; "both" runs the rs and rs_cross lanes concurrently, as the gate does.

Diff rs alone (wall / CPU) rs_cross alone both together
rs/moq-relay/src/main.rs (typical) 53 s / 91 s, 47 s / 88 s 7 s / 24 s 44 s / 108 s, 48 s / 105 s
rs/moq-net/src/lib.rs (selects nearly every crate) 297 s / 794 s 40 s / 149 s see below
  • Typical diff: no measurable wall added; about 15-25 CPU-seconds.
  • moq-net edit: the cross lane costs 40 s wall and about 150 CPU-seconds alone, about 15% on top of the rs lane's CPU. The concurrent wall numbers on this host were dominated by load: the host's admission control pauses processes under load, which made four tests at a time hit nextest's 60 s timeout in both the rs-alone and the both runs (different tests each time, in moq-net and moq-tokio). That is not caused by this change. A conservative upper bound on the added wall is the cross lane's 40 s; on the queue runner, where the lanes overlap the rs lane's roughly 200 s test run, I expect less. This PR's own queue run selects the whole workspace (it changes select.sh), and its per-module timing table will show the --all cost.
  • A diff that touches no Rust doesn't select rs_cross at all.
  • First use on a runner downloads the two rust-std components (about 22 MiB of fetches here, then a local build of the toolchain join).

Public API and wire impact

None. CI and tooling only, plus a test-only lint attribute in moq-video.

Caused by

  • moq-dev/moq#8905 - added Spent::peak, which no test reads on Windows with openh264 (found by check)

Follow-ups

None.

Models

Size: M
Implementer: Claude, claude-opus-5-5, medium effort (arm A)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 3f085f9fa221009ac5947821f583cb4efb22fb48

  • Base: origin/main at 2661d47

  • Risk: high, The new cross-target CI gate and compiler wrappers could fail or consume extra runner resources for contributors’ Rust changes, with a revert restoring the gate but not recovering resources already spent.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a1fc1b-c5d0-7ec0-a88b-c0247bb33233

  • Reviewer: Codex, gpt-6.1-sol, high effort

  • Session: 01a1fc18-c8a1-7c50-9bb8-fc5b35510b60, round 2

  • Score: 10/10, Source inspection confirms the toolchain-input selection gap is fixed, with no new findings in the changes since the previous review.

  • Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0

  • Findings: none

  • The last round's findings, at 9843070:

    • Fixed: medium, sh/dispatch.sh:125: Select cross-lint when its toolchain inputs change; At the head, sh/dispatch.sh includes flake.nix and flake.lock in rs_cross’s scope, and sh/rs/select.sh selects the whole workspace for cross when either file changes.

kixelated and others added 2 commits November 20, 2026 17:13
just ci runs clippy for aarch64-apple-darwin and x86_64-pc-windows-msvc over
rs's selection (the new rs_cross module), with a flake-pinned toolchain
carrying those targets' std and zig compiling build scripts' C. Fixes the
Windows-only dead code it found in moq-video's test util.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title The merge gate lints macOS and Windows code from Linux ci: the merge gate lints macOS and Windows Rust from Linux Nov 21, 2026

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