Repository navigation
libobs: characterize and extract obs_add_data_path and obs_remove_data_path (Refs #5355) - #5577
Merged
Merged
Conversation
…ath, not yet registered (Refs #5355) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Refs #5355) Moves the process-global core_module_paths list and the two wrappers unchanged from obs.c.h into obs-data-paths.c.h, a member of the core unity group included before obs.c.h, so obs_find_data_file() still reads the same static list. Registers test_data_paths in the canonical test graph so it runs against hybrid libobs and the C reference. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795526655,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":93,"stamp":"2a3ef02a26f5236e17e93d7195de63e6","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526655,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":93,"stamp":"75e453513d44f43f697eaab0aff1f06b","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526655,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":93,"stamp":"39d9440402fefc58abf7ea525f6ab95e","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526655,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":93,"stamp":"b7517bc3ed1f103f730e37eddc3d4bc6","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"general/all/client-lint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"b8a214c0362525626a97ad5a2234be2d","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526655,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":93,"stamp":"870df8376cd0c55d6da788db363c71fd","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"66dcca7eeb311e24ae2e180e7888100a","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"61104bbf9eb865fbb9b37d25111cb495","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"9a712a574b1757fc6ee16f0f6d84120b","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"f526ce976786a7a52d0558b2b2e9d6aa","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"5eeecbe05eeccc5bf2cb143ec9ee5013","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"117d0ab8037d4cf9595fe369c2ec8077","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"d431629b3f43ee87f09f49089cba81f5","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"05ad8eee3d3f90ae33198672443ca146","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"c2ef6224425a6397922f7754f1503630","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"7a2d0e8ec24b5d22adcb439f226241b2","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"9378f39501abbd6ff204383cc453e34a","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526560,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"a023301cc017c8ce1be2d8a7695e0eaa399b0ca13ecc2e7051d10bebc16f02cd","lane":"client-lint","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":11,"stamp":"a1de4d9516c568f74105def2c1dfdd72","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Ci-Attestation: {"at":1795526873,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"c56176165a3f02ab2b5455cdde4df301ace5191f2ec67614994633257a23663f","lane":"client-test-x86_64-unknown-linux-gnu","parents":["95af88398fe6b7d950cc884ede44f297fde2eea7"],"secs":218,"stamp":"64e010c648236c5b2b51c70b37887b7f","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262","v":1,"via":"run"} Client-Checks: {"checks":{"base":"aeda985619aa24a388082db53253b2d1e3dbcf9f","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/obs-data-paths.c.h","libobs/obs.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_data_paths.c","test/cmocka/tests.d/test_data_paths.cmake"],"head":"8f52032bb7edb511fdfec101513716bdf314869f","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.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-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"e5aa979f99e8bf40cc7851d4087f361c1badfcbfb7131a391e12b397576ca46f","tree":"f2b0d444b012ba319f68dad361b2d6f261ef5262"}}
This was referenced Nov 24, 2026
Collaborator
Author
This was referenced Nov 24, 2026
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.
Adds a C characterization of
obs_add_data_path()andobs_remove_data_path(), the deprecated public wrappers around the process-global list of extra data directories thatobs_find_data_file()searches, then moves them verbatim fromlibobs/obs.c.hintolibobs/obs-data-paths.c.h, a member of the core unity group (libobs/build/libobs.core+.h.c, alphabetical). The staticcore_module_pathslist moves with them; the new file is included beforeobs.c.h, soobs_find_data_file()still reads the same single list.test_data_pathsis registered once in the canonical test graph with itstests.dmarker. No behavior change; existing C tests (test_core_setup_rules_steps,test_obs_core_info_characterization) and public headers are unchanged.Refs #5355. This is the C-only prerequisite of the Rust swap in #5397.
What the test pins
Public API only, so it runs against hybrid libobs and the C reference:
obs_startup(), and entries added before startup or while the core runs surviveobs_startup()andobs_shutdown(); the list still works after shutdown;obs_add_data_path()copies the caller's bytes: changing a heap buffer or zeroing a stack buffer afterwards changes nothing;./prefix, prefixes of the path don't match);""are the same path (either adds an entry the other removes), and an empty entry never matches a real path;obs_find_data_file()returns A's file, then B's after oneremove(A)(it would still be A's if the last A were removed), then A's again afterremove(B); a re-added B goes after A.On macOS
obs_find_data_file()returns the framework Resources path for any name, so the order case skips there (as intest_obs_core_info_characterization). The lifecycle case skips only whenobs_startup()fails with no display set.Evidence
95af88398): adds the characterization without registering it, as in libobs: characterize and extract obs_save_sources_filtered and obs_save_sources (Refs #5564) #5566.git show 95af88398:test/cmocka/build/test-graph.json | grep -c test_data_pathsprints0, so the build has notest_data_pathstarget, andlibobs/obs-data-paths.c.hdoes not exist there.9062884b0): registers the test and extracts the list and both wrappers. The new file's body after its 2-line header is lines 1128-1131 and 1153-1173 oforigin/master'sobs.c.h, byte for byte (diff <(git show origin/master:libobs/obs.c.h | sed -n '1128,1131p;1153,1173p') <(tail -n +3 libobs/obs-data-paths.c.h)prints nothing).OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 3 --tests test_data_paths: full Linux Tier 2 passed against the C reference and hybrid libobs (100% tests passed, 0 tests failed out of 1096each), thentest_data_pathspassed 3 repeats against each.docker run --init,xvfb-run -a):[ PASSED ] 7 test(s)against hybrid libobs and again withLD_LIBRARY_PATH=/build/tree/libobs-c-reference(lddconfirmed the C reference), nothing skipped.obs_remove_data_path()'s loop reversed (removing the last equal entry instead of the first) and both libraries rebuilt in the kept volume,test_remove_keeps_order_of_the_restfailed against each (97 != 98: A's file found where B's was expected;[ FAILED ] tests: 1 test(s), both libraries). After reverting, all 7 passed../lintpassed.Not run locally: native Windows/macOS. Tier 1/3 and Tier 4 do not apply to a C-only extraction. No
docs/features.mdline: nothing a user can notice changes.🤖 Generated with Claude Code