From 2231add2ac3b3baf68b6c1fa9767ed5d6ec54eeb Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 10:15:13 -0700 Subject: [PATCH 1/7] ci: compile the Windows and macOS code on every PR Move the Windows and macOS compile jobs from nightly.yml into a new platform.yml that runs on every pull request and on pushes to main and dev, so platform-only code breaks its own PR instead of the next nightly. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/nightly.yml | 82 +----------------- .github/workflows/platform.yml | 105 +++++++++++++++++++++++ cpp/obs/justfile | 8 +- quest/m1/audio-codecs/README.md | 2 +- quest/m2/audio-decode-mediafoundation.md | 2 +- rs/justfile | 14 ++- 6 files changed, 118 insertions(+), 95 deletions(-) create mode 100644 .github/workflows/platform.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 546458adae5..809b2fbf967 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,10 +10,7 @@ name: Nightly # that a PR gate can't justify for how rarely it catches something. `obs` is # diff-independent because its PR-time counterpart can't be: obs.yml has to # name the paths that can break an external link to libmoq.a, and no list of -# paths covers every one of them (see the comment there). `windows` and `macos` -# are diff-independent because what they catch is a whole target's worth of -# `#[cfg(target_os = ...)]` code that no Linux job compiles at all, and those -# runners are throttled too hard to gate every PR on. +# paths covers every one of them (see the comment there). # # The `release-*` jobs are diff-independent because the release workflows only # ever run on a tag: a change that compiles under plain cargo can still break a @@ -283,80 +280,3 @@ jobs: name: fuzz-${{ matrix.target }} path: rs/moq-net/fuzz/artifacts/ if-no-files-found: ignore - - # `just rs windows` is the only thing that compiles moq-video's Media - # Foundation capture/encode/decode, its D3D11 frames, and every - # `#[cfg(target_os = "windows")]` test module. The Linux gate skips all of it, - # so without this the code compiles for the first time in a tag-triggered - # release build, and the test targets never compile at all. - # - # A separate job rather than a step because it needs a Windows host and the - # runner-native toolchain: Nix doesn't run here. No Swatinem cache either. The - # repository cache budget is 10 GB, cache.yml spends it warming the Linux - # target/ that every pull request restores, and a once-a-day job shouldn't - # evict that to save itself a few minutes. - windows: - name: Windows - runs-on: windows-latest - timeout-minutes: 60 - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Install Rust - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - - # aws-lc-rs assembles its x86_64 crypto with NASM on Windows. - - name: Install NASM - shell: pwsh - run: | - choco install nasm -y --no-progress - "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - # Pinned: `--locked` fixes just's own dependencies, not which version of - # just cargo selects. - - name: Install just - shell: bash - run: cargo install --locked just@1.52.0 - - - name: Check - shell: bash - run: just rs windows - - # `just rs macos` is the only thing that compiles moq-video's VideoToolbox - # encode/decode and its ScreenCaptureKit / AVFoundation capture, plus - # moq-audio's ScreenCaptureKit system audio and its TCC permission pre-check. - # The Linux gate skips all of it. moq-video has a release-time backstop, since - # libmoq's `libmoq-v*` tag build compiles it on Apple Silicon, but moq-audio - # has none: libmoq and moq-ffi take it codecs-only, so no release build ever - # compiles its capture backend. - # - # Same shape as `windows` and for the same reasons: a separate job because it - # needs an Apple host and the runner-native toolchain, and no Swatinem cache - # because a once-a-day job shouldn't evict the Linux `target/` that every pull - # request restores. swift.yml already compiles moq-ffi here, so this stays - # scoped to the two crates holding the Apple-gated code. - macos: - name: macOS - runs-on: macos-latest - timeout-minutes: 60 - - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Install Rust - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - - # Pinned: `--locked` fixes just's own dependencies, not which version of - # just cargo selects. - - name: Install just - run: cargo install --locked just@1.52.0 - - - name: Check - run: just rs macos diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml new file mode 100644 index 00000000000..847c43eb7c4 --- /dev/null +++ b/.github/workflows/platform.yml @@ -0,0 +1,105 @@ +name: Platform + +# Compiles the `#[cfg(target_os = ...)]` code that no Linux job compiles at all: +# moq-video's Media Foundation and VideoToolbox backends, their capture paths, +# and moq-audio's ScreenCaptureKit capture. Without this, a change that breaks +# them (a moq-net type they consume, say) merges green and compiles for the +# first time in a tag-triggered release build. +# +# Unfiltered, unlike android.yml: the cheap half (macOS) takes about as long as +# installing `just`, and the Windows half is still shorter than check.yml, so a +# path list that has to track two crates' dependency graphs isn't worth it. +# +# Pushes to `main` and `dev` catch the break two individually green PRs make +# once both land, which is what the nightly run of these jobs used to cover. +# `dev` never ran the nightly at all. +# +# Outside Nix, like android.yml: neither runner has it, so each installs the +# runner-native toolchain. rust-toolchain.toml still pins the compiler, and the +# recipes are the same ones a developer runs on that OS. +# +# No Rust cache. The repository's 10 GB budget is spent on the Linux `target/` +# that cache.yml warms for every pull request, and a Windows or macOS store +# would evict it to save these jobs a few minutes. + +permissions: + contents: read + +on: + push: + branches: [main, dev] + pull_request: + # `closed` is here only so merging/closing a PR cancels its in-flight run + # via the concurrency group below; the jobs themselves are skipped on close. + types: [opened, synchronize, reopened, closed] + +concurrency: + # Keyed by event as well as ref, so a merged pull request's `closed` run can't + # cancel the push run it triggers. + group: platform-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +env: + JUST_VERSION: 1.52.0 + +jobs: + # `just rs windows` is the only thing that compiles moq-video's Media + # Foundation capture/encode/decode, its D3D11 frames, and every + # `#[cfg(target_os = "windows")]` test module. + windows: + name: Windows + if: github.event.action != 'closed' + runs-on: windows-latest + timeout-minutes: 60 + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Install Rust + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable + + # aws-lc-rs assembles its x86_64 crypto with NASM on Windows. + - name: Install NASM + shell: pwsh + run: | + choco install nasm -y --no-progress + "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + # Pinned: `--locked` fixes just's own dependencies, not which version of + # just cargo selects. + - name: Install just + shell: bash + run: cargo install --locked "just@$JUST_VERSION" + + - name: Check + shell: bash + run: just rs windows + + # `just rs macos` is the only thing that compiles moq-video's VideoToolbox + # encode/decode and its ScreenCaptureKit / AVFoundation capture, plus + # moq-audio's ScreenCaptureKit system audio and its TCC permission pre-check. + # swift.yml already compiles moq-ffi here, so this stays scoped to the two + # crates holding the Apple-gated code. + macos: + name: macOS + if: github.event.action != 'closed' + runs-on: macos-latest + timeout-minutes: 60 + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Install Rust + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable + + - name: Install just + run: cargo install --locked "just@$JUST_VERSION" + + - name: Check + run: just rs macos diff --git a/cpp/obs/justfile b/cpp/obs/justfile index 1c1f59ed108..c28f0f48def 100644 --- a/cpp/obs/justfile +++ b/cpp/obs/justfile @@ -129,7 +129,7 @@ compile: # Compile and link the plugin the way CI does, against the dev shell's own # libobs/Qt6/ffmpeg, then run the unit tests. Linux-only in practice: it's the # one platform where nixpkgs has obs-studio, so nothing has to be downloaded. -# Manual elsewhere, like `just rs macos`. +# Manual elsewhere. # # The tests run here without ThreadSanitizer because this is the only recipe CI # invokes (.github/workflows/obs.yml). `just obs test` is manual, so on its own @@ -223,9 +223,9 @@ _includes: # Unit-test the plugin sources against stubbed libobs/libmoq/ffmpeg, under # ThreadSanitizer. # -# Manual, like `just rs macos` and `just rs windows`, because ThreadSanitizer -# needs its own build. `just obs ci` runs the same tests without it, so a -# regression these assertions catch still turns PR CI red; the sanitizer is what +# Manual because ThreadSanitizer needs its own build. `just obs ci` runs the +# same tests without it, so a regression these assertions catch still turns PR +# CI red; the sanitizer is what # adds the races on top. Run this whenever you touch src/, especially the session # callback plumbing, whose orderings the build can't check. test: diff --git a/quest/m1/audio-codecs/README.md b/quest/m1/audio-codecs/README.md index 2a23be20c54..2f48c0c3b53 100644 --- a/quest/m1/audio-codecs/README.md +++ b/quest/m1/audio-codecs/README.md @@ -56,7 +56,7 @@ ready now. ## Related - [OBS native codecs](/quest/m1/obs-moq-video/README.md) - the OBS source and encoder adapters consume this through moq-ffi; #3498 narrowed OBS to what moq-audio decodes today -- [Runtime QA hosts](/quest/m2/runtime-qa-hosts.md) - Windows and Android verification needs a host; the Windows and macOS CI gates run nightly, not per PR +- [Runtime QA hosts](/quest/m2/runtime-qa-hosts.md) - Windows and Android verification needs a host; the Windows and macOS CI gates only compile - [Dart codec parity](/quest/m1/dart-codecs.md) - Dart gains these once it builds with the `audio` feature - [Media Foundation decode](/quest/m2/audio-decode-mediafoundation.md) - Windows decodes HE-AAC, multichannel AAC, and what else the MFTs offer - [Media Foundation encode](/quest/m2/audio-encode-mediafoundation.md) - Windows encodes AAC-LC diff --git a/quest/m2/audio-decode-mediafoundation.md b/quest/m2/audio-decode-mediafoundation.md index 20a25184589..6fae6be4fae 100644 --- a/quest/m2/audio-decode-mediafoundation.md +++ b/quest/m2/audio-decode-mediafoundation.md @@ -20,7 +20,7 @@ ones. Behind the decode seam as the first candidate on `target_os = not advertised on that host, not an error at decode time. - Fixtures and layout-order tests as in the AudioToolbox quest. - Verification runs on a Windows host; the per-PR CI only compiles the - platform code, and `just rs windows` runs nightly. + platform code (`just rs windows`). ## Required diff --git a/rs/justfile b/rs/justfile index 93d4114d2ee..eff8317e10d 100644 --- a/rs/justfile +++ b/rs/justfile @@ -584,9 +584,7 @@ fix-changed $FILES: # builds vendored C++ that needs an MSVC toolchain and openh264 is a # non-optional dependency. # -# Windows runners are throttled too hard for a per-PR gate, so nightly.yml runs -# this once a day instead. A break there lands on main rather than being caught -# in review, which is the same trade the other nightly gates make. +# platform.yml runs this on every pull request and every push to main and dev. # # Default features rather than `--all-features`: jemalloc doesn't build on # MSVC, while moq-video's Linux-only `nvidia` default @@ -622,11 +620,11 @@ uring-check *args: # VideoToolbox encode/decode and its ScreenCaptureKit / AVFoundation capture, # plus moq-audio's ScreenCaptureKit system audio and TCC permission pre-check. # -# Same trade as `windows`: nightly.yml runs this once a day rather than gating a -# merge on a Mac runner. The moq-video half also has a release-time backstop, -# since libmoq's `libmoq-v*` tag build compiles it on Apple Silicon. The -# moq-audio half has none: libmoq and moq-ffi take it codecs-only, so no release -# build compiles its capture backend and this recipe is the only thing that does. +# platform.yml runs this alongside `windows`. The moq-video half also has a +# release-time backstop, since libmoq's `libmoq-v*` tag build compiles it on +# Apple Silicon. The moq-audio half has none: libmoq and moq-ffi take it +# codecs-only, so no release build compiles its capture backend and this recipe +# is the only thing that does. # # Scoped to those two crates instead of the workspace, because they hold all # the Apple-gated code the Linux gate misses. moq-ffi (and through it the From 70aefc48bfc0845983aaba56c76f94436bba5b3d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 10:20:02 -0700 Subject: [PATCH 2/7] ci: alert on Platform push failures Co-Authored-By: Claude Opus 5.5 --- .github/workflows/alert.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/alert.yml b/.github/workflows/alert.yml index 4180d6bd844..e478ad32895 100644 --- a/.github/workflows/alert.yml +++ b/.github/workflows/alert.yml @@ -18,13 +18,14 @@ on: workflow_run: # Matched by workflow `name:`, not filename. Every workflow that can run # outside a pull request belongs here; the pull-request-only ones (Check, - # macOS, Windows) are omitted so they don't spawn a skipped Alert run on - # every push to every PR. `just gh check` enforces both halves of that. + # Android) are omitted so they don't spawn a skipped Alert run on every + # push to every PR. `just gh check` enforces both halves of that. # - # Swift is here despite also running on pull requests: it warms its own - # Rust cache on `main`, and that push run is nobody's check, so a break in - # it would otherwise go unseen. The cost is a skipped Alert run per Swift - # pull request. + # Swift and Platform are here despite also running on pull requests: Swift + # warms its own Rust cache on `main`, and Platform compiles every merge to + # `main` and `dev`. Those push runs are nobody's check, so a break in them + # would otherwise go unseen. The cost is a skipped Alert run per pull + # request. workflows: - apt-repo - Cache @@ -36,6 +37,7 @@ on: - moq-gst - moq-relay - Nightly + - Platform - release-brew - Release Dart - Release Dart FFI From dc4ca30d30a22d6f0b6076100a0e950f15401f76 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 10:37:14 -0700 Subject: [PATCH 3/7] ci: build the OBS plugin on macOS and Windows per PR Co-Authored-By: Claude Opus 5.5 --- .github/workflows/platform.yml | 43 +++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index 847c43eb7c4..de4ac7ac349 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -2,9 +2,10 @@ name: Platform # Compiles the `#[cfg(target_os = ...)]` code that no Linux job compiles at all: # moq-video's Media Foundation and VideoToolbox backends, their capture paths, -# and moq-audio's ScreenCaptureKit capture. Without this, a change that breaks -# them (a moq-net type they consume, say) merges green and compiles for the -# first time in a tag-triggered release build. +# and moq-audio's ScreenCaptureKit capture. It also builds the OBS plugin +# against the obs-deps bundle, which obs.yml can't do on Linux. Without this, a +# change that breaks any of them (a moq-net type they consume, say) merges green +# and compiles for the first time in a tag-triggered release build. # # Unfiltered, unlike android.yml: the cheap half (macOS) takes about as long as # installing `just`, and the Windows half is still shorter than check.yml, so a @@ -103,3 +104,39 @@ jobs: - name: Check run: just rs macos + + # The release build of the OBS plugin, minus the published libmoq: build.sh + # without `--libmoq-release` links the in-tree rs/libmoq instead, so a PR is + # checked against its own C ABI. The obs-deps bundle (libobs, Qt6, ffmpeg) + # comes from buildspec.json at configure time, same as a tag build. + obs: + name: OBS (${{ matrix.name }}) + if: github.event.action != 'closed' + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - name: macOS + target: aarch64-apple-darwin + os: macos-latest + - name: Windows + target: x86_64-pc-windows-msvc + # The plugin preset uses the Visual Studio 17 2022 generator. + os: windows-2022 + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Install Rust + uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable + + - name: Build + shell: bash + env: + TARGET: ${{ matrix.target }} + run: ./cpp/obs/build.sh --target "$TARGET" --output "$RUNNER_TEMP/obs" From 04cc1c6dcf6b3d1ca086ec174be9836b5b86e469 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 11:22:55 -0700 Subject: [PATCH 4/7] quest: complete the Windows cross-check quest Platform CI now fails a PR that breaks Windows cfg code, via a native runner. Co-Authored-By: Claude Opus 5.5 --- quest/m1/tooling/README.md | 1 - quest/m1/tooling/windows-cross-check.md | 36 ------------------------- 2 files changed, 37 deletions(-) delete mode 100644 quest/m1/tooling/windows-cross-check.md diff --git a/quest/m1/tooling/README.md b/quest/m1/tooling/README.md index a96ed7e11ce..073918b8473 100644 --- a/quest/m1/tooling/README.md +++ b/quest/m1/tooling/README.md @@ -20,7 +20,6 @@ requires the one before it, so they land as one line of pull requests. ## Quests - [Thin justfiles](/quest/m1/tooling/justfiles.md) - recipe bodies move to `sh/`, one impact map scopes check/fix/test, self-tests and guards are deleted -- [Windows cross-check](/quest/m1/tooling/windows-cross-check.md) - a Linux cross-check of moq-video for Windows runs per PR when moq-video is selected - [Workflows call just](/quest/m1/tooling/workflows-call-just.md) - no workflow `run:` step names a `.sh`; every script a workflow needs has a recipe - [Binary release workflow](/quest/m1/tooling/release-binary.md) - moq-cli and moq-relay share one reusable workflow behind two thin callers - [FFI release workflow](/quest/m1/tooling/release-ffi.md) - the five `release-*-ffi.yml` share the moq-ffi target matrix and artifact staging diff --git a/quest/m1/tooling/windows-cross-check.md b/quest/m1/tooling/windows-cross-check.md deleted file mode 100644 index 5bda413332c..00000000000 --- a/quest/m1/tooling/windows-cross-check.md +++ /dev/null @@ -1,36 +0,0 @@ -# [XS] Windows cfg breaks in moq-video fail the PR - -## Goal - -A pull request that breaks moq-video's `#[cfg(target_os = "windows")]` code -fails its own checks instead of the next nightly. Today only `just rs -windows` compiles that code, on a Windows runner once a day, so -[#4036](https://github.com/moq-dev/moq/pull/4036) had to repair a Media -Foundation test that had been broken on `main` for a while. That PR showed a -Linux host can catch it: -`cargo check -p moq-video --no-default-features --features capture ---all-targets --target x86_64-pc-windows-msvc` reproduced the errors and -passed with the fix, with no Windows host and no C toolchain. - -## Plan - -- Run that check per PR whenever the impact map selects moq-video, as a - recipe the workflow calls. `openh264` stays off because its vendored C++ - needs MSVC; the Media Foundation, D3D11, and capture code is what the - check is for. -- The dev shell's toolchain carries only `wasm32-unknown-unknown`; add the - `x86_64-pc-windows-msvc` std target to `flake.nix` so the check runs the - same locally and in CI. Measure what it adds to the shell and the check. -- Fix the stale `rs/justfile` comment above `windows`: it says cross-compiling - cannot stand in because openh264 is non-optional, but openh264 is now a - feature. The nightly Windows job still owns linking, the other crates, and - running the tests. -- Prove it by reintroducing one of #4036's errors on a branch and watching - the PR check fail. - -Public API: none. Wire: none. - -## Required - -- [Thin justfiles](/quest/m1/tooling/justfiles.md) - the impact map that - selects moq-video From 96080cf4741dea880cbbc2c7c52035190a3cdc74 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 11:22:58 -0700 Subject: [PATCH 5/7] ci: compile the whole workspace on macOS just rs macos now matches just rs windows, so moq-sock's Apple branch and the cfg(unix) test code elsewhere compile on a Mac too. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/platform.yml | 26 +++++++----------- rs/justfile | 48 ++++++++++++++-------------------- 2 files changed, 29 insertions(+), 45 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index de4ac7ac349..cb446ebbc9d 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -1,15 +1,15 @@ name: Platform -# Compiles the `#[cfg(target_os = ...)]` code that no Linux job compiles at all: -# moq-video's Media Foundation and VideoToolbox backends, their capture paths, -# and moq-audio's ScreenCaptureKit capture. It also builds the OBS plugin -# against the obs-deps bundle, which obs.yml can't do on Linux. Without this, a -# change that breaks any of them (a moq-net type they consume, say) merges green -# and compiles for the first time in a tag-triggered release build. +# Compiles the workspace on Windows and macOS, the `#[cfg(...)]` code no Linux +# job compiles at all: moq-video's Media Foundation and VideoToolbox backends, +# their capture paths, moq-audio's ScreenCaptureKit capture, and the smaller +# platform branches elsewhere. It also builds the OBS plugin against the +# obs-deps bundle, which obs.yml can't do on Linux. Without this, a change that +# breaks any of them (a moq-net type they consume, say) merges green and +# compiles for the first time in a tag-triggered release build. # -# Unfiltered, unlike android.yml: the cheap half (macOS) takes about as long as -# installing `just`, and the Windows half is still shorter than check.yml, so a -# path list that has to track two crates' dependency graphs isn't worth it. +# Unfiltered, unlike android.yml: every job still finishes before check.yml, so +# a path list tracking the dependency graphs of all that code isn't worth it. # # Pushes to `main` and `dev` catch the break two individually green PRs make # once both land, which is what the nightly run of these jobs used to cover. @@ -44,9 +44,6 @@ env: JUST_VERSION: 1.52.0 jobs: - # `just rs windows` is the only thing that compiles moq-video's Media - # Foundation capture/encode/decode, its D3D11 frames, and every - # `#[cfg(target_os = "windows")]` test module. windows: name: Windows if: github.event.action != 'closed' @@ -79,11 +76,6 @@ jobs: shell: bash run: just rs windows - # `just rs macos` is the only thing that compiles moq-video's VideoToolbox - # encode/decode and its ScreenCaptureKit / AVFoundation capture, plus - # moq-audio's ScreenCaptureKit system audio and its TCC permission pre-check. - # swift.yml already compiles moq-ffi here, so this stays scoped to the two - # crates holding the Apple-gated code. macos: name: macOS if: github.event.action != 'closed' diff --git a/rs/justfile b/rs/justfile index eff8317e10d..b6ae709f1d1 100644 --- a/rs/justfile +++ b/rs/justfile @@ -578,22 +578,21 @@ fix-changed $FILES: just rs wasm-fix fi -# Runs the `#[cfg(target_os = "windows")]` code past the compiler: moq-video's -# Media Foundation capture/encode/decode and its D3D11 frames, which the Linux -# gate skips entirely. Cross-compiling can't stand in, because openh264-sys2 -# builds vendored C++ that needs an MSVC toolchain and openh264 is a -# non-optional dependency. -# -# platform.yml runs this on every pull request and every push to main and dev. +# Runs the `#[cfg(windows)]` code past the compiler, which the Linux gate skips +# entirely: moq-video's Media Foundation capture/encode/decode and its D3D11 +# frames, moq-nvenc's Windows loader, and the Winsock paths in moq-tokio. A +# native host rather than a cross-compile, because openh264-sys2's vendored C++ +# needs an MSVC toolchain. platform.yml runs this on every pull request and +# every push to main and dev. # # Default features rather than `--all-features`: jemalloc doesn't build on -# MSVC, while moq-video's Linux-only `nvidia` default -# are already no-ops off Linux. moq-gst is excluded because it links -# GStreamer via pkg-config, which the Windows runner doesn't have. +# MSVC, and the Linux-only features (vaapi, pipewire, io-uring) have nothing to +# compile here. moq-gst is excluded because it links GStreamer via pkg-config, +# which the runner doesn't have. # # `moq-cli/play` and `moq-cli/capture` are named explicitly because they are -# off by default, and they are the only thing that compiles the cli's own -# device and render code. +# off by default, and they are what turns on the device and render code in +# moq-video, moq-audio, and the cli itself. # Compile the whole workspace on a Windows host. Must run ON Windows. windows *args: @@ -616,25 +615,18 @@ uring *args: uring-check *args: cargo clippy --locked -p moq-uring -p moq-relay --features moq-relay/io-uring --all-targets {{ args }} -- -D warnings -# Runs the `#[cfg(target_os = "macos")]` code past the compiler: moq-video's -# VideoToolbox encode/decode and its ScreenCaptureKit / AVFoundation capture, -# plus moq-audio's ScreenCaptureKit system audio and TCC permission pre-check. -# -# platform.yml runs this alongside `windows`. The moq-video half also has a -# release-time backstop, since libmoq's `libmoq-v*` tag build compiles it on -# Apple Silicon. The moq-audio half has none: libmoq and moq-ffi take it -# codecs-only, so no release build compiles its capture backend and this recipe -# is the only thing that does. +# Runs the Apple-gated code past the compiler: moq-video's VideoToolbox +# encode/decode and its ScreenCaptureKit / AVFoundation capture, moq-audio's +# ScreenCaptureKit system audio and TCC permission pre-check, and moq-sock's +# BSD socket-buffer sysctl. platform.yml runs this alongside `windows`. # -# Scoped to those two crates instead of the workspace, because they hold all -# the Apple-gated code the Linux gate misses. moq-ffi (and through it the -# Swift/Kotlin/Go wrappers) already compiles on macOS in swift.yml. -# `--all-features` also compiles the off-by-default cpal hosts and PipeWire -# capture, which are Linux-only and no-ops here, so it costs nothing extra. +# The same workspace and features as `windows`, for the same reasons: moq-gst +# needs GStreamer, and the cli's `play` and `capture` features are what turn on +# the device and render code. -# Compile the Apple-only code paths. Must run ON macOS. +# Compile the whole workspace on a macOS host. Must run ON macOS. macos *args: - cargo check --locked -p moq-video -p moq-audio --all-targets --all-features {{ args }} + cargo check --locked --workspace --exclude moq-gst {{ no_fuzz }} --all-targets --features "moq-cli/play moq-cli/capture" {{ args }} # The Linux device code: moq-video's V4L2 and X11 capture and moq-audio's cpal # capture, all behind the off-by-default `capture` feature. `check-changed` runs From 3d54a100fe6a541ab65e0fbb26f2f0538fcce9a0 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 11:23:01 -0700 Subject: [PATCH 6/7] docs(rs): platform code is compiled by PR CI Co-Authored-By: Claude Opus 5.5 --- rs/AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rs/AGENTS.md b/rs/AGENTS.md index 4d1356c4552..510f408bd0e 100644 --- a/rs/AGENTS.md +++ b/rs/AGENTS.md @@ -53,4 +53,4 @@ Prefer poll. New logic is a `poll_*` with an `async` helper, not the other way a - Tests are inline `#[cfg(test)] mod tests`. Time-dependent async tests call `tokio::time::pause()` first, unless they cross real networking that can't be mocked (sockets, smoke tests); those run on the wall clock and assert lower bounds. - Run tests through `just` (nextest), not `cargo test`: nextest kills a wedged test as TIMEOUT, cargo hangs forever. A test flagged SLOW is a bug to fix, not a threshold to raise. - `just check` compiles default features only, like CI. `just rs features` (nightly) covers `--all-features` / `--no-default-features`. Keep a feature gate around the dependency, not the logic, so the logic's tests stay in the merge gate. -- Local checks compile only the host platform; `just rs windows` / `macos` must run on that OS and `just rs wasm` covers `moq-wasm`. Say plainly in the PR when platform code is uncompiled. +- Local checks compile only the host platform; PR CI runs `just rs windows` / `macos` on those hosts, and `just rs wasm` covers `moq-wasm`. From 467bf4d033e37e3b08cf462e011036c09a74f478 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Mon, 28 Sep 2026 12:14:39 -0700 Subject: [PATCH 7/7] ci(platform): key PR runs by number, point feature docs at platform.yml Co-Authored-By: Claude Opus 5.5 --- .github/workflows/platform.yml | 8 +++++--- rs/moq-audio/Cargo.toml | 7 ++++--- rs/moq-video/Cargo.toml | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/platform.yml b/.github/workflows/platform.yml index cb446ebbc9d..f87c21cc70b 100644 --- a/.github/workflows/platform.yml +++ b/.github/workflows/platform.yml @@ -35,9 +35,11 @@ on: types: [opened, synchronize, reopened, closed] concurrency: - # Keyed by event as well as ref, so a merged pull request's `closed` run can't - # cancel the push run it triggers. - group: platform-${{ github.event_name }}-${{ github.ref }} + # Keyed by event, so a merged pull request's `closed` run can't cancel the push + # run it triggers. Pull requests key by number rather than ref, since a merged + # PR's `closed` run can report the base branch as its ref instead of the PR's + # merge ref, and then wouldn't cancel the PR's in-flight run. + group: platform-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: diff --git a/rs/moq-audio/Cargo.toml b/rs/moq-audio/Cargo.toml index 943fcf16c2a..b0bdca9aaf8 100644 --- a/rs/moq-audio/Cargo.toml +++ b/rs/moq-audio/Cargo.toml @@ -19,9 +19,10 @@ categories = ["multimedia", "multimedia::audio", "multimedia::encoding"] # and Windows would pay nothing, but a default is one setting for every host. # The features exist so a consumer can pick what it wants, not to hide code from # the default compile: `just check` lints default features only, so the device -# code is compiled by nightly's `just rs features` and `just rs macos`. Workspace -# consumers opt in at the root manifest (`default-features = false`) per crate, -# which keeps cpal out of the language bindings. +# code is compiled by nightly's `just rs features` and platform.yml's +# `just rs macos`. Workspace consumers opt in at the root manifest +# (`default-features = false`) per crate, which keeps cpal out of the language +# bindings. default = ["aac"] # AAC-LC decode via symphonia. Pure Rust, so it costs no toolchain: the trade # this crate already refused for Opus. Only a subscriber to an ingest-sourced diff --git a/rs/moq-video/Cargo.toml b/rs/moq-video/Cargo.toml index ffb07201cb9..aa8b4f8b9d4 100644 --- a/rs/moq-video/Cargo.toml +++ b/rs/moq-video/Cargo.toml @@ -21,7 +21,8 @@ categories = ["multimedia", "multimedia::video", "multimedia::encoding"] # on. `capture` and `v4l2` no longer cost anything on Linux (moq-v4l checks its # bindings in) and stay opt-in only until every distribution ships them. The features exist so a consumer can pick what it wants, not to hide code # from the default compile (`just check` lints default features only, so the -# opt-in ones are compiled by nightly's `just rs features` and `just rs macos`). +# opt-in ones are compiled by nightly's `just rs features` and platform.yml's +# `just rs macos`). # OpenH264 remains the default software fallback, but is optional so a hardware- # only consumer does not compile its vendored C++. Workspace consumers opt out # at the root manifest (`default-features = false`) and pick per crate, so the