Skip to content

build: Give ported libobs files an include owner in the default hybrid - #1653

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/hybrid-default-test-build
Oct 21, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/hybrid-default-test-build

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

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).

  • Each of these tests compiles a ported libobs implementation file itself (obs-avc.c.h, media-io/video-io.c.h, pulseaudio-stream-flags.c.h). cmake/common/groups.cmake gives such a test the include directories of the target that owns the file's unity group.
  • The ported groups are compiled only by the C targets: libobs with the C backend, libobs-c-reference with 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 records libobs-objects as 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.
  • CI didn't catch this: the Tier 2 validators configure -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.
Configuration (Linux, Ninja, GCC) master 01561bf This branch
HYBRID, C_REFERENCE OFF (defaults), unit tests ON: ninja -k 0 (all) 4 FAILED (the four tests above) builds, 0 FAILED
same: the 4 tests + test_avc_parse + test_video_io not built 6/6 pass
OBS_LIBOBS_BACKEND=C: libobs + cmocka-tests builds builds, the same 6/6 pass
HYBRID, C_REFERENCE ON: libobs + libobs-c-reference + cmocka-tests builds builds, the same 6/6 pass

RED → GREEN

  • RED commit: 141cdcc ci: Add failing check for pinned ported files in the default hybrid. A new case in ci/test_hybrid_default.py builds a small project through the real implementation.cmake and groups.cmake: a default-configuration target pins a ported file whose header comes from libobs-objects' usage requirements. On master it fails with owner.h: No such file or directory (1 of 5 cases fails). Local RED for the real tree: ninja -k 0 of the default configuration, 4 FAILED.
  • GREEN: 69ebc50 (rebased on f3e6260; the two tests added there build in the default configuration too). uv run python -m unittest ci.test_hybrid_default passes 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 lint passes.
  • Real app: N/A (build files only; the app's libobs and frontend built the same before).

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 (lint lane passed locally; not stamped)
  • 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 (not applicable: no warning or flag change)
  • Intentional differences from C listed in the parity test header and rust/README.md (ports) (not applicable: not a port)

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
@rdoupe
rdoupe requested a review from zackees as a code owner October 21, 2026 19:57
@zackees
zackees added this pull request to the merge queue Oct 21, 2026
Merged via the queue into obs-rust:master with commit c0d1097 Oct 21, 2026
27 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: build: four cmocka tests don't compile in the default hybrid configuration

2 participants