Repository navigation
obs-data: Port libobs/obs-data.c - #801
Merged
Merged
Conversation
Member
|
CI on glibc only declares these with |
nathan-v
force-pushed
the
port/obs-data
branch
from
October 15, 2026 06:44
ba3287f to
207d26f
Compare
Member
|
I'll land it through the queue once CI is green. |
nathan-v
force-pushed
the
port/obs-data
branch
from
October 15, 2026 08:05
207d26f to
04afd79
Compare
Tier 1 and the in-memory parity tests panic in Data::new and Data::from_json. soldr cargo test -p obs-data reports 9 failed in tests/obs_data.rs and 4 failed in tests/parity.rs. The layout test passes. Refs obs-rust#784 Refs obs-rust#444
The safe core and the C shims replace obs-data.c when ENABLE_RUST_LIBOBS is on. JSON text still comes from jansson 2.14 with the same flags. soldr cargo test -p obs-data passes, including the oracle parity tests. A get_int of 1.5 fails the scalar test if it rounds instead of truncating toward zero. Refs obs-rust#784 Refs obs-rust#444
Rust Tests failed on all three hosts. rustfmt wants data_ffi between codec_ffi and graphics_ffi. On Windows the lib test harness links the no_mangle shims, and nothing in that harness referenced the oracle or obs-util, so jansson, blog, the os_quick_* helpers, bfree, os_file_exists and os_rename were undefined. The integration tests already pull those crates in.
glibc hides PTHREAD_MUTEX_RECURSIVE unless _GNU_SOURCE is set before obs-data.c includes util/threading.h. The oracle wrapper now defines it, the same way base.c and task.c do. obs_data_json_decref is the jansson glue. Hide it in the ELF version script and the macOS unexport list so the Tier 2 symbol diff stays empty. On Ubuntu, GNU ld --as-needed drops the first -ljansson because the json_* references live in the Rust staticlib, which is linked after that library. Every cmocka executable then fails. Link jansson again after the archive.
The windows-gnu probe compiles vendored jansson with this header
first. __int64 is an MSVC keyword, and MinGW has not defined it
yet, so the ssize_t typedef fails. MSVC still uses __int64.
MinGW gets ssize_t from its own headers.
Local-Gate: v1 tree=1e0d1ebc42540b4d58d9f10042ececb0ed1018f0 secs=1640 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run
Ci-Attestation: {"at":1792067595,"gate":"rust/all/fmt","host":"linux-x86_64","key":"392c52b2828470fa6e6ed71abbcacb73f0e96cc6c4088a7ded7a3d93825aaf29","lane":"lint","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":55,"stamp":"b5be4c0a9f8d91bbba202a955cfe88dd","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"392c52b2828470fa6e6ed71abbcacb73f0e96cc6c4088a7ded7a3d93825aaf29","lane":"lint","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":55,"stamp":"7faa5ac02ace7b8ed49c55e9447c6198","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"b439b6bb8e93d470e14a03d649bc23f7eaf68584c1ca2d2ea0ae5f94c9c3850e","lane":"rust-test","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":128,"stamp":"0f9c18a82ffed70324eed5b86ac698dd","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"ab678a7180dcb94814b99979da516000b7c5ef3a99bec31bcafe71005b209895","lane":"cross","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":123,"stamp":"9adba49c61fa5e1b6405103bba1d72a1","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"ab678a7180dcb94814b99979da516000b7c5ef3a99bec31bcafe71005b209895","lane":"cross","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":123,"stamp":"f541a0355c8412196b161665f53d47a9","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"ab678a7180dcb94814b99979da516000b7c5ef3a99bec31bcafe71005b209895","lane":"cross","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":123,"stamp":"d6f7ff4cbb94bb20cf3057f41c624af6","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"ab678a7180dcb94814b99979da516000b7c5ef3a99bec31bcafe71005b209895","lane":"cross","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":123,"stamp":"1d2575b4ef19d46c958fcea2694e54f9","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"ab678a7180dcb94814b99979da516000b7c5ef3a99bec31bcafe71005b209895","lane":"cross","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":123,"stamp":"3dfbc45c13134b68c75c5ca15c6c409b","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"ab678a7180dcb94814b99979da516000b7c5ef3a99bec31bcafe71005b209895","lane":"cross","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":123,"stamp":"88ca004c95f7cabf5f7f9643b7554536","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Ci-Attestation: {"at":1792067595,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"a5cb0863f2983715d83c7defd3929baad8142dee91d2a6b64512b28652907a24","lane":"tier2-linux","parents":["9787ef86f09b0a28c702f9eae176b837dcc23d95"],"secs":1333,"stamp":"3747f6990b23cda2d2ebed5e30331c42","tree":"1e0d1ebc42540b4d58d9f10042ececb0ed1018f0","v":1,"via":"run"}
Member
zackees
force-pushed
the
port/obs-data
branch
from
October 15, 2026 12:33
04afd79 to
fe82240
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #784
Refs #444
What and why
Ports
libobs/obs-data.cinto theobs-datacrate.ENABLE_RUST_LIBOBSdrops the C file.obs-data.his unchanged, andobs_data_newrefstays inline there. JSON text still comes from jansson 2.14, withJSON_REJECT_DUPLICATESon load andJSON_PRESERVE_ORDERplus compact or indent 4 on dump.Item pointers stay stable across set. C may realloc the item. A user value left in place when
set_autoselectchanges the type stays unread by the new type's getters, which return the empty value. The safe core replaces a file by removing the destination and renaming, and it does not log. The C shim callsos_quick_write_utf8_fileandos_quick_write_utf8_file_safe. A null name, or a null vec out-pointer, does nothing.RED → GREEN
4b1760d05.soldr cargo test -p obs-datapanics inData::newandData::from_json. 9 failed intests/obs_data.rs, 4 failed intests/parity.rs. The layout test passes.0673c0795.soldr cargo test -p obs-datapasses (9 Tier 1, 4 parity, 1 layout).soldr cargo clippy -p obs-data --all-targets -- -D warningsis clean.soldr cargo test -p obs-util --test export_listpasses. Rounding 1.5 instead of truncating toward zero failstest_scalars_and_json(got 2, wanted 1). Tier 2test_obs_datais 8/8 withENABLE_RUST_LIBOBSOFF and ON, local Xcode RelWithDebInfo. The ON link dropsobs-data.o. linux-validate was not run.Checklist
masterci-fulllabel. The oracle build suppresses-Wdeprecated-declarationssoobs-data.c's own autoselect calls compile, and the wrapper pragma covers-Wsign-conversionand-Wdouble-promotionin that file.tests/parity.rsandrust/README.md