Skip to content

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

Merged
zackees merged 6 commits into
masterfrom
port/5042-set-locale
Nov 20, 2026
Merged

zackees merged 6 commits into
masterfrom
port/5042-set-locale

Conversation

@zackees

@zackees zackees commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Refs #5042

obs_set_locale now delegates to a safe Rust core through real private C field adapters. It frees the old libobs-owned locale before copying, stores the new copy before callbacks, forwards the original argument including NULL, skips absent callbacks and reads each next link after dispatch. The original C implementation remains reference-only on every host. Public headers, existing C tests and OBS WebSocket are preserved.

After #5246 merged, the port was rebased onto master. Its real locale adapter is a separate lazy member in test/cmocka/build/rust-static-support.json, shared by CMake and Cargo-native consumers. Master's shared helper replaces the obsolete per-target source list. The common LIBOBS_TEST_SOURCES fixture registration remains available on all six supported targets.

RED 24fdf2b20 mirrors the three C characterization cases against a deliberate Rust stub; GREEN 52741e847 supplies the implementation and differential/layout coverage. The original mutation check rejects reading the next module before dispatch. The landing-support RED/GREEN commits require and register the locale adapter; range-diff preserves the original Rust implementation and test patches.

Fresh landing validation:

  • All five focused locale tests and the isolated differential child passed, covering ownership, callback order, NULL, callback mutation and real C callback layout.
  • Unchanged test_set_locale passed against each freshly rebuilt C-reference/hybrid library. ldd verified the actual selected library for each OFF/ON run; their exported symbol sets are identical at 1,769 symbols.
  • Four application registration/manifest checks passed, including Cargo/CMake fixture agreement for Linux, Darwin and Windows and exact fixture exports. Seven Python shared-support and locale-registration tests passed.
  • Complete ci/windows_link_check.py: all eight Windows MSVC category binaries; hybrid libobs and all 71 Rust-static fixtures on Windows x64 and Darwin arm64; MSVC static/import-provider audit passed. These are Linux-hosted links; native Windows/macOS execution remains hosted.
  • The single full ./lint run passed formatting and Ruff but hit an unchanged PipeWire diagnostic test's 0.3-second child-output deadline under load. All four tests in that file immediately passed in isolation. The repository's six-target client-lint lane subsequently passed in 996.5 s, and the push pipeline's complete repository self-tests and validators passed.
  • The publication pipeline passed all 9,279 workspace tests (six skipped), all 920 utility feature tests and doctests.

The extra whole Linux Tier 2 sweep reached its 90-minute cap after 4,511 cache-launcher failures forced an uncached recovery build. Both libraries, the symbol comparison and the focused OFF/ON locale tests succeeded before the cap; the whole sweep is incomplete. Its owned container was stopped and confirmed removed. No source change or global cache cleanup was made for that environment failure.

Tier 4 does not apply to this local API; no behavior change is intended. No new Rust test executable or workflow is added.

Test cost: five tests in the existing Core category; original 25 reduced-parity debug repetitions had a longest combined run of 0.09360 s and peak RSS 25,748 KiB, no test-owned threads and one isolated child per run. The fresh focused Rust tests took 0.02 s after compilation.

Publication through ./push completed all client gates, including Windows GNU category links. Final head 7e535cdedc2356f7d1d33df53aae9ac9af28af3d is signed and locally verified, with 19 fresh Ci-Attestation records and a Client-Checks receipt. No incomplete-evidence fallback warning was emitted. Hosted checks and the merge queue remain the merge gate.

@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
@zackees
zackees added this pull request to the merge queue Nov 19, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Nov 19, 2026
@zackees
zackees marked this pull request as draft November 19, 2026 22:03
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to In progress in obs-rust Multiview Nov 19, 2026
@zackees zackees added the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 20, 2026
Ci-Attestation: {"at":1795149802,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":420,"stamp":"920bf25da72036d309441c8eb88bdc34","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149802,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":420,"stamp":"d5432498a875717e5bd501e66f056d4a","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149802,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":420,"stamp":"11c754b2bdf251cadaae8b35870f2c11","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149802,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":420,"stamp":"e5e8cbac76ead62d30b32032dc236d2d","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149377,"gate":"general/all/client-lint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"f8e18baa310d3bfc32af329e7178e42c","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149802,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":420,"stamp":"159eb94eadfeec4c0e0a95093ce67106","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149379,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"b75e8af94f7cb069855e72dff82915a8","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149379,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"60af6147ab5b5c96862b0ba042c10844","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149378,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"a14d634e5c9208724238a77a7e222899","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149378,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"51eadc3fbccc6bc06663efb80bf3d981","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149378,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"46ab521efe8b8412d0c96299cbc43750","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149378,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"99ca316c00e7a17f548eb6067be20709","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149379,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"8323d201f89698c54b7183b8bd6d34b6","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149379,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"3c6750918de70bea58d208a5436f3a5f","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149378,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"ae5c56fa3ba9d9083de7d6c7875b7c9f","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149378,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"268ba1eb4afeb05273137a72524686ba","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149377,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"a9633cc2848afabb0b78dc760772d0f3","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795149377,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"468a481f3b14f071a261f10ac14b0ad1b19b8111302bda8138773ee7d0b8df36","lane":"client-lint","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":39,"stamp":"e878979661603cdfee3c632506de4207","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}
Ci-Attestation: {"at":1795151486,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"9f8bffe9cd182f28d34af9cb88d78875b416d3cb45c50dc4eb7de13eb8ffb646","lane":"client-test-x86_64-unknown-linux-gnu","parents":["fea024fb5f5d49e0d2e1bb8c94bf261475debf80"],"secs":1679,"stamp":"1a5c9f8fa45072f437a46f3c5251c6c6","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8","v":1,"via":"run"}

Client-Checks: {"checks":{"base":"088070feed7471d1c8d8914de22963de4a84450d","coverage":"all-tracked-applicable-files","diff":[".github/workflows/build-project.yaml","ci/test_tier2_macos_tail.py","ci/test_tier2_native_target.py","ci/tier2_macos_tail.py","libobs/build/libobs.core+.h.c","libobs/build/libobs.ported-set-locale+.h.c","libobs/build/ported-source-sets/set-locale.json","libobs/cmake/rust-exports.d/obs-core-set_locale.txt","libobs/obs-set-locale-fields.c.h","rust/README.md","rust/obs-build/tests/native/registration/canonical_video_info_query_is_registered.rs","rust/obs-c-oracle/oracle.d/set-locale.list","rust/obs-c-oracle/oracle/set_locale.c","rust/obs-core/src/ffi/mod.rs","rust/obs-core/src/ffi/set_locale.rs","rust/obs-core/src/lib.rs","rust/obs-core/src/set_locale.rs","rust/obs-core/tests/obs_core/main.rs","rust/obs-core/tests/obs_core/set_locale.rs","rust/obs-core/tests/obs_core/set_locale_parity.rs","rust/tools/tier2-validate/validate.sh","test/cmocka/build/rust-static-support.json","test/cmocka/set-locale-link-support.c"],"head":"d45022989f12e30a7e5fb76c0156d5c11481a4c5","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504\n   compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"59602fecffb4cd35299575af3f33b730b39d3fc0982fb6b4170932adb4906cc2","tree":"7b55c996343f4491660d0ed92e74b8de9da255b8"}}
@zackees
zackees force-pushed the port/5042-set-locale branch from cf0ee12 to 7e535cd Compare November 20, 2026 05:11
@zackees
zackees marked this pull request as ready for review November 20, 2026 05:13
@zackees
zackees enabled auto-merge November 20, 2026 05:13
@zackees zackees removed the pool-active Pool worker owns this PR; automated rebases must skip it label Nov 20, 2026
@zackees
zackees added this pull request to the merge queue Nov 20, 2026
Merged via the queue into master with commit 7dffa4d Nov 20, 2026
43 checks passed
@zackees
zackees deleted the port/5042-set-locale branch November 20, 2026 05:56
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to Done in obs-rust Multiview Nov 20, 2026
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