Skip to content

libobs: characterize and extract obs_add_data_path and obs_remove_data_path (Refs #5355) - #5577

Merged
rdoupe merged 2 commits into
masterfrom
test/5355-data-paths-extract
Nov 24, 2026
Merged

rdoupe merged 2 commits into
masterfrom
test/5355-data-paths-extract

Conversation

@rdoupe

@rdoupe rdoupe commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a C characterization of obs_add_data_path() and obs_remove_data_path(), the deprecated public wrappers around the process-global list of extra data directories that obs_find_data_file() searches, then moves them verbatim from libobs/obs.c.h into libobs/obs-data-paths.c.h, a member of the core unity group (libobs/build/libobs.core+.h.c, alphabetical). The static core_module_paths list moves with them; the new file is included before obs.c.h, so obs_find_data_file() still reads the same single list. test_data_paths is registered once in the canonical test graph with its tests.d marker. 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:

  • the list needs no core: add and remove work before obs_startup(), and entries added before startup or while the core runs survive obs_startup() and obs_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;
  • duplicates are kept, one remove each, and a remove with no match returns false;
  • matching is exact and case-sensitive, with no normalisation (trailing slash, ./ prefix, prefixes of the path don't match);
  • NULL and "" are the same path (either adds an entry the other removes), and an empty entry never matches a real path;
  • removal drops the first equal entry and keeps the rest in order: with A, B, A added and a probe file in both A and B, obs_find_data_file() returns A's file, then B's after one remove(A) (it would still be A's if the last A were removed), then A's again after remove(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 in test_obs_core_info_characterization). The lifecycle case skips only when obs_startup() fails with no display set.

Evidence

  • RED (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_paths prints 0, so the build has no test_data_paths target, and libobs/obs-data-paths.c.h does not exist there.
  • GREEN (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 of origin/master's obs.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 1096 each), then test_data_paths passed 3 repeats against each.
  • To prove the cases ran rather than skipped, I ran the built binary from the kept build volume (docker run --init, xvfb-run -a): [ PASSED ] 7 test(s) against hybrid libobs and again with LD_LIBRARY_PATH=/build/tree/libobs-c-reference (ldd confirmed the C reference), nothing skipped.
  • Mutation check: with 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_rest failed 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.
  • ./lint passed.

Not run locally: native Windows/macOS. Tier 1/3 and Tier 4 do not apply to a C-only extraction. No docs/features.md line: nothing a user can notice changes.

🤖 Generated with Claude Code

rdoupe and others added 2 commits November 24, 2026 08:22
…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"}}
@rdoupe
rdoupe requested a review from zackees as a code owner November 24, 2026 13:28
@rdoupe rdoupe changed the title libobs: extract obs_add_data_path and obs_remove_data_path verbatim (Refs #5355) libobs: characterize and extract obs_add_data_path and obs_remove_data_path (Refs #5355) Nov 24, 2026
@rdoupe

rdoupe commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Tier 2 Linux failed before any test ran: the build pinned pipewire-pulse 1.6.2-1ubuntu1.2 from a mirror that hadn't yet synced Ubuntu's 1.3 update, and the test container couldn't find 1.2 (#5579, fix queued in #5581). The mirrors have synced since, so I reran the whole run so the build re-pins.

@obs-rust-project-manager obs-rust-project-manager Bot moved this to Ready to merge in obs-rust Multiview Nov 24, 2026
@rdoupe
rdoupe added this pull request to the merge queue Nov 24, 2026
Merged via the queue into master with commit e729c3f Nov 24, 2026
86 of 89 checks passed
@rdoupe
rdoupe deleted the test/5355-data-paths-extract branch November 24, 2026 16:18
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Ready to merge to Done in obs-rust Multiview Nov 25, 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