Skip to content

test: Build the Rust effect parser test only with the Rust staticlib - #1685

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/c-lane-effect-parser-test
Oct 22, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/c-lane-effect-parser-test

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1683

What and why

A build with -DOBS_LIBOBS_BACKEND=C and unit tests builds all its test targets again. Since #1650 it failed to link test_effect_parser_lifecycle_rust (cannot find -llibobs_rust-static).

  • rust: port effect parser lifecycle to obs-graphics #1650 added test_effect_parser_lifecycle_rust to test/cmocka/tests.d/test_effect_parser_lifecycle.cmake. It runs the effect parser lifecycle assertions against the production Rust staticlib and links libobs_rust-static unconditionally. That target exists only with the hybrid backend; with the C backend CMake passed the name to the linker as -llibobs_rust-static.
  • The Rust variant is now built and registered only if(TARGET libobs_rust-static), as test_preflight_abi already does. The C variant, test_effect_parser_lifecycle, builds and runs in both backends as before, and the hybrid backend builds and runs both.
  • CI builds no C backend with unit tests, so nothing there saw it. Every build job uses the default hybrid backend (the ENABLE_RUST_LIBOBS ON/OFF matrix only picks the product identity now), and sanitizers.yaml selects the C backend only when it is dispatched by hand with rust_libobs: false. This PR doesn't change CI. It adds ci/test_cmocka_rust_static_guard.py instead, which the lint lane and check-format already run: every tests.d/*.cmake line that names libobs_rust-static must be inside an if(TARGET libobs_rust-static) block (an else() branch doesn't count).

Headless (private Xvfb, private D-Bus, fresh HOME), RelWithDebInfo:

Build Case Result
master f1783cf, C backend ninja -k 0 1 FAILED: test_effect_parser_lifecycle_rust
master f1783cf, hybrid ninja -k 0 0 FAILED
This branch, C backend ninja -k 0 0 FAILED; test_effect_parser_lifecycle passes, no _rust target
This branch, hybrid ninja -k 0 0 FAILED; test_effect_parser_lifecycle and test_effect_parser_lifecycle_rust pass

RED → GREEN

  • RED commit: 1eb4727 ci: Check that cmocka tests link libobs_rust-static only behind a guard. On master it fails 1 of 2 cases: test_rust_static_lib_is_guarded names test/cmocka/tests.d/test_effect_parser_lifecycle.cmake:25. The other case checks the checker itself (unguarded, guarded, nested, else() and comment lines). The build-level RED is the C-backend ninja -k 0 on master in the table above.
  • GREEN: b020215. The check passes 2 of 2. C backend: ninja -k 0 0 FAILED, ctest lists 357 tests, test_effect_parser_lifecycle passes. Hybrid: ninja -k 0 0 FAILED, ctest lists 358 tests, test_effect_parser_lifecycle and test_effect_parser_lifecycle_rust pass. uv run ci/local_gate.py --lane lint: ok. The change is one test's CMake guard, so I didn't run the full suites.
  • Real app (UI, protocol output or logging changes): N/A, no product change.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits (N/A for docs-only; a focused CI fix may push RED and GREEN together)
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with scripting ON (PR CI builds no OBS app: run gh workflow run ci.yml --ref <branch> for the full builds) and cross-checked with clang and MSVC
  • Intentional differences from C listed in the parity test header and rust/README.md (ports)

test_effect_parser_lifecycle_rust (from obs-rust#1650) links libobs_rust-static
unconditionally. That target exists only with OBS_LIBOBS_BACKEND=HYBRID,
so a C-backend build with unit tests fails to link it ("cannot find
-llibobs_rust-static"). CI builds no C backend with unit tests, so
nothing there notices. This static check does: every tests.d/*.cmake
line that names the Rust static library must be inside an
if(TARGET libobs_rust-static) block, as test_preflight_abi already is.

It fails on master for test_effect_parser_lifecycle.cmake:25.

Refs obs-rust#1683
obs-rust#1650 added test_effect_parser_lifecycle_rust, which runs the effect
parser lifecycle assertions against the production Rust staticlib and
links libobs_rust-static. With OBS_LIBOBS_BACKEND=C there is no such
target, so the C-lane test build failed to link it. Build and register
that variant only if(TARGET libobs_rust-static), as test_preflight_abi
does. The C variant, test_effect_parser_lifecycle, still builds and runs
in both lanes, and the hybrid lane builds and runs both, as before.

Fixes obs-rust#1683
@rdoupe
rdoupe requested a review from zackees as a code owner October 22, 2026 00:52
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into obs-rust:master with commit 5353ee1 Oct 22, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: test: the C-backend test build fails to link test_effect_parser_lifecycle_rust

2 participants