From ad6872d59d723c4b060fbb2397126c36da672f45 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:07:28 -0800 Subject: [PATCH 1/8] test(ci): require independent full Tier 2 alias links (Refs #5224) --- ci/test_ci_scope.py | 21 ++++++++++++++++++++- ci/test_cmocka_link_check.py | 28 ++++++++++++++++++++++++++++ ci/test_gate_jobs.py | 11 ++++++++++- ci/test_windows_link_check.py | 29 ++++++++--------------------- 4 files changed, 66 insertions(+), 23 deletions(-) diff --git a/ci/test_ci_scope.py b/ci/test_ci_scope.py index 06ed453cef..f84e2f21c3 100644 --- a/ci/test_ci_scope.py +++ b/ci/test_ci_scope.py @@ -315,7 +315,7 @@ def test_queue_runner_selection_preserves_hosted_fallbacks(self): heavy = { "rust-cross-lint", "rust-cross-lint-release", "rust-tests-macos-build", - "rust-linux-tier2-build", "rust-linux-tier2", "rust-windows-link", + "rust-linux-tier2-build", "rust-linux-tier2", "rust-windows-link", "cmocka-link", } light = { "ci.yml": { @@ -435,6 +435,25 @@ def test_queue_runs_merge_result_tests_and_windows_link(self): self.assertIn('echo "windows_link=${windows_link:-true}"', text) self.assertIn("(github.event_name == 'merge_group' || needs.ci-mode.outputs.rust-test_hit != 'true')", text) + def test_both_cmocka_aliases_are_independent_selected_jobs(self): + from test_windows_link_check import job_block + + block = job_block("cmocka-link") + self.assertIn("alias: [win-x64, mac-arm64]", block) + self.assertIn("fail-fast: false", block) + self.assertIn("needs: [check-event, ci-mode]", block) + condition = next(line for line in block.splitlines() if line.startswith(" if:")) + self.assertIn("outputs.cmocka_link == 'true'", condition) + self.assertNotIn("fast_path", condition) + self.assertNotIn("apt-get", block) + self.assertIn("ci/cmocka_link_check.py --alias ${{ matrix.alias }}", block) + gate = (ROOT / ".github/workflows/ci.yml").read_text() + self.assertIn("build-project", gate.split(" ci-gate:", 1)[1].split(" steps:", 1)[0]) + for event in ("pull_request", "merge_group"): + for path in ("libobs/obs.c.h", "ci/cmocka_link_check.py", "ci/tier2_front_cache.py"): + with self.subTest(event=event, path=path): + self.assertTrue(scope([path], event=event).cmocka_link) + def test_core_file_content_is_not_read(self): # Core files carry no platform defines (the ratchet lint enforces # it), so a core file is Linux-only whatever it contains (#897). diff --git a/ci/test_cmocka_link_check.py b/ci/test_cmocka_link_check.py index 980f9a5f93..08b2a3aae4 100644 --- a/ci/test_cmocka_link_check.py +++ b/ci/test_cmocka_link_check.py @@ -62,6 +62,34 @@ def test_windows_uses_managed_clang_cl_and_the_target_sdk(self): self.assertIn("--target=x86_64-pc-windows-msvc", wrapper) +class BuildTest(unittest.TestCase): + def test_each_alias_builds_the_full_inventory_at_the_cpu_budget(self): + inventory = ["libobs-cross-shared", "test_existing_rust", "test_new_steps_rust"] + for alias in cmocka_link_check.TRIPLES: + with self.subTest(alias=alias), tempfile.TemporaryDirectory() as temporary: + work = Path(temporary) + with mock.patch.object(cmocka_link_check, "discover_targets", return_value=inventory), \ + mock.patch.object(cmocka_link_check.subprocess, "run") as run: + cmocka_link_check.build_targets(alias, work, 3, {}) + args = run.call_args.args[0] + self.assertEqual(args[args.index("--parallel") + 1], "3") + self.assertEqual(args[args.index("--target") + 1:args.index("--")], inventory) + self.assertEqual(json.loads((work / "link-targets.json").read_text()), inventory) + + def test_cache_is_fresh_and_cannot_inherit_relaxed_or_remote_policy(self): + with tempfile.TemporaryDirectory() as temporary: + work = Path(temporary) + with mock.patch.object(cmocka_link_check.tier2_front_cache, "install", return_value=work / "ccache"), \ + mock.patch.dict("os.environ", {"CCACHE_SLOPPINESS": "time_macros", "CCACHE_REMOTE_STORAGE": "remote", "CCACHE_PREFIX": "unsafe"}): + env = cmocka_link_check.cache_env(work) + self.assertNotIn("CCACHE_SLOPPINESS", env) + self.assertNotIn("CCACHE_REMOTE_STORAGE", env) + self.assertNotIn("CCACHE_PREFIX", env) + self.assertEqual(Path(env["CCACHE_CONFIGPATH"]).read_text(), "") + self.assertEqual(env["CCACHE_MAXSIZE"], "512M") + self.assertEqual(env["CCACHE_COMPILERCHECK"], "content") + + class DiscoveryTest(unittest.TestCase): def test_uses_generated_target_types_and_names_not_source_regexes(self): with tempfile.TemporaryDirectory() as temporary: diff --git a/ci/test_gate_jobs.py b/ci/test_gate_jobs.py index 3791f11a06..cbece7bc17 100644 --- a/ci/test_gate_jobs.py +++ b/ci/test_gate_jobs.py @@ -102,7 +102,14 @@ def test_complete_pr_requires_proven_gates_and_active_queue_policy(self): plan = pr_attestation.admission(result, files, event="pull_request") windows_link = "Build 🧱 / Windows Link Check 🔗 (x86_64-pc-windows-msvc)" expected = gate_jobs.pr_expected_jobs(selected, files, plan) - self.assertEqual(expected, {gate_jobs.SCOPE_JOB, "Build 🧱 / CI Mode 🛂", windows_link}) + cmocka = {f"Build 🧱 / Tier 2 Link Check 🔗 ({alias})" for alias in ("win-x64", "mac-arm64")} + self.assertEqual(expected, {gate_jobs.SCOPE_JOB, "Build 🧱 / CI Mode 🛂", *cmocka}) + for name in cmocka: + healthy = [job(n, "success") for n in expected if n != name] + for conclusion in ("skipped", "cancelled", "failure"): + self.assertEqual(blocking([*healthy, job(name, conclusion)], expected=expected), [name]) + self.assertEqual(blocking(healthy, expected=expected), [name]) + expected = gate_jobs.pr_expected_jobs(selected, files, {}) healthy = [job(name, "success") for name in expected if name != windows_link] self.assertEqual(blocking(healthy, expected=expected), [windows_link]) self.assertEqual(blocking([*healthy, job(windows_link, "skipped")], expected=expected), [windows_link]) @@ -121,6 +128,8 @@ def test_queue_manifest_requires_each_selected_leg_despite_proofs(self): selected = scope(["libobs/obs.c.h", ".github/workflows/build-project.yaml"], event="merge_group") expected = gate_jobs.expected_jobs(selected) required = { + "Build 🧱 / Tier 2 Link Check 🔗 (win-x64)", + "Build 🧱 / Tier 2 Link Check 🔗 (mac-arm64)", "Build 🧱 / Cross Compile 🧰 (mac-arm64,win-x64)", "Build 🧱 / Rust Tests 🦀 (macos-26)", "Build 🧱 / Rust Tests 🦀 (windows-2025-vs2026)", diff --git a/ci/test_windows_link_check.py b/ci/test_windows_link_check.py index f78d7333bb..d47e5f5b7d 100644 --- a/ci/test_windows_link_check.py +++ b/ci/test_windows_link_check.py @@ -48,28 +48,14 @@ def test_main_adds_target_then_links_through_soldr(self): self.assertEqual(windows_link_check.main(), 0) self.assertEqual(calls, [("add", "x86_64-pc-windows-msvc"), ("cargo", windows_link_check.link_args())]) - def test_selected_tier2_pass_links_after_categories(self): + def test_categories_do_not_serialize_cmocka_passes(self): with mock.patch.object(windows_link_check.local_gate, "add_target"), \ - mock.patch.object(windows_link_check.local_gate, "soldr_cargo"), \ - mock.patch.object(windows_link_check.cmocka_link_check, "link") as link, \ - mock.patch.dict(windows_link_check.os.environ, {"OBS_CMOCKA_LINK": "true"}): + mock.patch.object(windows_link_check.local_gate, "soldr_cargo") as cargo, \ + mock.patch("cmocka_link_check.link"), \ + mock.patch.dict("os.environ", {"OBS_CMOCKA_LINK": "true"}): self.assertEqual(windows_link_check.main(), 0) - root = windows_link_check.cmocka_link_check.ROOT - self.assertEqual(link.call_args_list, [ - mock.call("win-x64", root / "build_cmocka_link_win-x64", 4), - mock.call("mac-arm64", root / "build_cmocka_link_mac-arm64", 4), - ]) - - def test_tier2_link_failure_propagates(self): - import subprocess - - failure = subprocess.CalledProcessError(1, ["cmake", "--build"]) - with mock.patch.object(windows_link_check.local_gate, "add_target"), \ - mock.patch.object(windows_link_check.local_gate, "soldr_cargo"), \ - mock.patch.object(windows_link_check.cmocka_link_check, "link", side_effect=[None, failure]), \ - mock.patch.dict(windows_link_check.os.environ, {"OBS_CMOCKA_LINK": "true"}): - with self.assertRaises(subprocess.CalledProcessError): - windows_link_check.main() + cargo.assert_called_once_with(windows_link_check.link_args()) + self.assertNotIn("cmocka_link_check", Path(windows_link_check.__file__).read_text()) def test_link_failure_propagates(self): import subprocess @@ -101,7 +87,8 @@ def test_never_stands_down_on_proofs_or_attestation(self): for skip in ("cross_hit", "skip_rust-cross-lint", "cross_lint", "outputs.windows =="): self.assertNotIn(skip, self.condition) self.assertIn("needs.check-event.outputs.docs_only != 'true'", self.condition) - self.assertIn("|| needs.check-event.outputs.cmocka_link == 'true'", self.condition) + self.assertNotIn("outputs.cmocka_link", self.condition) + self.assertNotIn("apt-get", self.block) def test_is_linux_hosted_and_bounded(self): self.assertIn("inputs.mq-heavy-labels", self.block) From fcc0529371d7ed638b06d2ad401ca2ca566a8fe3 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:10:05 -0800 Subject: [PATCH 2/8] ci: parallelize full Tier 2 links and cache support compiles (Refs #5224) --- .github/workflows/build-project.yaml | 64 ++++++++++++++++++++++++---- ci/ci_scope.py | 2 +- ci/cmocka_link_check.py | 50 ++++++++++++++++++---- ci/gate_jobs.py | 4 +- ci/test_cmocka_link_check.py | 12 ++++++ ci/test_windows_link_check.py | 2 +- ci/windows_link_check.py | 19 ++------- docs/ci-tooling.md | 17 +++++--- 8 files changed, 128 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 86bba0e736..a511cb1ac1 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -2180,15 +2180,14 @@ jobs: # lanes, so COFF-only link defects reached master (`undefined symbol: # obs_encoder_get_caps`, merge_group 42390201886 green, push 42393067345 # red). This is only the cross lane's link step for Windows x64: no clippy, - # Dylint; selected Tier 2 links also cover Darwin, nothing executed. + # Dylint. Selected Tier 2 links run in the independent alias matrix below. rust-windows-link: timeout-minutes: 30 name: Windows Link Check 🔗 (x86_64-pc-windows-msvc) runs-on: ${{ inputs.mq-heavy-labels != '' && fromJSON(inputs.mq-heavy-labels) || 'ubuntu-26.04' }} needs: [check-event, ci-mode] - # Every fallback non-docs PR links categories. Tier 2 selections always run - # before the queue: existing client proofs do not attest these CMake links. - if: ${{ (github.event_name != 'pull_request' || needs.ci-mode.outputs.fast_path != 'true' || needs.check-event.outputs.cmocka_link == 'true') && !inputs.flatpak-measurement-only && !inputs.native-cache-measurement-only && needs.check-event.outputs.deferred == 'true' && needs.check-event.outputs.docs_only != 'true' && needs.check-event.outputs.windows_link == 'true' }} + # Category links retain their existing member-admission policy. + if: ${{ (github.event_name != 'pull_request' || needs.ci-mode.outputs.fast_path != 'true') && !inputs.flatpak-measurement-only && !inputs.native-cache-measurement-only && needs.check-event.outputs.deferred == 'true' && needs.check-event.outputs.docs_only != 'true' && needs.check-event.outputs.windows_link == 'true' }} defaults: run: shell: bash @@ -2225,14 +2224,61 @@ jobs: save-cache: ${{ github.ref == 'refs/heads/master' }} cache-suffix: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || '' }} - - name: Set Up Native Link Tools - run: sudo apt-get update -qq && sudo apt-get install -y cmake ninja-build pkg-config - - name: Link Windows Test Binaries 🔗 - env: - OBS_CMOCKA_LINK: ${{ needs.check-event.outputs.cmocka_link }} run: uv run --no-project ci/windows_link_check.py + cmocka-link: + timeout-minutes: 30 + name: Tier 2 Link Check 🔗 (${{ matrix.alias }}) + runs-on: ${{ inputs.mq-heavy-labels != '' && fromJSON(inputs.mq-heavy-labels) || 'ubuntu-26.04' }} + needs: [check-event, ci-mode] + # Both full inventories are required independently, including attested PRs. + # No category or other alias dependency: the three link legs can overlap. + if: ${{ !inputs.flatpak-measurement-only && !inputs.native-cache-measurement-only && needs.check-event.outputs.deferred == 'true' && needs.check-event.outputs.docs_only != 'true' && needs.check-event.outputs.cmocka_link == 'true' }} + strategy: + fail-fast: false + matrix: + alias: [win-x64, mac-arm64] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Set Up soldr 🦀 + uses: zackees/setup-soldr@db9aa035e488f4dde7d31d5c8cb4ec20ec99c6c1 # merge of forge-ci/setup-soldr#676: persistent-root cook store and recipes (#675) + with: + # Same scope and layer as rust-cross-lint, so it replays master's cache. + verdict-scope: build-project + version: 0.9.45 + build-cache: false + prebuild-deps: none + cache-key-suffix: linux-host-v3 + save-cache-remote: ${{ github.ref == 'refs/heads/master' }} + # The Windows target is added mid-job (see rust-cross-lint, #969). + solo-toolchain-cache: false + # S3 remote cache: bucket forge-ci on DO Spaces nyc3; the 50G watermark is + # enforced only on the merge_group singleton. No bucket/creds = feature off. + s3-bucket: forge-ci + s3-endpoint: nyc3.digitaloceanspaces.com + s3-region: nyc3 + s3-cache-limit: 50G + env: + SOLDR_S3_CACHE_ACCESS_KEY: ${{ secrets.SOLDR_S3_CACHE_ACCESS_KEY }} + SOLDR_S3_CACHE_SECRET_KEY: ${{ secrets.SOLDR_S3_CACHE_SECRET_KEY }} + + - name: Set Up uv 🐍 + uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 + with: + save-cache: ${{ github.ref == 'refs/heads/master' }} + cache-suffix: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || '' }} + + # uv wheels avoid the 165 s apt mirror setup observed in run 44495240642. + - name: Link Tier 2 Fixtures 🔗 + run: uv run --no-project --with cmake==4.3.4 --with ninja==1.13.0 ci/cmocka_link_check.py --alias ${{ matrix.alias }} + rust-cross-lint-release: timeout-minutes: 45 name: Rust Cross Lint 🦀 (release targets) diff --git a/ci/ci_scope.py b/ci/ci_scope.py index 9ac3121a15..e955923cc2 100644 --- a/ci/ci_scope.py +++ b/ci/ci_scope.py @@ -171,7 +171,7 @@ class Scope: "cmocka_link": ( "libobs/**", "rust/libobs-rust/**", "rust/obs-build/**", "test/cmocka/**", "deps/**", "cmake/cross/**", "cmake/common/soldr.cmake", "ci/cmocka_link_check.py", - "ci/windows_link_check.py", "ci/ci_scope.py", ".github/workflows/build-project.yaml", + "ci/windows_link_check.py", "ci/tier2_front_cache.py", "ci/ci_scope.py", ".github/workflows/build-project.yaml", "Cargo.toml", "Cargo.lock", "rust-toolchain.toml", "CMakeLists.txt", ), "tier2": ( diff --git a/ci/cmocka_link_check.py b/ci/cmocka_link_check.py index 043b8b9e97..5e544b43a9 100644 --- a/ci/cmocka_link_check.py +++ b/ci/cmocka_link_check.py @@ -15,9 +15,11 @@ import shlex import subprocess import time +import tempfile from pathlib import Path import local_gate +import tier2_front_cache ROOT = Path(__file__).resolve().parent.parent TRIPLES = {"win-x64": "x86_64-pc-windows-msvc", "mac-arm64": "aarch64-apple-darwin"} @@ -77,13 +79,43 @@ def query(option: str) -> str: return path +def cache_env(work: Path) -> dict[str, str]: + """Fresh per-pass cache: share identical support compiles, never link results.""" + binary = tier2_front_cache.install(work) + config = work / "ccache.conf" + config.write_text("") + env = {key: value for key, value in local_gate.soldr_env().items() if not key.startswith("CCACHE_")} + env.update(CCACHE_CONFIGPATH=str(config), CCACHE_DIR=str(work / "objects"), + CCACHE_MAXSIZE="512M", CCACHE_COMPILERCHECK="content", + CMAKE_C_COMPILER_LAUNCHER=str(binary), CMAKE_CXX_COMPILER_LAUNCHER=str(binary)) + return env + + +def build_targets(alias: str, work: Path, jobs: int, env: dict[str, str]) -> None: + targets = discover_targets(work / ".cmake/api/v1/reply") + (work / "link-targets.json").write_text(json.dumps(targets, indent=2) + "\n") + print(f"Tier 2 {alias}: linking hybrid libobs and {len(targets) - 1} Rust fixtures ({jobs} Ninja workers)", flush=True) + subprocess.run(["cmake", "--build", str(work), "--parallel", str(jobs), "--target", *targets, + "--", "-k", "0"], cwd=ROOT, env=env, check=True) + + def link(alias: str, work: Path, jobs: int) -> None: + with tempfile.TemporaryDirectory(prefix="cmocka-link-cache-") as directory: + env = cache_env(Path(directory)) + try: + _link(alias, work, jobs, env) + finally: + subprocess.run([env["CMAKE_C_COMPILER_LAUNCHER"], "--show-stats"], env=env, check=False) + + +def _link(alias: str, work: Path, jobs: int, env: dict[str, str]) -> None: started = time.monotonic() target = TRIPLES[alias] local_gate.add_target(target) # Invoke Cargo even on a warm tree: the cross project's legacy custom # command only depends on manifests, which cannot detect a Rust source edit. local_gate.soldr_cargo(["build", "--release", "--locked", "--target", target, "-p", "libobs-rust"]) + print(f"Tier 2 {alias}: Rust archive ready in {time.monotonic() - started:.2f}s", flush=True) work.mkdir(parents=True, exist_ok=True) wrappers = work / "soldr-tools" wrappers.mkdir(exist_ok=True) @@ -97,18 +129,18 @@ def link(alias: str, work: Path, jobs: int) -> None: query.touch() archiver = subprocess.run(["soldr", "cc", "--target", target, "--print-ar"], cwd=ROOT, capture_output=True, text=True, check=True).stdout.strip() - env = local_gate.soldr_env({"OBS_CROSS_TARGET": alias, "SOLDR_PORCELAIN": "0", - f"AR_{target.replace('-', '_')}": archiver}) + env = dict(env, OBS_CROSS_TARGET=alias, SOLDR_PORCELAIN="0") + env[f"AR_{target.replace('-', '_')}"] = archiver + configured = time.monotonic() subprocess.run(["cmake", "-S", str(ROOT), "-B", str(work), "-G", "Ninja", f"-DOBS_CROSS_TARGET={alias}", "-DOBS_CROSS_LINK=ON", "-DOBS_CROSS_TIER2=ON", "-DCMAKE_BUILD_TYPE=Release", f"-DRust_CARGO={wrappers / 'cargo'}", f"-DRust_COMPILER={wrappers / 'rustc'}", f"-DRust_CARGO_TARGET={target}", - "-DOBS_TEST_SANITIZE_PER_TARGET=OFF", *toolchain_args], cwd=ROOT, env=env, check=True) - targets = discover_targets(work / ".cmake/api/v1/reply") - (work / "link-targets.json").write_text(json.dumps(targets, indent=2) + "\n") - print(f"Tier 2 {alias}: linking hybrid libobs and {len(targets) - 1} Rust fixtures", flush=True) - subprocess.run(["cmake", "--build", str(work), "--parallel", str(jobs), "--target", *targets, - "--", "-k", "0"], cwd=ROOT, env=env, check=True) + "-DOBS_TEST_SANITIZE_PER_TARGET=OFF", + f"-DCMAKE_C_COMPILER_LAUNCHER={env['CMAKE_C_COMPILER_LAUNCHER']}", + f"-DCMAKE_CXX_COMPILER_LAUNCHER={env['CMAKE_CXX_COMPILER_LAUNCHER']}", *toolchain_args], cwd=ROOT, env=env, check=True) + print(f"Tier 2 {alias}: configured in {time.monotonic() - configured:.2f}s", flush=True) + build_targets(alias, work, jobs, env) print(f"Tier 2 {alias}: linked in {time.monotonic() - started:.2f}s", flush=True) @@ -116,7 +148,7 @@ def main() -> int: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--alias", choices=TRIPLES, default="win-x64") parser.add_argument("--build", type=Path) - parser.add_argument("--jobs", type=int, default=min(4, os.cpu_count() or 1)) + parser.add_argument("--jobs", type=int, default=min(4, os.process_cpu_count() or 1)) args = parser.parse_args() if args.jobs < 1: parser.error("--jobs must be positive") diff --git a/ci/gate_jobs.py b/ci/gate_jobs.py index 2befd12959..d3fb3c886d 100644 --- a/ci/gate_jobs.py +++ b/ci/gate_jobs.py @@ -137,6 +137,8 @@ def expected_jobs(selected: Scope, files: list[str] | tuple[str, ...] = ()) -> s expected.add("Build 🧱 / Fast Gate ⚡") if selected.windows_link: expected.add("Build 🧱 / Windows Link Check 🔗 (x86_64-pc-windows-msvc)") + if selected.cmocka_link: + expected.update(f"Build 🧱 / Tier 2 Link Check 🔗 ({alias})" for alias in ("win-x64", "mac-arm64")) if selected.cross_lint: expected.update({ "Build 🧱 / Rust Cross Lint 🦀 (x86_64-pc-windows-msvc)", @@ -199,7 +201,7 @@ def pr_expected_jobs(selected: Scope, files: list[str], plan: dict) -> set[str]: # Existing client proofs cover category links, not the cmocka CMake # pass. The base-owned selector must witness that pass even on fast PRs. if getattr(selected, "cmocka_link", False): - expected.add("Build 🧱 / Windows Link Check 🔗 (x86_64-pc-windows-msvc)") + expected.update(f"Build 🧱 / Tier 2 Link Check 🔗 ({alias})" for alias in ("win-x64", "mac-arm64")) for key, job_names in names.items(): status = plan["jobs"].get(key, {}) needed = status.get("required_gates", []) diff --git a/ci/test_cmocka_link_check.py b/ci/test_cmocka_link_check.py index 08b2a3aae4..e2a49d65a1 100644 --- a/ci/test_cmocka_link_check.py +++ b/ci/test_cmocka_link_check.py @@ -76,6 +76,18 @@ def test_each_alias_builds_the_full_inventory_at_the_cpu_budget(self): self.assertEqual(args[args.index("--target") + 1:args.index("--")], inventory) self.assertEqual(json.loads((work / "link-targets.json").read_text()), inventory) + def test_alias_link_failures_propagate(self): + import subprocess + + for alias in cmocka_link_check.TRIPLES: + with self.subTest(alias=alias), tempfile.TemporaryDirectory() as temporary: + work = Path(temporary) + failure = subprocess.CalledProcessError(1, ["cmake", "--build"]) + with mock.patch.object(cmocka_link_check, "discover_targets", return_value=["libobs-cross-shared", "test_existing_rust"]), \ + mock.patch.object(cmocka_link_check.subprocess, "run", side_effect=failure): + with self.assertRaises(subprocess.CalledProcessError): + cmocka_link_check.build_targets(alias, work, 2, {}) + def test_cache_is_fresh_and_cannot_inherit_relaxed_or_remote_policy(self): with tempfile.TemporaryDirectory() as temporary: work = Path(temporary) diff --git a/ci/test_windows_link_check.py b/ci/test_windows_link_check.py index d47e5f5b7d..80fa96b876 100644 --- a/ci/test_windows_link_check.py +++ b/ci/test_windows_link_check.py @@ -44,7 +44,7 @@ def test_main_adds_target_then_links_through_soldr(self): calls = [] with mock.patch.object(windows_link_check.local_gate, "add_target", lambda t: calls.append(("add", t))), \ mock.patch.object(windows_link_check.local_gate, "soldr_cargo", lambda a: calls.append(("cargo", a))), \ - mock.patch.dict(windows_link_check.os.environ, {"OBS_CMOCKA_LINK": "false"}): + mock.patch.dict("os.environ", {"OBS_CMOCKA_LINK": "false"}): self.assertEqual(windows_link_check.main(), 0) self.assertEqual(calls, [("add", "x86_64-pc-windows-msvc"), ("cargo", windows_link_check.link_args())]) diff --git a/ci/windows_link_check.py b/ci/windows_link_check.py index a997759cb1..04ccc31f30 100644 --- a/ci/windows_link_check.py +++ b/ci/windows_link_check.py @@ -2,28 +2,18 @@ # /// script # requires-python = ">=3.14" # /// -"""Link Windows MSVC Rust categories and selected Tier 2 fixtures from Linux. +"""Link every Windows MSVC Rust category binary from Linux, running none. uv run --no-project ci/windows_link_check.py -Every non-docs fallback PR and merge group links the eight category binaries, -including the C oracle (#3919). For libobs and registration/support changes, -LANES["cmocka_link"] also selects Windows and Darwin hybrid libobs and every configured cmocka -`*_rust` executable (#5189). The latter uses the real registrations, deferred -support fragments, soldr's LLVM, Windows SDK and Apple SDK. Nothing is executed. - -OBS_CMOCKA_LINK=false keeps category-only coverage for unrelated changes. -Existing client proofs cover category links only; selected cmocka links always -run on PRs, including trusted member PRs, and on merge groups. +Selected Tier 2 fixtures run independently in the two cmocka-link matrix jobs; +CI Gate requires both aliases even on fully attested member PRs. """ from __future__ import annotations -import os import sys -import cmocka_link_check - import local_gate TARGET = "x86_64-pc-windows-msvc" @@ -41,9 +31,6 @@ def link_args(target: str = TARGET) -> list[str]: def main() -> int: local_gate.add_target(TARGET) local_gate.soldr_cargo(link_args()) - if os.environ.get("OBS_CMOCKA_LINK", "true") == "true": - cmocka_link_check.link("win-x64", cmocka_link_check.ROOT / "build_cmocka_link_win-x64", 4) - cmocka_link_check.link("mac-arm64", cmocka_link_check.ROOT / "build_cmocka_link_mac-arm64", 4) return 0 diff --git a/docs/ci-tooling.md b/docs/ci-tooling.md index 4cb1cf4ebe..c0795beef9 100644 --- a/docs/ci-tooling.md +++ b/docs/ci-tooling.md @@ -257,12 +257,12 @@ cmake --build build --target cross-win-x64 # cross-mac-arm64, cross-mac-x64 #### Tier 2 pre-queue links (#5189) -The existing Linux-hosted Windows Link Check also links hybrid libobs and every -configured cmocka `*_rust` executable for Windows MSVC x86_64 and Darwin arm64 +The Linux-hosted Tier 2 Link Check matrix links hybrid libobs and every +configured cmocka `*_rust` executable independently for Windows MSVC x86_64 and Darwin arm64 when `LANES["cmocka_link"]` selects the change. This includes libobs, its linked crates, obs-build registration/support, cmocka, Cargo inputs and the check's own implementation. Unrelated changes keep -the eight Rust category links. The same check runs on PRs and merge groups; +the eight Rust category links in the independent Windows Link Check. The same check runs on PRs and merge groups; selected cmocka links also run on fully attested member PRs because existing client proofs do not attest this CMake pass. Category-only work keeps its existing admission policy. @@ -278,8 +278,15 @@ conditions have been evaluated; an empty Rust inventory fails. The check builds against real target cmocka and SDK libraries, never executes target programs, and saves `link-targets.json` in its build tree. It always refreshes the Rust archive through soldr so source-only edits cannot reuse the cross project's -manifest-only custom-command result. Ninja parallelism defaults to four and the -existing job retains its 30-minute deadline and Linux heavy-pool routing. +manifest-only custom-command result. Ninja uses the process CPU budget, capped at +four workers. Each alias uses a fresh 512M ccache from the checksum-pinned +`ci/tier2_front_cache.py` installer to share identical support-file compiles +within that pass. No cache is uploaded, no relaxed policy is inherited, and +links always run. The matrix disables fail-fast so one failing alias cannot +cancel the other. Both aliases are independently required by `ci/gate_jobs.py`, +including attested PRs; CI Gate waits for the entire reusable build workflow. +The jobs retain the 30-minute deadline and existing Linux heavy-pool routing. +Pinned CMake/Ninja uv wheels avoid apt setup on this path (#5224). Darwin uses the production hidden-symbol list and the Rust crate's existing SDK framework imports. Library discovery stays in the Apple SDK and target deps; host Linux libraries cannot satisfy Darwin probes. A successful link does not From 629391df6cab9884e9eba54b97129179e43cf728 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:12:59 -0800 Subject: [PATCH 3/8] ci: keep the verified compiler launcher stable across kept builds --- ci/cmocka_link_check.py | 8 +++++--- ci/test_cmocka_link_check.py | 10 ++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ci/cmocka_link_check.py b/ci/cmocka_link_check.py index 5e544b43a9..5e64de3f50 100644 --- a/ci/cmocka_link_check.py +++ b/ci/cmocka_link_check.py @@ -79,9 +79,11 @@ def query(option: str) -> str: return path -def cache_env(work: Path) -> dict[str, str]: +def cache_env(work: Path, tools: Path | None = None) -> dict[str, str]: """Fresh per-pass cache: share identical support compiles, never link results.""" - binary = tier2_front_cache.install(work) + # Keep the launcher command stable for kept Ninja trees; only cached objects + # and policy are ephemeral. The installer re-verifies its pinned binary. + binary = tier2_front_cache.install(tools or work) config = work / "ccache.conf" config.write_text("") env = {key: value for key, value in local_gate.soldr_env().items() if not key.startswith("CCACHE_")} @@ -101,7 +103,7 @@ def build_targets(alias: str, work: Path, jobs: int, env: dict[str, str]) -> Non def link(alias: str, work: Path, jobs: int) -> None: with tempfile.TemporaryDirectory(prefix="cmocka-link-cache-") as directory: - env = cache_env(Path(directory)) + env = cache_env(Path(directory), work / "compiler-cache") try: _link(alias, work, jobs, env) finally: diff --git a/ci/test_cmocka_link_check.py b/ci/test_cmocka_link_check.py index e2a49d65a1..a984901fa0 100644 --- a/ci/test_cmocka_link_check.py +++ b/ci/test_cmocka_link_check.py @@ -88,6 +88,16 @@ def test_alias_link_failures_propagate(self): with self.assertRaises(subprocess.CalledProcessError): cmocka_link_check.build_targets(alias, work, 2, {}) + def test_kept_tree_uses_a_stable_verified_launcher_with_a_fresh_cache(self): + with tempfile.TemporaryDirectory() as temporary: + work = Path(temporary) + tools = work / "build" / "compiler-cache" + with mock.patch.object(cmocka_link_check.tier2_front_cache, "install", return_value=tools / "ccache") as install: + env = cmocka_link_check.cache_env(work, tools) + install.assert_called_once_with(tools) + self.assertEqual(env["CMAKE_C_COMPILER_LAUNCHER"], str(tools / "ccache")) + self.assertEqual(env["CCACHE_DIR"], str(work / "objects")) + def test_cache_is_fresh_and_cannot_inherit_relaxed_or_remote_policy(self): with tempfile.TemporaryDirectory() as temporary: work = Path(temporary) From bf47f317cae177ba6c8c7a27f67cae3c0f976e9d Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:14:20 -0800 Subject: [PATCH 4/8] test(ci): assert category dispatch behavior without source coupling --- ci/test_windows_link_check.py | 4 ++-- docs/ci-tooling.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/test_windows_link_check.py b/ci/test_windows_link_check.py index 80fa96b876..517c8dd787 100644 --- a/ci/test_windows_link_check.py +++ b/ci/test_windows_link_check.py @@ -51,11 +51,11 @@ def test_main_adds_target_then_links_through_soldr(self): def test_categories_do_not_serialize_cmocka_passes(self): with mock.patch.object(windows_link_check.local_gate, "add_target"), \ mock.patch.object(windows_link_check.local_gate, "soldr_cargo") as cargo, \ - mock.patch("cmocka_link_check.link"), \ + mock.patch("cmocka_link_check.link") as link, \ mock.patch.dict("os.environ", {"OBS_CMOCKA_LINK": "true"}): self.assertEqual(windows_link_check.main(), 0) cargo.assert_called_once_with(windows_link_check.link_args()) - self.assertNotIn("cmocka_link_check", Path(windows_link_check.__file__).read_text()) + link.assert_not_called() def test_link_failure_propagates(self): import subprocess diff --git a/docs/ci-tooling.md b/docs/ci-tooling.md index c0795beef9..7eb5147544 100644 --- a/docs/ci-tooling.md +++ b/docs/ci-tooling.md @@ -282,7 +282,7 @@ manifest-only custom-command result. Ninja uses the process CPU budget, capped a four workers. Each alias uses a fresh 512M ccache from the checksum-pinned `ci/tier2_front_cache.py` installer to share identical support-file compiles within that pass. No cache is uploaded, no relaxed policy is inherited, and -links always run. The matrix disables fail-fast so one failing alias cannot +the cache never stores link results. The matrix disables fail-fast so one failing alias cannot cancel the other. Both aliases are independently required by `ci/gate_jobs.py`, including attested PRs; CI Gate waits for the entire reusable build workflow. The jobs retain the 30-minute deadline and existing Linux heavy-pool routing. From 69461b761a19f082e9cff6ab91d94770fb281363 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:17:31 -0800 Subject: [PATCH 5/8] test(ci): audit the independent cross-link cache and admission allocation --- .github/workflows/build-project.yaml | 2 ++ ci/test_cook_profiles.py | 2 ++ ci/test_pr_attestation.py | 4 ++-- ci/test_rust_cache_policy.py | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index a511cb1ac1..3e6bfb7014 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -2254,7 +2254,9 @@ jobs: verdict-scope: build-project version: 0.9.45 build-cache: false + # Cross-release archives and Corrosion use separate target trees (#5224). prebuild-deps: none + cargo-registry-cache: true cache-key-suffix: linux-host-v3 save-cache-remote: ${{ github.ref == 'refs/heads/master' }} # The Windows target is added mid-job (see rust-cross-lint, #969). diff --git a/ci/test_cook_profiles.py b/ci/test_cook_profiles.py index 5d0a4c3ef3..2daad99a59 100644 --- a/ci/test_cook_profiles.py +++ b/ci/test_cook_profiles.py @@ -36,6 +36,8 @@ def test_build_consumers_declare_the_profile_policy(self): "rust-cross-lint": "--profile dev -- --tests", "rust-cross-lint-release": "--profile dev -- --tests", "rust-tests-macos-build": "--profile dev -- --tests", + "rust-windows-link": "--profile dev -- --tests", + "cmocka-link": None, "rust-tests-windows": "--profile dev -- --tests", # Corrosion-only build, its own target dir: no cook (#3027). "rust-linux-tier2-build": None, diff --git a/ci/test_pr_attestation.py b/ci/test_pr_attestation.py index 1e494796d5..4c01623159 100644 --- a/ci/test_pr_attestation.py +++ b/ci/test_pr_attestation.py @@ -390,7 +390,7 @@ def test_planner_outputs_drive_actual_workflow_job_allocation(self): scope_values["cross_lint"] = "true" scope_values["cross_targets"] = "win-x64" for name in ("rust-tests-linux", "rust-cross-lint", "rust-cross-lint-release", - "rust-windows-link", "cross-compile", "rust-linux-tier2-build", + "rust-windows-link", "cmocka-link", "cross-compile", "rust-linux-tier2-build", "linux-qt-frontend", "rust-tests-windows", "rust-tier2-windows"): header = job_block(build, name).split(" steps:", 1)[0] condition = re.search(r"^ if: (.+)$", header, re.M)[1] @@ -408,7 +408,7 @@ def test_planner_outputs_drive_actual_workflow_job_allocation(self): expression = re.sub(r"!(?!=)", " not ", expression) allocated = eval(expression, {"__builtins__": {}, "fromJSON": json.loads}) # Category deferral cannot stand down the selected CMake pass. - must_run = case != "complete" or (name == "rust-windows-link" and selected.cmocka_link) + must_run = case != "complete" or (name == "cmocka-link" and selected.cmocka_link) self.assertEqual(bool(allocated), must_run, (case, name, condition, plan)) swift = job_block(formatting, "swift-format") self.assertIn("inputs.swift", swift) diff --git a/ci/test_rust_cache_policy.py b/ci/test_rust_cache_policy.py index 1d3ecd5970..b850615c19 100644 --- a/ci/test_rust_cache_policy.py +++ b/ci/test_rust_cache_policy.py @@ -22,7 +22,7 @@ def test_bypassed_compiler_store_is_not_transferred(self): "Do not transfer an embedded store while its Rust consumer is bypassed") self.assertNotRegex(step, r"(?m)^ cache: false$", "Preserve the other cache layers") - if any(issue in step for issue in ("(#3027)", "(#3034)", "(#3767)")): + if any(issue in step for issue in ("(#3027)", "(#3034)", "(#3767)", "(#5224)")): # Tier 2 uses separate target trees; Cross Compile # has no host Rust consumer. Neither reuses this cook. cook_free += 1 @@ -30,8 +30,8 @@ def test_bypassed_compiler_store_is_not_transferred(self): continue self.assertIn("prebuild-deps-flags:", step) self.assertNotIn("prebuild-deps: none", step) - self.assertEqual(found, 13, "Audit new setup-soldr consumers explicitly") - self.assertEqual(cook_free, 4, "Audit each consumer that skips cook explicitly") + self.assertEqual(found, 14, "Audit new setup-soldr consumers explicitly") + self.assertEqual(cook_free, 5, "Audit each consumer that skips cook explicitly") def test_all_consumers_inherit_the_rust_wrapper_bypass(self): for name in WORKFLOWS: From c29c157bb99e2e4871074bb45ff1637c26b4f449 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:20:47 -0800 Subject: [PATCH 6/8] ci: pin cacheable clang-cl dependency scanning for Tier 2 links --- .github/workflows/build-project.yaml | 4 +++- ci/test_ci_scope.py | 1 + docs/ci-tooling.md | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 3e6bfb7014..9f5525ebff 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -2278,8 +2278,10 @@ jobs: cache-suffix: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || '' }} # uv wheels avoid the 165 s apt mirror setup observed in run 44495240642. + # CMake 3.31 retains clang-cl /showIncludes, understood by pinned ccache; + # 4.3 forwards -clang:-M* dependency flags which ccache cannot cache. - name: Link Tier 2 Fixtures 🔗 - run: uv run --no-project --with cmake==4.3.4 --with ninja==1.13.0 ci/cmocka_link_check.py --alias ${{ matrix.alias }} + run: uv run --no-project --with cmake==3.31.10 --with ninja==1.13.0 ci/cmocka_link_check.py --alias ${{ matrix.alias }} rust-cross-lint-release: timeout-minutes: 45 diff --git a/ci/test_ci_scope.py b/ci/test_ci_scope.py index f84e2f21c3..dc2eec78cd 100644 --- a/ci/test_ci_scope.py +++ b/ci/test_ci_scope.py @@ -446,6 +446,7 @@ def test_both_cmocka_aliases_are_independent_selected_jobs(self): self.assertIn("outputs.cmocka_link == 'true'", condition) self.assertNotIn("fast_path", condition) self.assertNotIn("apt-get", block) + self.assertIn("--with cmake==3.31.10 --with ninja==1.13.0", block) self.assertIn("ci/cmocka_link_check.py --alias ${{ matrix.alias }}", block) gate = (ROOT / ".github/workflows/ci.yml").read_text() self.assertIn("build-project", gate.split(" ci-gate:", 1)[1].split(" steps:", 1)[0]) diff --git a/docs/ci-tooling.md b/docs/ci-tooling.md index 7eb5147544..44607185d1 100644 --- a/docs/ci-tooling.md +++ b/docs/ci-tooling.md @@ -286,7 +286,9 @@ the cache never stores link results. The matrix disables fail-fast so one failin cancel the other. Both aliases are independently required by `ci/gate_jobs.py`, including attested PRs; CI Gate waits for the entire reusable build workflow. The jobs retain the 30-minute deadline and existing Linux heavy-pool routing. -Pinned CMake/Ninja uv wheels avoid apt setup on this path (#5224). +Pinned CMake 3.31.10/Ninja 1.13.0 uv wheels avoid apt setup on this path +(#5224). CMake 3.31 uses clang-cl `/showIncludes`; CMake 4.3 +forwards dependency flags that the pinned ccache rejects as uncacheable. Darwin uses the production hidden-symbol list and the Rust crate's existing SDK framework imports. Library discovery stays in the Apple SDK and target deps; host Linux libraries cannot satisfy Darwin probes. A successful link does not From e245584ce0f2ade1f754ec81f6de1dc15c7a0b34 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:34:53 -0800 Subject: [PATCH 7/8] ci: preserve complete local preflight while splitting hosted link jobs --- .github/workflows/build-project.yaml | 2 ++ ci/test_windows_link_check.py | 26 +++++++++++++++++++++++++- ci/windows_link_check.py | 21 ++++++++++++++++++--- docs/ci-tooling.md | 6 ++++-- 4 files changed, 49 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index 9f5525ebff..452e4d6f84 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -2225,6 +2225,8 @@ jobs: cache-suffix: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || '' }} - name: Link Windows Test Binaries 🔗 + env: + OBS_CMOCKA_LINK: 'false' run: uv run --no-project ci/windows_link_check.py cmocka-link: diff --git a/ci/test_windows_link_check.py b/ci/test_windows_link_check.py index 517c8dd787..b64fcfb230 100644 --- a/ci/test_windows_link_check.py +++ b/ci/test_windows_link_check.py @@ -52,11 +52,34 @@ def test_categories_do_not_serialize_cmocka_passes(self): with mock.patch.object(windows_link_check.local_gate, "add_target"), \ mock.patch.object(windows_link_check.local_gate, "soldr_cargo") as cargo, \ mock.patch("cmocka_link_check.link") as link, \ - mock.patch.dict("os.environ", {"OBS_CMOCKA_LINK": "true"}): + mock.patch.dict("os.environ", {"OBS_CMOCKA_LINK": "false"}): self.assertEqual(windows_link_check.main(), 0) cargo.assert_called_once_with(windows_link_check.link_args()) link.assert_not_called() + def test_selected_tier2_pass_links_after_categories(self): + with mock.patch.object(windows_link_check.local_gate, "add_target"), \ + mock.patch.object(windows_link_check.local_gate, "soldr_cargo"), \ + mock.patch.object(windows_link_check.cmocka_link_check, "link") as link, \ + mock.patch.dict(windows_link_check.os.environ, {"OBS_CMOCKA_LINK": "true"}): + self.assertEqual(windows_link_check.main(), 0) + root = windows_link_check.cmocka_link_check.ROOT + self.assertEqual(link.call_args_list, [ + mock.call("win-x64", root / "build_cmocka_link_win-x64", 4), + mock.call("mac-arm64", root / "build_cmocka_link_mac-arm64", 4), + ]) + + def test_tier2_link_failure_propagates(self): + import subprocess + + failure = subprocess.CalledProcessError(1, ["cmake", "--build"]) + with mock.patch.object(windows_link_check.local_gate, "add_target"), \ + mock.patch.object(windows_link_check.local_gate, "soldr_cargo"), \ + mock.patch.object(windows_link_check.cmocka_link_check, "link", side_effect=[None, failure]), \ + mock.patch.dict(windows_link_check.os.environ, {"OBS_CMOCKA_LINK": "true"}): + with self.assertRaises(subprocess.CalledProcessError): + windows_link_check.main() + def test_link_failure_propagates(self): import subprocess @@ -76,6 +99,7 @@ def setUp(self): def test_runs_the_script_in_one_line(self): self.assertIn("run: uv run --no-project ci/windows_link_check.py", self.block) + self.assertIn("OBS_CMOCKA_LINK: 'false'", self.block) def test_selected_on_the_deferred_pr_tier(self): self.assertIn("needs.check-event.outputs.deferred == 'true'", self.condition) diff --git a/ci/windows_link_check.py b/ci/windows_link_check.py index 04ccc31f30..6641a7fe61 100644 --- a/ci/windows_link_check.py +++ b/ci/windows_link_check.py @@ -2,18 +2,30 @@ # /// script # requires-python = ">=3.14" # /// -"""Link every Windows MSVC Rust category binary from Linux, running none. +"""Link Windows MSVC Rust categories and selected Tier 2 fixtures from Linux. uv run --no-project ci/windows_link_check.py -Selected Tier 2 fixtures run independently in the two cmocka-link matrix jobs; -CI Gate requires both aliases even on fully attested member PRs. +CI runs categories independently with OBS_CMOCKA_LINK=false; the two required +cmocka-link matrix jobs own Tier 2 coverage. Local default coverage is unchanged. +Every non-docs fallback PR and merge group links the eight category binaries, +including the C oracle (#3919). For libobs and registration/support changes, +LANES["cmocka_link"] also selects Windows and Darwin hybrid libobs and every configured cmocka +`*_rust` executable (#5189). The latter uses the real registrations, deferred +support fragments, soldr's LLVM, Windows SDK and Apple SDK. Nothing is executed. + +OBS_CMOCKA_LINK=false keeps category-only coverage for unrelated changes. +Existing client proofs cover category links only; selected cmocka links always +run on PRs, including trusted member PRs, and on merge groups. """ from __future__ import annotations +import os import sys +import cmocka_link_check + import local_gate TARGET = "x86_64-pc-windows-msvc" @@ -31,6 +43,9 @@ def link_args(target: str = TARGET) -> list[str]: def main() -> int: local_gate.add_target(TARGET) local_gate.soldr_cargo(link_args()) + if os.environ.get("OBS_CMOCKA_LINK", "true") == "true": + cmocka_link_check.link("win-x64", cmocka_link_check.ROOT / "build_cmocka_link_win-x64", 4) + cmocka_link_check.link("mac-arm64", cmocka_link_check.ROOT / "build_cmocka_link_mac-arm64", 4) return 0 diff --git a/docs/ci-tooling.md b/docs/ci-tooling.md index 44607185d1..e0f5195b07 100644 --- a/docs/ci-tooling.md +++ b/docs/ci-tooling.md @@ -268,8 +268,8 @@ client proofs do not attest this CMake pass. Category-only work keeps its existing admission policy. ```sh -uv run --no-project ci/cmocka_link_check.py -uv run --no-project ci/cmocka_link_check.py --alias mac-arm64 +uv run --no-project --with cmake==3.31.10 --with ninja==1.13.0 ci/cmocka_link_check.py +uv run --no-project --with cmake==3.31.10 --with ninja==1.13.0 ci/cmocka_link_check.py --alias mac-arm64 ``` The root CMake cross-link mode includes the unchanged cmocka graph and deferred @@ -286,6 +286,8 @@ the cache never stores link results. The matrix disables fail-fast so one failin cancel the other. Both aliases are independently required by `ci/gate_jobs.py`, including attested PRs; CI Gate waits for the entire reusable build workflow. The jobs retain the 30-minute deadline and existing Linux heavy-pool routing. +The local `ci/windows_link_check.py` default still runs categories and both +cmocka aliases; CI sets `OBS_CMOCKA_LINK=false` only on the category job. Pinned CMake 3.31.10/Ninja 1.13.0 uv wheels avoid apt setup on this path (#5224). CMake 3.31 uses clang-cl `/showIncludes`; CMake 4.3 forwards dependency flags that the pinned ccache rejects as uncacheable. From 0993a99ea3d982bc8bebbb55d651d95bbe1ae9c4 Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Thu, 19 Nov 2026 03:36:21 -0800 Subject: [PATCH 8/8] ci: share the required alias manifest within the complexity budget Ci-Attestation: {"at":1795089086,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":182,"stamp":"39629d0f3866d2a427ffb9c28603bb59","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795089086,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":182,"stamp":"ecf22b9bdace6c9048c0357d843e7af9","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795089086,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":182,"stamp":"6b8ab9cc5405dd09233c9ecc0934d1a8","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795089086,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":182,"stamp":"b91898b4feb0a425a48ef4a519566eec","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088900,"gate":"general/all/client-lint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"8b3e98f4fdac17ea1a93f35878314841","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795089086,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":182,"stamp":"e4b9712789d7725f8341ac89b0e89901","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088902,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"a188d8bf8072102221e608601b11f6e2","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088902,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"fb990c34fd44224710a64f22b1d000bc","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"dcc4458dc0046768b49efb5c8fe226ad","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"254a47ac647bf954be2a7f8e1b99727f","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"5a01359f1a04d79d5a854d8f12c11a24","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"757a8517f2681a8e47c4a1894ffbf863","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088902,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"f25e2c536089fec1e4c73cbae0c212e5","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088902,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"246d37e9b11c590b1a22b952ecd1e573","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"dfb51d1a27a66d8b22536fd193ea326e","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"b5a89f076446f2f70da638223b7bdf28","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"d249f8bef8c7f698323c96704dc11d6b","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795088901,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"a04109cd97370655fc7486151e4bd358d61fc6ec0a50501a751a6d9e23f58036","lane":"client-lint","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":282,"stamp":"68ef39277f69fe1bda8d9ba91a4e5d9f","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Ci-Attestation: {"at":1795089869,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"5d845c9b23bc03a0e42397787689b4eed693f623e5931dc92110c521181ef4c3","lane":"client-test-x86_64-unknown-linux-gnu","parents":["e245584ce0f2ade1f754ec81f6de1dc15c7a0b34"],"secs":782,"stamp":"5d8f932b44911b6d47d31e26d8972e1a","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738","v":1,"via":"run"} Client-Checks: {"checks":{"base":"7ff57244c874a81d1812a3d57d5253ee7d8c5e1d","coverage":"all-tracked-applicable-files","diff":[".github/workflows/build-project.yaml","ci/ci_scope.py","ci/cmocka_link_check.py","ci/gate_jobs.py","ci/test_ci_scope.py","ci/test_cmocka_link_check.py","ci/test_cook_profiles.py","ci/test_gate_jobs.py","ci/test_pr_attestation.py","ci/test_rust_cache_policy.py","ci/test_windows_link_check.py","ci/windows_link_check.py","docs/ci-tooling.md","libobs/build/libobs.core+.h.c","libobs/build/libobs.ported-type-catalog-enum+.h.c","libobs/build/ported-source-sets/type-catalog-enum.json","libobs/cmake/rust-exports.d/obs-core-type_catalog_enum.txt","libobs/obs-type-catalog-enum-fields.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_type_catalog_enum_swap_is_registered.rs","rust/obs-c-oracle/oracle/type_catalog_enum.c","rust/obs-core/src/ffi/mod.rs","rust/obs-core/src/ffi/type_catalog_enum.rs","rust/obs-core/src/lib.rs","rust/obs-core/src/type_catalog_enum.rs","rust/obs-core/tests/obs_core/main.rs","rust/obs-core/tests/obs_core/type_catalog_enum.rs","rust/obs-core/tests/obs_core/type_catalog_enum_parity.rs","test/cmocka/video-info-query-link-support.c"],"head":"f5906ef1be96f8f90500ae7aabbc3ebaabf29efe","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"f6a291b69ef7bda8b401269feca09e01d209bd731a7e08b83abf046faa696308","tree":"52b335b50a5006a7280acd353ec0cbd0ea256738"}} --- ci/gate_jobs.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ci/gate_jobs.py b/ci/gate_jobs.py index d3fb3c886d..03acfaf1ec 100644 --- a/ci/gate_jobs.py +++ b/ci/gate_jobs.py @@ -125,6 +125,12 @@ def data_selected(files) -> bool: )) for path in files) +def cmocka_jobs(selected: Scope) -> set[str]: + """Both alias jobs are required whenever the Tier 2 link lane is selected.""" + return ({f"Build 🧱 / Tier 2 Link Check 🔗 ({alias})" for alias in ("win-x64", "mac-arm64")} + if getattr(selected, "cmocka_link", False) else set()) + + def expected_jobs(selected: Scope, files: list[str] | tuple[str, ...] = ()) -> set[str]: """The queue execution manifest: exact job names, never proof credit. @@ -137,8 +143,7 @@ def expected_jobs(selected: Scope, files: list[str] | tuple[str, ...] = ()) -> s expected.add("Build 🧱 / Fast Gate ⚡") if selected.windows_link: expected.add("Build 🧱 / Windows Link Check 🔗 (x86_64-pc-windows-msvc)") - if selected.cmocka_link: - expected.update(f"Build 🧱 / Tier 2 Link Check 🔗 ({alias})" for alias in ("win-x64", "mac-arm64")) + expected.update(cmocka_jobs(selected)) if selected.cross_lint: expected.update({ "Build 🧱 / Rust Cross Lint 🦀 (x86_64-pc-windows-msvc)", @@ -200,8 +205,7 @@ def pr_expected_jobs(selected: Scope, files: list[str], plan: dict) -> set[str]: expected -= heavy # Existing client proofs cover category links, not the cmocka CMake # pass. The base-owned selector must witness that pass even on fast PRs. - if getattr(selected, "cmocka_link", False): - expected.update(f"Build 🧱 / Tier 2 Link Check 🔗 ({alias})" for alias in ("win-x64", "mac-arm64")) + expected.update(cmocka_jobs(selected)) for key, job_names in names.items(): status = plan["jobs"].get(key, {}) needed = status.get("required_gates", [])