Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ slow-timeout = { period = "30s", terminate-after = 2 }
# race until proven otherwise (see Root Cause First in AGENTS.md).
retries = 0

# `--all-targets` still compiles the criterion benches, which is what catches a
# bench that no longer builds. Running them in test mode only replays the
# workload once, and the large origin fan-outs take ~20s each for no signal.
# PR recipes build library, binary, and integration-test targets. Nightly keeps
# the exhaustive target compile, but executes benches through cargo bench smokes.
default-filter = "not kind(bench)"

# Limit ring concurrency within one invocation. Unit-test workers use small
Expand Down
1 change: 0 additions & 1 deletion quest/m0/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@ Measure each change against the numbers above and record the result in its PR.
- [Nix cache](/quest/m0/ci/nix-cache.md) - `nix.moq.dev` on R2 replaces Cachix for CI and releases
- [Nightly finishes](/quest/m0/ci/nightly-split.md) - every Nightly step runs within its timeout
- [FFI artifact reuse](/quest/m0/ci/ffi-reuse.md) - identical FFI release builds are built once and shared across the language packages
- [Feature permutations](/quest/m0/ci/features.md) - PR feature checks and test builds compile only what they run, measured first
14 changes: 0 additions & 14 deletions quest/m0/ci/features.md

This file was deleted.

31 changes: 18 additions & 13 deletions rs/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ fix-changed $LIST:
test-changed $LIST:
sh/rs/select.sh test "$LIST"

# Compile moq-tokio by itself at the feature extremes and with each crypto provider.
tokio-features:
sh/rs/tokio-features.sh
# Compile moq-tokio at its feature extremes; --all also isolates crypto and transport modes.
[positional-arguments]
tokio-features *args:
sh/rs/tokio-features.sh "$@"

# Runs the `#[cfg(windows)]` code past the compiler, which the Linux gate
# skips; platform.yml runs it on a Windows runner, scoped like `check-changed`
Expand Down Expand Up @@ -113,9 +114,9 @@ uring-changed base="":
[positional-arguments]
uring *args:
just rs uring-check "$@"
bash sh/rs/nextest.sh cargo nextest run --locked -p moq-uring -p moq-relay --features moq-relay/io-uring --all-targets "$@"
bash sh/rs/nextest.sh cargo nextest run --locked -p moq-uring -p moq-relay --features moq-relay/io-uring --tests "$@"
cargo clippy --locked -p moq-uring -p moq-relay --features moq-relay/io-uring,moq-relay/qlog --all-targets "$@" -- -D warnings
bash sh/rs/nextest.sh cargo nextest run --locked -p moq-uring --features qlog --all-targets "$@"
bash sh/rs/nextest.sh cargo nextest run --locked -p moq-uring --features qlog --tests "$@"

# Compile the io_uring relay path, off the default feature set.
[positional-arguments]
Expand Down Expand Up @@ -225,6 +226,8 @@ c-tests:
# Compile the workspace at the feature extremes.
features:
just rs net-features
just rs tokio-features --all
just rs media-features --all
cargo check --locked --workspace {{ no_fuzz }} --all-targets --no-default-features
cargo hack check --locked -p moq-tokio --each-feature --exclude-features _transport --features aws-lc-rs
cargo check --locked -p moq-relay --no-default-features
Expand All @@ -241,21 +244,23 @@ features:
net-features:
bash sh/rs/net-features.sh

# Compile the media crates at supported feature boundaries and prove expensive
# Compile media boundaries (--all isolates every mode) and prove expensive
# native/render dependencies are absent when their features are excluded.
media-features:
sh/rs/media-features.sh
[positional-arguments]
media-features *args:
sh/rs/media-features.sh "$@"

# nextest kills a wedged test (`.config/nextest.toml` sets the timeout), but
# skips doctests; `just rs doctest` covers those. clippy-driver as the workspace
# wrapper enforces lint findings from the same compile, including benches and
# examples. `build.warnings` denies warnings without changing cargo's artifact
# fingerprint, unlike RUSTFLAGS.
# wrapper enforces lint findings from the same compile. `--tests` builds library,
# binary, and integration-test targets, including binary-only crates; benches and
# examples compile and lint in Nightly's `features`. `build.warnings` denies
# warnings without changing cargo's artifact fingerprint, unlike RUSTFLAGS.

# Run the test suite and enforce clippy findings from the same compile.
# Run library, binary, and integration tests, enforcing clippy from the same compile.
[positional-arguments]
test *args:
CARGO_BUILD_WARNINGS=deny RUSTC_WORKSPACE_WRAPPER={{ quote(require("clippy-driver")) }} bash sh/rs/nextest.sh cargo nextest run --locked --all-targets "$@"
CARGO_BUILD_WARNINGS=deny RUSTC_WORKSPACE_WRAPPER={{ quote(require("clippy-driver")) }} bash sh/rs/nextest.sh cargo nextest run --locked --tests "$@"

# Exercise the ignored hardware tests for every GPU vendor on this Linux host.
gpu:
Expand Down
27 changes: 18 additions & 9 deletions sh/rs/media-features.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail

all=0
if [[ $# == 1 && $1 == --all ]]; then
all=1
elif [[ $# != 0 ]]; then
echo 'usage: just rs media-features [--all]' >&2
exit 2
fi

check() {
echo "media features: cargo check $*"
cargo check --locked --all-targets "$@"
Expand Down Expand Up @@ -29,23 +37,24 @@ forbid_crate() {
fi
}

# Each shape is compiled independently so workspace feature unification cannot
# hide a missing gate. The normal dependency graph then proves the expensive
# stacks are absent rather than merely unused by this target.
# Minimal shapes and the off-default VPX backend always compile and test. The
# other positive paths already compile in default, capture, and play checks;
# isolate them when their feature owner changes, and exhaustively in Nightly.
# Dependency absence contracts stay on every affected PR, including transitive edits.
check -p moq-video --no-default-features
minimal=$(tree -p moq-video --no-default-features)
for crate in openh264 openh264-sys2 wgpu cpal; do
forbid_crate "$minimal" "$crate" "moq-video minimal"
done
cargo nextest run --locked -p moq-video --no-default-features

check -p moq-video --no-default-features --features openh264
if ((all)); then check -p moq-video --no-default-features --features openh264; fi
software=$(tree -p moq-video --no-default-features --features openh264)
require_crate "$software" openh264 "moq-video software-only"
require_crate "$software" openh264-sys2 "moq-video software-only"
forbid_crate "$software" wgpu "moq-video software-only"

check -p moq-video --no-default-features --features nvidia
if ((all)); then check -p moq-video --no-default-features --features nvidia; fi
native=$(tree -p moq-video --no-default-features --features nvidia)
require_crate "$native" moq-nvenc "moq-video native-only"
for crate in openh264 openh264-sys2 wgpu; do
Expand All @@ -63,7 +72,7 @@ for crate in openh264 openh264-sys2 wgpu; do
done
cargo nextest run --locked -p moq-video --no-default-features --features vpx -E 'test(/::vpx::/)'

check -p moq-video --no-default-features --features render
if ((all)); then check -p moq-video --no-default-features --features render; fi
render=$(tree -p moq-video --no-default-features --features render)
require_crate "$render" wgpu "moq-video rendering"
for crate in openh264 openh264-sys2; do
Expand All @@ -76,12 +85,12 @@ for crate in openh264 openh264-sys2 wgpu moq-nvenc; do
forbid_crate "$transcode_minimal" "$crate" "moq-transcode minimal"
done

check -p moq-transcode --no-default-features --features openh264
if ((all)); then check -p moq-transcode --no-default-features --features openh264; fi
transcode_software=$(tree -p moq-transcode --no-default-features --features openh264)
require_crate "$transcode_software" openh264 "moq-transcode software-only"
forbid_crate "$transcode_software" wgpu "moq-transcode software-only"

check -p moq-transcode --no-default-features --features nvidia
if ((all)); then check -p moq-transcode --no-default-features --features nvidia; fi
transcode_native=$(tree -p moq-transcode --no-default-features --features nvidia)
require_crate "$transcode_native" moq-nvenc "moq-transcode native-only"
for crate in openh264 openh264-sys2 wgpu; do
Expand All @@ -92,7 +101,7 @@ check -p moq-audio --no-default-features --features pipewire
audio_host=$(tree -p moq-audio --no-default-features --features pipewire)
forbid_crate "$audio_host" cpal "moq-audio host-only"

check -p moq-audio --no-default-features --features capture,pipewire
if ((all)); then check -p moq-audio --no-default-features --features capture,pipewire; fi
audio_capture=$(tree -p moq-audio --no-default-features --features capture,pipewire)
require_crate "$audio_capture" cpal "moq-audio PipeWire capture"

Expand Down
2 changes: 1 addition & 1 deletion sh/rs/net-features.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

cargo clippy --locked -p moq-net --no-default-features --all-targets -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --locked -p moq-net --no-default-features --no-deps
bash sh/rs/nextest.sh cargo nextest run --locked -p moq-net --no-default-features --all-targets
bash sh/rs/nextest.sh cargo nextest run --locked -p moq-net --no-default-features --tests

# A browser leaf chooses its entropy backend. Build a consumer instead of moq-net's
# native-only bench dev-dependencies, with the same dependency versions as the repo.
Expand Down
31 changes: 25 additions & 6 deletions sh/rs/select.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,25 @@ wants() {
# The feature contract scripts are no crate, so their own diff selects
# nothing and still has to reach the gates below.
media_script=
if [[ -f "$list" ]] && grep -qx 'sh/rs/media-features.sh' "$list"; then media_script=1; fi
tokio_script=
net_script=
if [[ -f "$list" ]] && grep -qx 'sh/rs/net-features.sh' "$list"; then net_script=1; fi
if [[ -f "$list" ]]; then
if grep -qx 'sh/rs/media-features.sh' "$list"; then media_script=1; fi
if grep -qx 'sh/rs/tokio-features.sh' "$list"; then tokio_script=1; fi
if grep -qx 'sh/rs/net-features.sh' "$list"; then net_script=1; fi
fi

# Global build inputs select ALL. Otherwise isolate permutations when their
# owning crate changes; dependency-only diffs keep the cheaper boundary checks.
feature_owner_changed() {
[[ "$packages" == ALL ]] || grep -qE "$1" "$list"
}

case "$packages" in
"")
if [[ ("$action" == check* || "$action" == lint) && -n "$media_script$net_script" ]]; then
if [[ -n "$media_script" ]]; then just rs media-features; fi
if [[ ("$action" == check* || "$action" == lint) && -n "$media_script$tokio_script$net_script" ]]; then
if [[ -n "$media_script" ]]; then just rs media-features --all; fi
if [[ -n "$tokio_script" ]]; then just rs tokio-features --all; fi
if [[ -n "$net_script" ]]; then just rs net-features; fi
else
echo "rs: no crates affected; skipping."
Expand Down Expand Up @@ -130,7 +141,11 @@ case "$action" in
just rs "$action" "${flags[@]}"
# Workspace feature unification hides a broken moq-tokio feature set
# whenever any dependent enables a transport.
if wants moq-tokio; then just rs tokio-features; fi
if [[ -n "$tokio_script" ]] || wants moq-tokio; then
args=()
if feature_owner_changed '^(rs/moq-tokio/|sh/rs/tokio-features\.sh$)'; then args+=(--all); fi
just rs tokio-features "${args[@]}"
fi
# Likewise every dependent turns moq-net's default `async` feature back on.
if [[ -n "$net_script" ]] || wants moq-net; then just rs net-features; fi
# moq-wasm's crate root is `#![cfg(target_arch = "wasm32")]`, so only a
Expand All @@ -147,7 +162,11 @@ case "$action" in
# The relay's io_uring listener, off the default feature set.
if wants moq-relay; then just rs uring-check; fi
# Each media feature shape compiles on its own, about two minutes.
if [[ -n "$media_script" ]] || wants '(moq-video|moq-audio|moq-transcode)'; then just rs media-features; fi
if [[ -n "$media_script" ]] || wants '(moq-video|moq-audio|moq-transcode)'; then
args=()
if feature_owner_changed '^(rs/moq-(video|audio|transcode)/|sh/rs/media-features\.sh$)'; then args+=(--all); fi
just rs media-features "${args[@]}"
fi
;;
fix)
just rs fix "${flags[@]}"
Expand Down
Loading
Loading