Skip to content

libobs: port obs_set_locale to Rust (Refs #5042) - #5061

Open
zackees wants to merge 6 commits into
masterfrom
port/5042-set-locale
Open

zackees wants to merge 6 commits into
masterfrom
port/5042-set-locale

Conversation

@zackees

@zackees zackees commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

READY-HELD: waiting for #5246 to merge. Auto-merge is disabled and there is no queue entry. Current held head: cf0ee12d58179493c5010a25d7dfcdc561998d0d, rebased onto c24fc60f859b57fa944ab59705a95747f8577153. All six commit patches compare equal to the preceding validated head 3cb14909e29a12e79dc93ec28b227967ab8d660c.

The real locale adapter is an independent demand-linked member in the current legacy CMake support archive. It is NOT yet registered in #5246's JSON manifest, which remains absent from master. After #5246 merges, rebase this PR, add test/cmocka/set-locale-link-support.c to test/cmocka/build/rust-static-support.json, re-verify the native consumers and canonical-manifest checks, then arm. This PR must remain unarmed until that dependency and verification are complete.

The implementation and validation record below describes the preceding validated head; the hold rebase changed no port patches.

Refs #5042.

Final head: 3cb1490, based on 81bb3fc. Fresh final validation passed all five locale cases and the isolated differential child, all 360 application-category tests plus two isolated children, the final demand-linked locale adapter assertion, and both canonical-manifest fixture/export checks. The application run took 630.32 s under host load; its slow Objective-C/PCH fixture eventually passed. No test process was stopped. The final publication used the repository's ordinary-PR-CI fallback and carries no stale attestation trailers.

Commit 3cb1490 keeps the locale support assertion separate from the growing shared adapter list, preserving the same path check and failure message while avoiding the conflict that required the second rebase. The same reviewer confirmed this adjustment is clean.

The four self-test files implicated in the optional client-checks failure passed isolated retries: 52 tests across the first three files and all nine test_client_checks.py tests. This does not establish a complete client-checks proof.

obs_set_locale now delegates to a safe Rust core through private C field adapters. It frees the old libobs-owned locale before copying, stores the new copy before callbacks, forwards the original pointer including NULL, skips missing callbacks, and reads each next link after dispatch. The unchanged original C implementation remains in the common reference-only group on every host. The native fixture and LIBOBS_TEST_SOURCES manifest from merged #5045 are preserved.

Rebased onto master 81bb3fc, dropping #5045's commits. The original three port commits are unchanged by both rebases: RED 6c855f7 mirrors all three existing C characterization cases against the deliberate Rust stub; GREEN 165a0f7 and 518f7fa provide the implementation, original-C differential cases and callback ABI layout coverage. The original mutation check rejects reading the next module before dispatch. Tier 4 does not apply to this local API; behavior is unchanged.

Landing adds the real locale adapter as an independent demand-linked support member for every standalone Rust-static CMake consumer, following #5257. RED 58cfa47 requires the adapter in the existing registration test; before the fix, that assertion failed with missing real private adapter source: set-locale. GREEN 165b668 registers the member. The second rebase preserves master's new audio-capture adapter beside locale. One reviewer confirmed both the original review and this mechanical resolution are clean.

#5246 is still OPEN and replaces the legacy shared archive source list with its JSON manifest. The earlier merge-tree check against its head 15467c3 found a conflict in test/cmocka/tests.d/video_info_query_link_support.cmake. If #5246 lands first, preserve its new helper and add test/cmocka/set-locale-link-support.c to test/cmocka/build/rust-static-support.json.

Landing validation on the first rebased base b99407f:

  • Full SOLDR_PORCELAIN=0 ./lint passed with CI-pinned Soldr 0.9.45 (722.8 s), including formatting, all repository self-tests and the configured Clippy feature sets.
  • All 360 application-category tests and two isolated child checks passed. Both Linux-side canonical-manifest checks introduced by libobs: characterize and extract obs_set_locale (Refs #5041) #5045 passed: Cargo/CMake fixture selection agrees for Linux, Darwin and Windows, and the fixture exports exactly obs_test_set_locale_swap_core.
  • All five focused locale cases and the isolated differential child passed, including real Rust FFI versus original C and callback ABI layout. The Python all-host registration test also passed.
  • The push entry point's complete six-target Clippy/Dylint client-lint lane passed (1210.5 s). Its later client-checks phase failed three self-test files and hit a 600-second test_client_checks.py timeout, followed by the existing timeout handler's str/bytes TypeError. The three failed files independently passed all 52 cases on retry. The host client-test lane was not reached. That publication used partial evidence and ordinary PR CI.

A second rebase was necessary after master advanced during the long client checks. The only conflict was the adapter-list assertion, resolved by retaining both ports. Its stale attestation trailers were removed. The final head uses ordinary selected PR CI; complete fresh client evidence is not claimed. The full lint command was run once, as required by the pool brief.

Original port validation before these rebases: unchanged Tier 2 test_set_locale passed 100 times against each actual C-reference/hybrid library (200 total), both libraries exported the same 1,769 symbols, and actual Ninja source exclusion passed. Native macOS/Windows runtime execution remains for selected hosted checks.

Test cost: five new tests in the existing Core category binary; the original 25 reduced-parity debug repetitions had a longest combined run of 0.09360 s and peak RSS of 25,748 KiB, no test-owned threads and one isolated child per run. The first fresh focused run completed all five cases in 0.05 s. No new Rust test executable or workflow; existing C tests, public headers and WebSocket sources are preserved.

@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 18, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this to In progress in obs-rust Multiview Nov 18, 2026
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 18, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In progress to Needs fix in obs-rust Multiview Nov 18, 2026
@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees force-pushed the port/5042-set-locale branch 2 times, most recently from 8d5a7aa to 3cb1490 Compare November 19, 2026 20:45
@zackees
zackees marked this pull request as ready for review November 19, 2026 20:48
@zackees
zackees enabled auto-merge November 19, 2026 20:49
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees disabled auto-merge November 19, 2026 20:55
@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026
@zackees
zackees force-pushed the port/5042-set-locale branch from 3cb1490 to cf0ee12 Compare November 19, 2026 20:58
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs fix

Development

Successfully merging this pull request may close these issues.

1 participant