Skip to content

feat(libobs): port base log and crash handlers to Rust - #61

Merged
zackees merged 3 commits into
obs-rust:masterfrom
nathan-v:rust/base-port
Oct 10, 2026
Merged

zackees merged 3 commits into
obs-rust:masterfrom
nathan-v:rust/base-port

Conversation

@nathan-v

@nathan-v nathan-v commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

Ports the handler state in libobs/util/base.c to Rust. blog, blogva, and bcrash stay in libobs/util/base-variadic.c, compiled only when ENABLE_RUST_LIBOBS=ON. Stable Rust cannot define a C variadic function, and the default handlers are vsnprintf and vfprintf. The Rust core owns the log handler, the crash handler, and the crash-once flag.

base_get_log_handler, base_set_log_handler, and base_set_crash_handler are exported. base_begin_crash is a hidden Rust symbol. base_default_log_handler and base_log_literal are hidden C helpers. An ENABLE_RUST_LIBOBS=OFF build still compiles the original util/base.c and does not compile the adapter.

A null log handler still means the default handler, and the param is stored either way. The first crash handler wins. A second call logs the same warning as base.c and leaves the first handler in place. A null crash handler installed on that first call is stored, and is distinct from "never set".

The shim mutex covers the pointer update and is dropped before the handler runs, so a handler can call blog again. C used plain stores. Single-threaded results match.

Also lets the Linux Tier 2 image build on arm64, and lets run.sh start under macOS bash 3.2. libvpl-dev is amd64-only and Quick Sync is off in that harness, so the package is installed only when apt has it. An empty env array is expanded only when it has entries.

Motivation and Context

Issue #43 still has base open. This is the first of those remaining utility ports. The public blog / bcrash signatures in base.h are unchanged.

Refs #43

How Has This Been Tested?

macOS 26, Apple Silicon (arm64), Rust 1.97.1. Linux Tier 2 runs in Docker on ubuntu:26.04 arm64.

  • ./lint: clang-format, gersemi, rustfmt, clippy -D warnings. Pass.
  • soldr cargo test -p obs-util --test base --test base_parity --test export_list: Tier 1, Tier 3 (including proptest), and the export list. Pass. The default-handler capture runs in a one-test child and writes to files, so it does not catch libtest's stdout and it does not depend on libc::pipe.
  • Mutation check: the crash-handler warning string was changed and second_crash_handler_matches_oracle failed. Reverted.
  • ./unittest Tier 2: cmocka passed with ENABLE_RUST_LIBOBS OFF and ON, including test_base. libobs exports were identical (1752 symbols). base.c is not compiled into the ON build.

The other cmocka tests passed in that same OFF/ON pair. This does not change their sources.

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Documentation (a change to documentation pages)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@nathan-v nathan-v mentioned this pull request Oct 9, 2026
7 tasks done
libvpl-dev exists only for amd64, so an arm64 ubuntu:26.04 image
failed apt. Quick Sync is off in validate.sh, so the image installs
that package only when apt has it.

macOS /bin/bash is 3.2. With set -u, an empty env array is an unbound
variable, and a normal checkout never fills that array. Expand it
only when it has entries.
blog, blogva, and bcrash stay in util/base-variadic.c. Stable Rust
cannot define a C variadic function, and the default handlers are
vsnprintf and vfprintf. The Rust core owns the handler slots.

A null log handler still means the default handler, and the param is
stored either way. The first crash handler wins. A second call logs
the same warning as base.c and leaves the first handler in place.

The shim mutex covers the pointer update and is dropped before the
handler runs, so a handler can re-enter. C used plain stores.

Tier 1 and Tier 3 cover the cmocka cases, the default handler
(including the 8191-character cap), and the crash-once warning.
Mutating that warning fails second_crash_handler_matches_oracle.

Local-Gate: v1 tree=ec1003cdbfaf2a0877e87aa0ecb9a23d754be12e secs=21 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791573102,"gate":"rust/all/fmt","host":"darwin-arm64","key":"f28271ff1a1a079c9f25719ed3d72f8a251e02dc1e5b2d3a991d0591f7d6cf09","lane":"lint","parents":["c4b6372ed9e830c3603c8ba7b9a2a28c67faa70e"],"secs":3,"stamp":"0a9f224a6d06afd30936a8f298e1710a","tree":"ec1003cdbfaf2a0877e87aa0ecb9a23d754be12e","v":1,"via":"run"}
Ci-Attestation: {"at":1791573102,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"darwin-arm64","key":"f28271ff1a1a079c9f25719ed3d72f8a251e02dc1e5b2d3a991d0591f7d6cf09","lane":"lint","parents":["c4b6372ed9e830c3603c8ba7b9a2a28c67faa70e"],"secs":3,"stamp":"351639dac85597babf8cb16f7a7e4d84","tree":"ec1003cdbfaf2a0877e87aa0ecb9a23d754be12e","v":1,"via":"run"}
Ci-Attestation: {"at":1791573102,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"darwin-arm64","key":"ee38b2b0db728a064a8d3939aec26904835587ee5d14fd7d5358f6483c805cad","lane":"rust-test","parents":["c4b6372ed9e830c3603c8ba7b9a2a28c67faa70e"],"secs":2,"stamp":"5d1ba46eebe056e7423f1c3a0afea20d","tree":"ec1003cdbfaf2a0877e87aa0ecb9a23d754be12e","v":1,"via":"run"}
Ci-Attestation: {"at":1791573102,"gate":"cpp/linux-x64/tier2","host":"darwin-arm64","key":"b2f30316a5cce5431abc63e19d5828332d762329d56aaeedcf75f34e1f40831b","lane":"tier2-linux","parents":["c4b6372ed9e830c3603c8ba7b9a2a28c67faa70e"],"secs":15,"stamp":"8e267bd42eaf96cf66303698b8398cc0","tree":"ec1003cdbfaf2a0877e87aa0ecb9a23d754be12e","v":1,"via":"run"}
The oracle is built with -std=c11, which hides pthread_mutexattr_settype
and PTHREAD_MUTEX_RECURSIVE from threading.h. GCC 14 rejects the implicit
declaration, so obs-c-oracle failed to build on current Linux toolchains.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=04d692aa72ae0d9a0d63409668e6c838a8a69357 secs=581 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791592685,"gate":"rust/all/fmt","host":"linux-x86_64","key":"678c312ba21812678adb6231ee5fcf1dd9377519ec71c0911e121e16e2b580b1","lane":"lint","parents":["93184719c6cdc97e94ae6895b2a5745f89ef28e9"],"secs":17,"stamp":"e2828f6fadd08cc53030fa5653cc42f8","tree":"04d692aa72ae0d9a0d63409668e6c838a8a69357","v":1,"via":"run"}
Ci-Attestation: {"at":1791592685,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"678c312ba21812678adb6231ee5fcf1dd9377519ec71c0911e121e16e2b580b1","lane":"lint","parents":["93184719c6cdc97e94ae6895b2a5745f89ef28e9"],"secs":17,"stamp":"e915e4d833ce937f730fc1351e36a194","tree":"04d692aa72ae0d9a0d63409668e6c838a8a69357","v":1,"via":"run"}
Ci-Attestation: {"at":1791592686,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"9194eaddad3ef34b770f4e218534bd73c89ad0cf721296651a9055dc7c5191c4","lane":"rust-test","parents":["93184719c6cdc97e94ae6895b2a5745f89ef28e9"],"secs":6,"stamp":"04a8381180b64e44e28b59448c62f7b0","tree":"04d692aa72ae0d9a0d63409668e6c838a8a69357","v":1,"via":"run"}
Ci-Attestation: {"at":1791592686,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"53ac43d2d40c7748c7e24d1c56321895778805b470cfcff03f8cc6f9d1fbe073","lane":"tier2-linux","parents":["93184719c6cdc97e94ae6895b2a5745f89ef28e9"],"secs":558,"stamp":"a69aa40b0492884cada8cebe058b1242","tree":"04d692aa72ae0d9a0d63409668e6c838a8a69357","v":1,"via":"run"}
@zackees

zackees commented Oct 10, 2026

Copy link
Copy Markdown
Member

Rebased onto master (one conflict in rust/tools/linux-validate/run.sh: kept your empty-env guard and added master's new "$@" passthrough from #69). Also added 072d593: oracle/base.c now defines _GNU_SOURCE. Under -std=c11, threading.h's pthread_mutexattr_settype/PTHREAD_MUTEX_RECURSIVE are hidden, and GCC 14 rejects the implicit declaration, so obs-c-oracle failed to build. That was already the case before the rebase. Full local gate passes.

@zackees
zackees merged commit fa0a0c3 into obs-rust:master Oct 10, 2026
zackees added a commit that referenced this pull request Oct 10, 2026
…43)

Phase 3 ports of libobs/util into the obs-util crate, each with a safe
core, a C ABI shim, Tier 1 tests, a layout test where a struct crosses
the ABI, and a proptest parity suite against the original C built as an
oracle. ENABLE_RUST_LIBOBS=ON drops the matching C sources from libobs.

- utf8: hidden and non-Windows only (Windows keeps the C utf8.c).
- lexer.c: follows master's C, including the #48 strref ordering.
- text-lookup: no longer crashes on an opening quote at end of line;
  the shim returns false for a NULL lookup.
- dstr: follows master's #46/#47 fixes; strlist_split takes a NUL
  separator. Wide-char and printf helpers stay in dstr-libc.c.
- bmem: Windows _aligned_* branch and the allocation counter.

The oracle vendors uthash 2.3.0 (BSD-1-Clause) for text-lookup.c, since
the Rust test runners have no uthash package.

Refs #43

Rebased onto master after #61 (base), #66 (file-serializer) and #85 (real
utf8.c in the oracle): the oracle's utf8.c/platform_conv_host.c now use
oracle_* utf8 names so they no longer clash with the Rust shims; the
dstr-conversion oracle test moved to obs-util and calls oracle_dstr_*;
duplicate bcrash/os_fopen/bmemdup/os_*_ptr stand-ins were dropped in favour
of master's base-variadic.c, file_serializer_host.c and
platform_conv_host.c; utf8 shims are listed in rust-hidden.txt; the
vendored uthash is excluded from clang-format.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=f8f345fc846645c43b3c2eaa8beba80e61170919 secs=50 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791650348,"gate":"rust/all/fmt","host":"linux-x86_64","key":"5d788f859986e843d38c8eeda4bdd0dbf879a6b1ab69e87735fa7dc8a903072e","lane":"lint","parents":["e9d5e41e39e22729c453774feb82c8430e17a8f8"],"secs":15,"stamp":"b5ade2b00bc86726d90ce0af4807848f","tree":"f8f345fc846645c43b3c2eaa8beba80e61170919","v":1,"via":"run"}
Ci-Attestation: {"at":1791650348,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"5d788f859986e843d38c8eeda4bdd0dbf879a6b1ab69e87735fa7dc8a903072e","lane":"lint","parents":["e9d5e41e39e22729c453774feb82c8430e17a8f8"],"secs":15,"stamp":"ada418f2ad1451744b412aa5f061905b","tree":"f8f345fc846645c43b3c2eaa8beba80e61170919","v":1,"via":"run"}
Ci-Attestation: {"at":1791650348,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"2db21c07af54c47d710bfd0a2f9c401541637e3b4128840e6cfc5925e13df843","lane":"rust-test","parents":["e9d5e41e39e22729c453774feb82c8430e17a8f8"],"secs":10,"stamp":"05e830091e25865912b880bab7f6fd3a","tree":"f8f345fc846645c43b3c2eaa8beba80e61170919","v":1,"via":"run"}
Ci-Attestation: {"at":1791650348,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"6cd30a151325eaae1cd37d93dd390e21ad24845efbac72b5338eb6cf7df95d20","lane":"tier2-linux","parents":["e9d5e41e39e22729c453774feb82c8430e17a8f8"],"secs":25,"stamp":"181b109c7353cb8952c42dfcf0124aad","tree":"f8f345fc846645c43b3c2eaa8beba80e61170919","v":1,"via":"run"}
zackees added a commit that referenced this pull request Oct 10, 2026
…43)

Phase 3 ports of libobs/util into the obs-util crate, each with a safe
core, a C ABI shim, Tier 1 tests, a layout test where a struct crosses
the ABI, and a proptest parity suite against the original C built as an
oracle. ENABLE_RUST_LIBOBS=ON drops the matching C sources from libobs.

- utf8: hidden and non-Windows only (Windows keeps the C utf8.c).
- lexer.c: follows master's C, including the #48 strref ordering.
- text-lookup: no longer crashes on an opening quote at end of line;
  the shim returns false for a NULL lookup.
- dstr: follows master's #46/#47 fixes; strlist_split takes a NUL
  separator. Wide-char and printf helpers stay in dstr-libc.c.
- bmem: Windows _aligned_* branch and the allocation counter.

The oracle vendors uthash 2.3.0 (BSD-1-Clause) for text-lookup.c, since
the Rust test runners have no uthash package.

Refs #43

Rebased onto master after #61 (base), #66 (file-serializer) and #85 (real
utf8.c in the oracle): the oracle's utf8.c/platform_conv_host.c now use
oracle_* utf8 names so they no longer clash with the Rust shims; the
dstr-conversion oracle test moved to obs-util and calls oracle_dstr_*;
duplicate bcrash/os_fopen/bmemdup/os_*_ptr stand-ins were dropped in favour
of master's base-variadic.c, file_serializer_host.c and
platform_conv_host.c; utf8 shims are listed in rust-hidden.txt; the
vendored uthash is excluded from clang-format.

Rebased again onto master after #82/#83/#87/#97/#89: oracle build.rs keeps
video_fourcc.c/task.c and drops the direct util/utf8.c (oracle/utf8.c already
compiles it under oracle_* names, which platform_conv_host.c and #82's
file_serializer_host.c use).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=21926a8ffae3e3de7be0daaa6a529723f7497869 secs=50 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791654631,"gate":"rust/all/fmt","host":"linux-x86_64","key":"6277551b1197bae61a0a3563f9047b17c1e6d651b5cab860d7def119d1cbc569","lane":"lint","parents":["5502191074629b7f2e51dda6d89fa601ce22a01d"],"secs":12,"stamp":"92e0f34f8074164ecb0208cbd6f8ab26","tree":"21926a8ffae3e3de7be0daaa6a529723f7497869","v":1,"via":"run"}
Ci-Attestation: {"at":1791654631,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"6277551b1197bae61a0a3563f9047b17c1e6d651b5cab860d7def119d1cbc569","lane":"lint","parents":["5502191074629b7f2e51dda6d89fa601ce22a01d"],"secs":12,"stamp":"4d3ace010dbaab4ed252006d22ec59aa","tree":"21926a8ffae3e3de7be0daaa6a529723f7497869","v":1,"via":"run"}
Ci-Attestation: {"at":1791654631,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"c6b1b608fc16817859a28490ada2b38a926103a0094ec23e3bb7d594979793d7","lane":"rust-test","parents":["5502191074629b7f2e51dda6d89fa601ce22a01d"],"secs":18,"stamp":"d73d3c14d2d133a677293234ca581902","tree":"21926a8ffae3e3de7be0daaa6a529723f7497869","v":1,"via":"run"}
Ci-Attestation: {"at":1791654631,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"d05a3c8a53e501ee21ca4d301b5ba053c0dccd6b86b39d46af0486606d1d851e","lane":"tier2-linux","parents":["5502191074629b7f2e51dda6d89fa601ce22a01d"],"secs":20,"stamp":"7dedfefe7e32a22a666716a1fd3efcb5","tree":"21926a8ffae3e3de7be0daaa6a529723f7497869","v":1,"via":"run"}
zackees added a commit that referenced this pull request Oct 10, 2026
…43)

Phase 3 ports of libobs/util into the obs-util crate, each with a safe
core, a C ABI shim, Tier 1 tests, a layout test where a struct crosses
the ABI, and a proptest parity suite against the original C built as an
oracle. ENABLE_RUST_LIBOBS=ON drops the matching C sources from libobs.

- utf8: hidden and non-Windows only (Windows keeps the C utf8.c).
- lexer.c: follows master's C, including the #48 strref ordering.
- text-lookup: no longer crashes on an opening quote at end of line;
  the shim returns false for a NULL lookup.
- dstr: follows master's #46/#47 fixes; strlist_split takes a NUL
  separator. Wide-char and printf helpers stay in dstr-libc.c.
- bmem: Windows _aligned_* branch and the allocation counter.

The oracle vendors uthash 2.3.0 (BSD-1-Clause) for text-lookup.c, since
the Rust test runners have no uthash package.

Refs #43

Rebased onto master after #61 (base), #66 (file-serializer) and #85 (real
utf8.c in the oracle): the oracle's utf8.c/platform_conv_host.c now use
oracle_* utf8 names so they no longer clash with the Rust shims; the
dstr-conversion oracle test moved to obs-util and calls oracle_dstr_*;
duplicate bcrash/os_fopen/bmemdup/os_*_ptr stand-ins were dropped in favour
of master's base-variadic.c, file_serializer_host.c and
platform_conv_host.c; utf8 shims are listed in rust-hidden.txt; the
vendored uthash is excluded from clang-format.

Rebased again onto master after #82/#83/#87/#97/#89/#98: oracle build.rs keeps
video_fourcc.c/task.c and drops the direct util/utf8.c (oracle/utf8.c already
compiles it under oracle_* names, which platform_conv_host.c and #82's
file_serializer_host.c use).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=1b426910df018155f8be2a2ed4dc5fd8b42d68a0 secs=17 lanes=lint:reused@12a747713c0b,rust-test:reused@8f0383f521c9,tier2-linux:run
Ci-Attestation: {"at":1791655075,"gate":"rust/all/fmt","host":"linux-x86_64","key":"12a747713c0b7b727bbfb48e33e2c7c1aa431a3c77062fee88a56e5821c8b6c5","lane":"lint","parents":["84c80bce3c20e772d563e2c85b32ed5ac51020b4"],"secs":null,"stamp":"58719f015cf7d13d7f971c86c36023dd","tree":"1b426910df018155f8be2a2ed4dc5fd8b42d68a0","v":1,"via":"reused"}
Ci-Attestation: {"at":1791655075,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"12a747713c0b7b727bbfb48e33e2c7c1aa431a3c77062fee88a56e5821c8b6c5","lane":"lint","parents":["84c80bce3c20e772d563e2c85b32ed5ac51020b4"],"secs":null,"stamp":"42c3a2e402903d1da67f91e332763625","tree":"1b426910df018155f8be2a2ed4dc5fd8b42d68a0","v":1,"via":"reused"}
Ci-Attestation: {"at":1791655075,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"8f0383f521c9857941f5429d53f8403e48869775747f8ce4edeee1af4e935da8","lane":"rust-test","parents":["84c80bce3c20e772d563e2c85b32ed5ac51020b4"],"secs":null,"stamp":"814d385ae14911c99b750eff7d8faa6a","tree":"1b426910df018155f8be2a2ed4dc5fd8b42d68a0","v":1,"via":"reused"}
Ci-Attestation: {"at":1791655401,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"2e94b41fc041e0c98bd1709f7ab30cb7f5b5b835b799b4c3abb2c5414d4b62ec","lane":"tier2-linux","parents":["84c80bce3c20e772d563e2c85b32ed5ac51020b4"],"secs":17,"stamp":"e6e3337d94f8a4dbafc4a9892b369084","tree":"1b426910df018155f8be2a2ed4dc5fd8b42d68a0","v":1,"via":"run"}
zackees added a commit that referenced this pull request Oct 10, 2026
…43)

Phase 3 ports of libobs/util into the obs-util crate, each with a safe
core, a C ABI shim, Tier 1 tests, a layout test where a struct crosses
the ABI, and a proptest parity suite against the original C built as an
oracle. ENABLE_RUST_LIBOBS=ON drops the matching C sources from libobs.

- utf8: hidden and non-Windows only (Windows keeps the C utf8.c).
- lexer.c: follows master's C, including the #48 strref ordering.
- text-lookup: no longer crashes on an opening quote at end of line;
  the shim returns false for a NULL lookup.
- dstr: follows master's #46/#47 fixes; strlist_split takes a NUL
  separator. Wide-char and printf helpers stay in dstr-libc.c.
- bmem: Windows _aligned_* branch and the allocation counter.

The oracle vendors uthash 2.3.0 (BSD-1-Clause) for text-lookup.c, since
the Rust test runners have no uthash package.

Refs #43

Rebased onto master after #61 (base), #66 (file-serializer) and #85 (real
utf8.c in the oracle): the oracle's utf8.c/platform_conv_host.c now use
oracle_* utf8 names so they no longer clash with the Rust shims; the
dstr-conversion oracle test moved to obs-util and calls oracle_dstr_*;
duplicate bcrash/os_fopen/bmemdup/os_*_ptr stand-ins were dropped in favour
of master's base-variadic.c, file_serializer_host.c and
platform_conv_host.c; utf8 shims are listed in rust-hidden.txt; the
vendored uthash is excluded from clang-format.

Rebased again onto master after #82/#83/#87/#97/#89/#98/#88: oracle build.rs keeps
video_fourcc.c/task.c and drops the direct util/utf8.c (oracle/utf8.c already
compiles it under oracle_* names, which platform_conv_host.c and #82's
file_serializer_host.c use).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=44ac22e2f9bf9093f2a87bc1c0860393942c7f05 secs=31 lanes=lint:reused@9b0282a9e1c3,rust-test:reused@e3680ff66806,tier2-linux:run
Ci-Attestation: {"at":1791656844,"gate":"rust/all/fmt","host":"linux-x86_64","key":"9b0282a9e1c35c80eae0d4f0c7540b1c3b1c9f193daad522570bc7b20e609cdc","lane":"lint","parents":["07223a5abc85d40d9b7c016092ce37a672aca501"],"secs":null,"stamp":"ed3cee40895adfa7780a781e7ead1f4d","tree":"44ac22e2f9bf9093f2a87bc1c0860393942c7f05","v":1,"via":"reused"}
Ci-Attestation: {"at":1791656844,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"9b0282a9e1c35c80eae0d4f0c7540b1c3b1c9f193daad522570bc7b20e609cdc","lane":"lint","parents":["07223a5abc85d40d9b7c016092ce37a672aca501"],"secs":null,"stamp":"9bde047cbb6c054fa18fa8143826c0c7","tree":"44ac22e2f9bf9093f2a87bc1c0860393942c7f05","v":1,"via":"reused"}
Ci-Attestation: {"at":1791656844,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"e3680ff66806191a1385606c7996530d1becc162ef5a3444eeefce614a7d0c02","lane":"rust-test","parents":["07223a5abc85d40d9b7c016092ce37a672aca501"],"secs":null,"stamp":"46cf777b2d672af2f62536e2d4132bf2","tree":"44ac22e2f9bf9093f2a87bc1c0860393942c7f05","v":1,"via":"reused"}
Ci-Attestation: {"at":1791657116,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"99939507781ddefb1aa7855e1a0c9b4af9092524f38999d7db36a74a20f1ccce","lane":"tier2-linux","parents":["07223a5abc85d40d9b7c016092ce37a672aca501"],"secs":31,"stamp":"8164638665d4208fabc4b0a768fbc870","tree":"44ac22e2f9bf9093f2a87bc1c0860393942c7f05","v":1,"via":"run"}
zackees added a commit that referenced this pull request Oct 10, 2026
…43)

Phase 3 ports of libobs/util into the obs-util crate, each with a safe
core, a C ABI shim, Tier 1 tests, a layout test where a struct crosses
the ABI, and a proptest parity suite against the original C built as an
oracle. ENABLE_RUST_LIBOBS=ON drops the matching C sources from libobs.

- utf8: hidden and non-Windows only (Windows keeps the C utf8.c).
- lexer.c: follows master's C, including the #48 strref ordering.
- text-lookup: no longer crashes on an opening quote at end of line;
  the shim returns false for a NULL lookup.
- dstr: follows master's #46/#47 fixes; strlist_split takes a NUL
  separator. Wide-char and printf helpers stay in dstr-libc.c.
- bmem: Windows _aligned_* branch and the allocation counter.

The oracle vendors uthash 2.3.0 (BSD-1-Clause) for text-lookup.c, since
the Rust test runners have no uthash package.

Refs #43

Rebased onto master after #61 (base), #66 (file-serializer) and #85 (real
utf8.c in the oracle): the oracle's utf8.c/platform_conv_host.c now use
oracle_* utf8 names so they no longer clash with the Rust shims; the
dstr-conversion oracle test moved to obs-util and calls oracle_dstr_*;
duplicate bcrash/os_fopen/bmemdup/os_*_ptr stand-ins were dropped in favour
of master's base-variadic.c, file_serializer_host.c and
platform_conv_host.c; utf8 shims are listed in rust-hidden.txt; the
vendored uthash is excluded from clang-format.

Rebased again onto master after #82/#83/#87/#97/#89/#98/#88/#105: oracle build.rs keeps
video_fourcc.c/task.c and drops the direct util/utf8.c (oracle/utf8.c already
compiles it under oracle_* names, which platform_conv_host.c and #82's
file_serializer_host.c use).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=58f2156a689831720a1e6ad9004041e400917579 secs=135 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791658556,"gate":"rust/all/fmt","host":"linux-x86_64","key":"e533312cff231c50944045005e90c2b48ce1920b317c9037a705bfda5b49ef4c","lane":"lint","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":17,"stamp":"a33efc3cd6c98f3fbd2fa57e9a61a281","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"}
Ci-Attestation: {"at":1791658556,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"e533312cff231c50944045005e90c2b48ce1920b317c9037a705bfda5b49ef4c","lane":"lint","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":17,"stamp":"fb2d0a58bcefb05085a4b512fc916740","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"}
Ci-Attestation: {"at":1791658556,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"1a00cb7a8eb7b67b33a108e748711133d604e544b254813435cc1ca5ea24cd26","lane":"rust-test","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":22,"stamp":"d80b75173a27c995da2676193fa36904","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"}
Ci-Attestation: {"at":1791658556,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"a950373231b455174e5c031fe578e1e48c61e04f0387195a7ddc0e265e371e15","lane":"tier2-linux","parents":["930903b5e8c0cac6cec54edd05abeaacb825637c"],"secs":96,"stamp":"f1c2d81609277e26492a5a3f3553cd9c","tree":"58f2156a689831720a1e6ad9004041e400917579","v":1,"via":"run"}
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.

2 participants