Repository navigation
Description
Implementation meta for CI optimization: platform-scoped CI that runs a macOS/Windows job only when a change can affect that platform, without hiding breaks.
Why this order
ci/ci_scope.py decides native jobs from paths alone. That is only sound when platform code lives in platform-named files. Today ~520 platform conditionals sit in shared C/C++ (#847), so a shared-file edit inside #ifdef _WIN32 runs Linux only. Moving shared-code PRs off native runners (#698) is therefore gated on closing that hole.
Plan
-
ci: ratchet lint for platform conditionals in shared C/C++ (#847 step 1) #848 lint policy: platform defines only in blessed platform files/dirs (C/C++ twin of the Rust platform-boundary Dylint). Existing offenders are grandfathered by a baseline that only goes down, so no regressions.
-
ci: Start native jobs for edits inside platform #if blocks in shared files #896 stopgap: for files still in the ratchet baseline, edits inside a platform
#ifblock start that OS's jobs. -
ci: Move per-PR native macOS/Windows jobs to post-merge once cross lanes link and run #698 path scoping: shared-code PRs run Linux only (safe once 1 and 2 land).
-
meta: Move platform #if code in shared C/C++ behind a platform facade #847 facade refactors, ordered by risk (conditionals × 1-year churn), not raw count:
file #ifscommits/yr score frontend/OBSApp.cpp 46 31 1426 frontend/widgets/OBSBasic.cpp 20 35 700 frontend/settings/OBSBasicSettings.cpp 29 22 638 frontend/obs-main.cpp 30 17 510 frontend/widgets/OBSBasic.hpp 5 37 185 libobs/obs.c 8 23 184 plugins/obs-outputs/librtmp/rtmp.c 16 8 128 plugins/obs-outputs/rtmp-stream.c 17 6 102 Each move shrinks the ci: Start native jobs for edits inside platform #if blocks in shared files #896 list; the plugin long tail is low priority.
-
meta: Cross-compile through Soldr to shrink macOS/Windows CI #700 cross-compile/attestation track (build: Link Windows-MSVC and macOS Rust targets on Linux (soldr LLVM bundle needs host libxml2.so.2) #695, ci: Run the windows-gnu Rust tests under Wine in the Linux lane #696, ci: Let local native lanes attest the macOS and Windows jobs #443, build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr) #516, build: Investigate cross-compiling the full OBS C/C++ build for Windows and macOS from Linux #697) reduces what native runners must still cover.
Done when
ci_scope.pydecides macOS/Windows runs from paths alone and the ci: Start native jobs for edits inside platform #if blocks in shared files #896 list is empty.- A shared-code PR goes green on Linux runners alone; master, nightly and release still run every platform.
Policy (maintainer, 2026-10-15)
- CI scoping is by path alone (ci: Scope platform jobs by path alone; POSIX reaches Linux and macOS #911). A changed file in a platform file or directory starts that platform's jobs. POSIX files belong to Linux and macOS.
- Platform defines are allowed only in platform files and subdirectories (
ci/platform_paths.py). The#ifdefscan is used only by the lint that enforces this (ci: Ratchet platform conditionals in shared C/C++ files (#847) #900), never for scoping.
Sub-issues
Collapse Sub-issuesSub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTracker
Activity
zackees commentedon Oct 15, 2026
Status (2026-10-15)
#elsebranches) and a patch: ci: Scope macOS and Windows jobs by hunk content (Refs #698, #700) #898 (comment).cppcmocka tests (by design, ci: A new C++ cmocka test skips the macOS and Windows Tier 2 jobs that compile it #610) andlibobs/cmake/(rust-exports.d/*.txton every port PR).Soldr cross-compiling on Linux: are we using it?
Yes, partly:
crosslane (Rust Cross Lint, ubuntu) compiles the Rust workspace and all of its C (obs-c-oraclevia thecccrate) for x86_64-pc-windows-msvc (clang-cl + xwin), aarch64-apple-darwin and x86_64-apple-darwin, with-Werror(build: Maximum C/C++ warning strictness with -Werror on every platform (cross-compiled with soldr) #516).rust-testalso links x86_64-pc-windows-gnu.lldneeds the host'slibxml2.so.2(build: Link Windows-MSVC and macOS Rust targets on Linux (soldr LLVM bundle needs host libxml2.so.2) #695). The fix landed upstream (Managed LLVM 21.1.5 lld needs host libxml2.so.2/libz.so.1: MSVC/Darwin cross links fail on ubuntu-26.04 forge-ci/soldr#3774, closed 2026-10-13) but isn't in a release yet: the latest is v0.9.32 (2026-10-10), and CI pins 0.9.31. Action: after soldr 0.9.33 ships, bumpsetup-soldrand switch the cross lane fromchecktotest --no-run.soldr cc/soldr c++(0.9.32) only target GNU/Linux, musl and x86_64-pc-windows-gnu. msvc and Darwin return "unsupported platform" (checked locally). So the CMake build (libobs, plugins, frontend with Qt) can't be cross-compiled with soldr yet. That is build: Investigate cross-compiling the full OBS C/C++ build for Windows and macOS from Linux #697, and it needs upstream soldr work first.ci: RED test for a hunk that adds a Linux #else block (Refs #896, #897)
ci: Scope every line of a hunk by the blocks it sits in (GREEN, Refs #…
ci: RED tests for edits in branches that exclude Linux (Refs #896, #897)
ci: Scope #else of Linux conditionals to macOS and Windows (GREEN, Refs
ci: RED test for a hunk that adds a Linux #else block (Refs #896, #897)
ci: Scope every line of a hunk by the blocks it sits in (GREEN, Refs #…
docs: Say which events run every platform (Refs #897)
zackees commentedon Oct 15, 2026
Measured A/B on real PR CI (#919 vs #920)
I ran the same one-line change twice on the same master: a plain C test registration (
test/cmocka/tests.d/test_obs_data.cmake), the most common change in recent PRs. A used current master's scoping (path-only, #911). B was identical except that the PR restored the pre-#898ci_scope.py, which sent every tests.d change to all platforms. Both runs passed.Runs: A https://github.com/obs-rust/obs-studio/actions/runs/38818680393, B https://github.com/obs-rust/obs-studio/actions/runs/38818689428
ci: Scope platform jobs by path alone; POSIX reaches Linux and macOS (o…
zackees commentedon Oct 15, 2026
Wall time: what native jobs cost in real runs
Measured from job timestamps (not a replay) over the last 111 successful PR runs and 58 merge-queue runs that ran macOS/Windows jobs. The figure is how long the native jobs finished after every other non-gate job.
So skipping native jobs cuts the slow tail. The median PR doesn't change, because Linux Tier 2 (~13 min) is usually the slowest job. Together with the A/B above (runner-minutes 43.0 → 19.4 for the same change), that is the speedup #911 delivers.
zackees commentedon Oct 16, 2026
Real PR runs, before and after #911 merged (22:33 UTC)
Successful
pull_requestruns that ran Linux Tier 2 (unstamped, so comparable), excluding probe and measurement PRs:Caveats: the after sample is small, and part of the wall-time drop comes from #837 (Tier 2
-j4, merged 19:33), which is also in the before window. The clean single-change A/B is above: runner-minutes 43.0 → 19.4, with equal wall time.Also done: #925 merged (soldr 0.9.33, Linux links the msvc and Darwin test binaries); setup-soldr v0.9.86 released and
v0moved to it.