Repository navigation
test: Build the Rust effect parser test only with the Rust staticlib - #1685
Merged
Merged
Conversation
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
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 #1683
What and why
A build with
-DOBS_LIBOBS_BACKEND=Cand unit tests builds all its test targets again. Since #1650 it failed to linktest_effect_parser_lifecycle_rust(cannot find -llibobs_rust-static).test_effect_parser_lifecycle_rusttotest/cmocka/tests.d/test_effect_parser_lifecycle.cmake. It runs the effect parser lifecycle assertions against the production Rust staticlib and linkslibobs_rust-staticunconditionally. That target exists only with the hybrid backend; with the C backend CMake passed the name to the linker as-llibobs_rust-static.if(TARGET libobs_rust-static), astest_preflight_abialready does. The C variant,test_effect_parser_lifecycle, builds and runs in both backends as before, and the hybrid backend builds and runs both.ENABLE_RUST_LIBOBSON/OFF matrix only picks the product identity now), andsanitizers.yamlselects the C backend only when it is dispatched by hand withrust_libobs: false. This PR doesn't change CI. It addsci/test_cmocka_rust_static_guard.pyinstead, which the lint lane and check-format already run: everytests.d/*.cmakeline that nameslibobs_rust-staticmust be inside anif(TARGET libobs_rust-static)block (anelse()branch doesn't count).Headless (private Xvfb, private D-Bus, fresh HOME), RelWithDebInfo:
ninja -k 0test_effect_parser_lifecycle_rustninja -k 0ninja -k 0test_effect_parser_lifecyclepasses, no_rusttargetninja -k 0test_effect_parser_lifecycleandtest_effect_parser_lifecycle_rustpassRED → GREEN
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_guardednamestest/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-backendninja -k 0on master in the table above.ninja -k 00 FAILED, ctest lists 357 tests,test_effect_parser_lifecyclepasses. Hybrid:ninja -k 00 FAILED, ctest lists 358 tests,test_effect_parser_lifecycleandtest_effect_parser_lifecycle_rustpass.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.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC