Repository navigation
build: Give ported libobs files an include owner in the default hybrid - #1653
Merged
Merged
Conversation
With the default backend (HYBRID, OBS_BUILD_C_REFERENCE OFF) since obs-rust#1588, no C target compiles libobs's ported unity groups, so their implementation files have no owner in cmake/common/groups.cmake. A cmocka test that compiles one of them itself then gets none of libobs's include directories: test_avc and test_video_io_hidden fail with caption/caption.h not found, test_pulse_monitor_backlog and test_pulse_monitor_flags with pulseaudio-stream-flags.h not found. The new case builds, through the real implementation.cmake and groups.cmake, a default-configuration target that pins a ported file whose header comes from libobs-objects' usage requirements. It fails on master with "owner.h: No such file or directory". Refs obs-rust#1652
A test that compiles a ported implementation file itself (test_avc pins obs-avc.c.h) takes that file's include directories from the target that owns its group. With OBS_LIBOBS_BACKEND=C the owner is libobs, with OBS_BUILD_C_REFERENCE=ON it is libobs-c-reference, but in the default hybrid (obs-rust#1588) no target compiles the ported groups, so the file had no owner and the test none of libobs's headers. When there is no C target, obs_libobs_add_c_sources() now records libobs-objects as the owner of the ported groups' members. It carries the usage requirements both libobs binaries share (libcaption, the libobs source dir). The backends and what they compile are unchanged. Fixes obs-rust#1652
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 #1652
What and why
Since #1588 made the hybrid libobs the default (OBS_LIBOBS_BACKEND=HYBRID, OBS_BUILD_C_REFERENCE=OFF), a default configuration with ENABLE_UNIT_TESTS=ON doesn't build. Four cmocka tests fail to compile: test_avc and test_video_io_hidden (
caption/caption.h: No such file or directory), and test_pulse_monitor_backlog and test_pulse_monitor_flags (audio-monitoring/pulse/pulseaudio-stream-flags.h: No such file or directory).obs-avc.c.h,media-io/video-io.c.h,pulseaudio-stream-flags.c.h).cmake/common/groups.cmakegives such a test the include directories of the target that owns the file's unity group.libobswith the C backend,libobs-c-referencewith the reference on. In the default hybrid neither exists, so the files had no owner and the tests none of libobs's headers.obs_libobs_add_c_sources()now recordslibobs-objectsas the owner when there is no C target. It's the object library both libobs binaries share, and it carries libobs's usage requirements (libcaption, the libobs source dir). The backends, their defaults and what each target compiles are unchanged.-DOBS_BUILD_C_REFERENCE=ON, and the Qt frontend job builds only Qt-linked tests. The nightly sanitizer run uses the default hybrid with unit tests and would have hit it.ninja -k 0(all)RED → GREEN
ci: Add failing check for pinned ported files in the default hybrid. A new case inci/test_hybrid_default.pybuilds a small project through the realimplementation.cmakeandgroups.cmake: a default-configuration target pins a ported file whose header comes fromlibobs-objects' usage requirements. On master it fails withowner.h: No such file or directory(1 of 5 cases fails). Local RED for the real tree:ninja -k 0of the default configuration, 4 FAILED.uv run python -m unittest ci.test_hybrid_defaultpasses 5/5. The default configuration builds every target (ninja -k 0, 0 FAILED) and the affected tests pass, see the table. The C backend and hybrid with C reference still build all test targets.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 (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC (not applicable: no warning or flag change)