Skip to content

build: make hybrid Rust/C libobs the application default - #1588

Merged
zackees merged 13 commits into
masterfrom
infra/1587-hybrid-default
Oct 21, 2026
Merged

zackees merged 13 commits into
masterfrom
infra/1587-hybrid-default

Conversation

@zackees

@zackees zackees commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Normal application builds installed C libobs while also building an unused Rust/C twin. This makes the installed/public libobs the hybrid: completed Rust ports replace their C equivalents; unported C/C++ remains legacy code.

  • Normal builds require Rust and exclude replaced C sources. OBS_BUILD_C_REFERENCE=ON enables a never-installed libobs-c-reference, excluded from all. OBS_LIBOBS_BACKEND=C preserves explicit temporary rollback.
  • NVENC installs its completed Rust loader, retaining an explicit C reference. OBS_BRAND_RUST controls product identity independently; historical branding inputs remain compatible.
  • Preserve both Tier 2 modes, exports/layout checks, Rust unit/differential tests, public headers and the unchanged C++ websocket plugin. The Cargo engine/bundled obs-sys uses the same source manifest and production selection (build: replace CMake with Cargo and cc::Build, preserving the complete OBS application #1332).
  • Consolidate duplicate Ubuntu app builds, supply offline checksum-pinned Flatpak Rust/Corrosion inputs, verify the packaged library and actual mapped core, and fail publication closed pending reviewed release evidence. No new workflow files.

Refs #1587. Coordinates with #1332. Merge through the normal queue is authorized by the current shepherding request; release publication remains gated.

RED → GREEN

RED 8d390bdf9: uv run python -m unittest ci.test_hybrid_default fails default/install/reference contracts because implementation selection is missing. GREEN 174109fad supplies that selection; subsequent fixes cover real platform and native-engine integration failures.

Local validation:

  • ./lint passes, most recently 41.6 seconds.
  • soldr cargo test --workspace --locked passes, including differential and documentation tests.
  • Real CMake libraries: identical 1,766 exports (1,762 with HEVC disabled); the Ninja graph excludes all 61 selected ported C implementations from production.
  • Unchanged CMake suite: 341 tests per backend, zero failures, the same three hardware-dependent skips; loader checks prove reference OFF / production hybrid ON.
  • Cargo-native integration: normal production API builds one hybrid with 1,766 exports and no reference output; explicit compatibility pair passes 59 unchanged C executables per backend (118 runs), loader checks, data lifecycle and plugin checks. Per-target native sanitizers disabled for this additional run; the CMake suite retains its existing sanitizer settings.
  • Actual glibc-2.28 AppImage builds. Debian saved-profile run loads the packaged libobs, records moving screen/camera sources and microphone audio; recording verifier confirms both moving regions and the 440 Hz tone without silence.
  • Unchanged websocket Tier 4: 206/206 checks, all 147 request types, against the executable extracted from that artifact. The AppImage entry point is separately covered by saved-profile testing. Host-ffmpeg-dependent SRT reconnect cases were skipped.
  • Explicit C rollback builds. Substituting it into the same package makes the new packaged-library check fail as expected.

Full evidence and limitations, including raw timing commands/results.

Scoped build measurements (single samples on a busy host, four compilation jobs, isolated compiler caches): fresh 11.406s C+Rust pair → 14.041s hybrid; warm header rebuild 7.970s → 5.995s; edited header 11.184s → 5.779s. These do not establish a general speedup or test-time savings.

Platform verification and release status

Verification-only run 39531699676 checks the corrected platform/packaging paths and cannot publish. Earlier verification exposed and fixed the obsolete macOS twin target, Flatpak debug-extraction corruption of its compiler, and cold soldr bootstrap stdout contaminating Cargo TOML. The cold-output regression is covered by separate RED/GREEN commits. Upstream Windows diagnostic fix #1591 is incorporated through the normal branch update; no C test body is changed in this PR's diff.

PR CI 39531640340 and verification-only 39531699676 passed at implementation commit 4ea443714; the final commit only records evidence. Windows Tier 2 passed 165 tests per backend with 1,794 matching exports; macOS passed 191 per backend with 1,877 matching exports. All platform packages and startup checks, offline Flatpak, and AppImage distribution checks passed. Two targeted retries addressed known VLC timing flake #838 and an AlmaLinux package-mirror outage, without code changes or weakened assertions. The PR is being rebased and shepherded through the normal merge queue at the maintainer’s request; release publication remains gated. Release approval separately requires the existing supported-platform, hardware-performance and 14-day stability evidence. hybrid-release-evidence.json remains unapproved; no release gate is waived.

Rebase and landing

Rebased onto master a73ccc24d, replacing head 6ccd396269bed71dabdd78c9566c43d415d3bf17. Preserved the new frontend platform macros, moved branding selection inside them, and retained the newly landed port descriptions. Focused CMake/frontend/packaging/release-gate tests: 16 passed. Fresh PR CI and merge-group CI govern landing; earlier platform runs above remain historical evidence. No release is requested.

@zackees

zackees commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Rebased onto origin/master a73ccc2 at the maintainer’s request, replacing head 6ccd396 with 55d887a using an exact force-with-lease. Resolved frontend platform-refactor conflicts while retaining its macros and branding separation; kept new port documentation. Local focused checks: 16 passed; ./lint passed (65.0s). Fresh PR CI will govern readiness and normal merge-queue admission. Release approval remains unchanged and unapproved.

@zackees
zackees marked this pull request as ready for review October 21, 2026 16:46
@zackees
zackees added this pull request to the merge queue Oct 21, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 21, 2026
@zackees
zackees marked this pull request as draft October 21, 2026 16:47
@zackees

zackees commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Temporarily returning to draft to cover the Windows NVENC reference artifact collision independently reported in #1626/#1627. The new obs-nvenc-c-reference target needs its archive output isolated just like the previous Rust twin; default production builds are unaffected. Adding a targeted CMake regression before queueing again.

@zackees

zackees commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Follow-up RED 6de8e3d reproduced identical Windows production/reference import-library paths with Ninja and Ninja Multi-Config. GREEN a447dca adds ARCHIVE_OUTPUT_DIRECTORY only to the explicit NVENC C reference, matching the independently diagnosed fix in #1627/#1626. Twelve focused hybrid/frontend/packaging checks pass; ./lint passes (40.8s). Production outputs remain unchanged. Previous rebased PR CI 39633486863 passed before this additional reference-path fix; fresh required CI now validates the final head.

@zackees
zackees force-pushed the infra/1587-hybrid-default branch from a447dca to 4458424 Compare October 21, 2026 17:12
@zackees

zackees commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

Master merged #1627 while final CI was running, causing an NVENC CMake conflict. Rebased onto e5a0f4f, replacing head a447dca using exact force-with-lease. Retained the isolated reference ARCHIVE_OUTPUT_DIRECTORY and updated the newly merged upstream regression to the renamed obs-nvenc-c-reference target, preserving every assertion and all platform/configuration cases. Thirteen focused checks pass; ./lint passes (76.9s). New head 4458424 requires fresh PR and merge-group checks.

@zackees
zackees marked this pull request as ready for review October 21, 2026 17:39
@zackees
zackees added this pull request to the merge queue Oct 21, 2026
Merged via the queue into master with commit 2a1ab00 Oct 21, 2026
27 checks passed
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 21, 2026
obs-rust#1653)

* ci: Add failing check for pinned ported files in the default hybrid

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

* build: Give ported libobs files an include owner in the default hybrid

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
@zackees
zackees deleted the infra/1587-hybrid-default branch October 26, 2026 15:45
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.

1 participant