Skip to content

test/cmocka: Keep test_core_module_load's child on the selected libobs - #1615

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/module-load-test-lane
Oct 21, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/module-load-test-lane

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1614

What and why

In Tier 2 mode ON, test_core_module_load now checks core-module loading against libobs-with-rust. Before, it checked the C libobs in both modes. This is a test-infrastructure fix with no product change.

  • Mode ON selects libobs-with-rust only through LD_LIBRARY_PATH (rust/tools/linux-validate/validate.sh). The test binaries' RUNPATH names the C libobs and yields to it.
  • run_scenario() cleared LD_LIBRARY_PATH in the forked child before it re-ran the test (--child), so that the stub module's missing dependency stayed out of reach (bug: libobs: OBS refuses to start when one core module can't be loaded (obs-browser.so without libcef.so), and a missing core module skips the ones after it #749/libobs: Carry on when a core module cannot be loaded #750). The child then found the C libobs through its RUNPATH. The parent, and the lane's ldd check, still saw libobs-with-rust, so nothing failed.
  • The parent now finds the libobs.so it runs on in /proc/self/maps, and the child gets an LD_LIBRARY_PATH of that directory alone. The dependency is still out of reach, because it sits in test/cmocka/ and not next to libobs. In mode OFF, that directory is the one the RUNPATH already names.
  • The new case same_libobs has the child report the libobs it mapped and compares it with the parent's. The three existing cases keep their expectations.
  • No other cmocka test clears LD_LIBRARY_PATH or re-runs a libobs binary with a reset environment. The tests that start children (pipe, pulse, v4l2, nvenc) launch shells or helpers that inherit the environment. The test is Linux-only, and macOS's DYLD_FRAMEWORK_PATH lane is not affected.

Headless (private Xvfb, private D-Bus), both build lanes (ENABLE_RUST_LIBOBS OFF and ON), each run in mode OFF and in mode ON. LD_DEBUG=libs shows which libobs.so.30 each process initializes:

Build Mode Parent Children (4)
master 819a325, both lanes ON libobs-with-rust C libobs
master 819a325, both lanes OFF C libobs C libobs
This branch, both lanes ON libobs-with-rust libobs-with-rust
This branch, both lanes OFF C libobs C libobs

RED → GREEN

  • RED commit: 69e06eb test/cmocka: test_core_module_load's child runs on the C libobs in mode ON. In mode ON, same_libobs fails in both lanes ("child loaded .../libobs/libobs.so.30, this process runs on .../libobs-with-rust/libobs.so.30"). all_present, missing_dependency and missing_file pass. Mode OFF: 4/4.
  • GREEN: 28bd06d. test_core_module_load passes 4/4, with none skipped, in mode OFF and mode ON, in both lanes, in 3 of 3 runs. uv run ci/local_gate.py --lane lint passes.
  • Real app: not applicable (test only).

Checklist

  • Base is master
  • 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
  • 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 (a flag change under cmake/ or build-aux/ runs 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)

…de ON

Tier 2 mode ON runs the C tests against libobs-with-rust by putting its
directory first on LD_LIBRARY_PATH; the test binaries carry a RUNPATH to
the C libobs that yields to it. test_core_module_load clears
LD_LIBRARY_PATH before it execs its child, so that the stub module's
missing dependency stays out of reach, and the child then loads the C
libobs from its RUNPATH. The parent maps libobs-with-rust, so the lane
check passes, but every scenario the test checks runs on the C build in
both modes.

same_libobs (a new case; the other three keep their expectations) has
the child report the libobs.so it mapped and compares it with the one
this process runs on. It fails in mode ON on master.

Refs obs-rust#1614
The child got no LD_LIBRARY_PATH at all, so that the stub module's
missing dependency stays out of reach, and fell back to the C libobs in
its RUNPATH even when Tier 2 mode ON had selected libobs-with-rust. The
parent now finds the libobs.so it runs on in /proc/self/maps and gives
the child an LD_LIBRARY_PATH of that directory alone. The dependency is
still out of reach (it is not next to libobs), and in mode OFF the
directory is the one the RUNPATH names.

Fixes obs-rust#1614
@rdoupe
rdoupe requested a review from zackees as a code owner October 21, 2026 09:35
@zackees
zackees enabled auto-merge October 21, 2026 09:42
@zackees
zackees added this pull request to the merge queue Oct 21, 2026
Merged via the queue into obs-rust:master with commit c96d273 Oct 21, 2026
25 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/cmocka: test_core_module_load's child runs on the C libobs in Tier 2 mode ON

2 participants