Repository navigation
test/cmocka: Keep test_core_module_load's child on the selected libobs - #1615
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
LD_LIBRARY_PATH(rust/tools/linux-validate/validate.sh). The test binaries' RUNPATH names the C libobs and yields to it.run_scenario()clearedLD_LIBRARY_PATHin 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'slddcheck, still saw libobs-with-rust, so nothing failed.libobs.soit runs on in/proc/self/maps, and the child gets anLD_LIBRARY_PATHof that directory alone. The dependency is still out of reach, because it sits intest/cmocka/and not next to libobs. In mode OFF, that directory is the one the RUNPATH already names.LD_LIBRARY_PATHor 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'sDYLD_FRAMEWORK_PATHlane 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=libsshows whichlibobs.so.30each process initializes:RED → GREEN
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.uv run ci/local_gate.py --lane lintpasses.Checklist
masterdocs/features.mdis added or updated (not applicable: no user-visible change)-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