Repository navigation
libobs: Extract the module list calls - #4139
Merged
Merged
Conversation
Pin what obs_log_loaded_modules() logs, the list calls with no core and with NULL arguments, and obs_module_add_*(), obs_find_module_file() and obs_module_get_config_path() on a module made with obs_create_disabled_module(), on every host. The Linux-only test_core_module_load already pins the search paths and how the safe and disabled lists match names during a load. It runs through the public API only, so the same test covers the hybrid libobs and libobs-c-reference once these calls are ported. Refs #4133.
Move obs_log_loaded_modules(), obs_module_add_source(), _add_output(), _add_encoder(), _add_service(), obs_find_module_file(), obs_module_get_config_path(), obs_add_module_path(), obs_add_safe_module() and obs_add_disabled_module() verbatim from obs-module.c.h into obs-module-lists.c.h, in the same core unity group ahead of obs-module.c.h, so they can be ported on their own. No change in behaviour: all ten are EXPORT and declared in obs.h, the text is byte for byte master's, and the exported symbol sets are the same on the C, hybrid and C reference builds. Refs #4133.
This was referenced Nov 9, 2026
This was referenced Nov 10, 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.
Refs #4133
What and why
The first step of porting the module list calls to
rust/obs-core: the public calls that fill the module lists move out oflibobs/obs-module.c.hinto their own live file, so a later PR can port that file whole, beside the module path, name and load rules that are already Rust (module_paths,module_names,module_load_rules). This is the extraction step of testing-policy.md ("Extracting a function before porting it"), behaviour-neutral, with no Rust.test/cmocka/test_module_lists.c(in the test graph, all hosts) pins what nothing pinned yet: the linesobs_log_loaded_modules()logs (only its heading atLOG_INFOwith no module loaded; a disabled module adds no line), the list calls with no core and with NULL arguments (nothing allocated), andobs_module_add_*(),obs_find_module_file()andobs_module_get_config_path()on a module made withobs_create_disabled_module(): each id copied into its own kind's list only, the data-path and config-path answers, and the allocations each call makes. The Linux-onlytest_core_module_loadalready pins the search paths and how the safe and disabled lists match names during a load. Characterized, not endorsed: a NULL id is pushed as a NULL entry, andobs_module_get_config_path(mod, NULL)gives the config directory with a trailing/.obs_log_loaded_modules()is not called with no core: it reads the core without checking it. The port fixes that as an intentional difference.obs_log_loaded_modules,obs_module_add_source,_add_output,_add_encoder,_add_service,obs_find_module_file,obs_module_get_config_path,obs_add_module_path,obs_add_safe_moduleandobs_add_disabled_module(master'sobs-module.c.h224-310) move byte for byte intolibobs/obs-module-lists.c.h, included in thecore+unity group ahead ofobs-module.c.h(whose locale loader callsobs_find_module_file; theobs.hdeclarations make either order safe). All ten areEXPORTand declared inobs.h, so nothing is renamed and no header is added.struct fail_infoandget_plugin_infostay with the load loop. naming.md'sobs-corerow names the new file.No change in behaviour, so no features-ledger line. No upstream issue.
RED → GREEN
test_module_lists: 8/8 on the C build, hybrid libobs and libobs-c-reference, before and after the move. A planted mutant in the real file (obs_add_module_pathwithout its!datacheck) fails it atadd_list_entries.test_module_lists,test_core_module_load,test_obs_core_info_characterization,test_module_failure_info,test_module_load_rules_skip_steps,test_module_load_steps,test_module_locale_getters,test_module_metadata,test_module_name_lookups,test_module_register_copy_steps,test_module_type_rules_steps,test_text_aa_file): 12/12 on each of the three builds, 0 skipped.bstrdup,blog, the two path rules), with gcc and clang at -O0, -O2 and -O1 under ASan/UBSan, over 20,000 random call sequences (502,081 logged events): identical logs on all six builds. Eight planted mutants (log format, wrong list, wrong path argument, dropped NULL check, path type, disabled-to-safe list, swapped config arguments, a NULL id skipped) are each caught on every build.T.--lane lintok,--test-diffok (7490 passed, 6 skipped),--lane dylintok,--lane crossok; Windows MSVCclippy --all-targetsclean../lintok../unittest: the workspace tests pass (7490 passed, 6 skipped; obs-util 914 passed), then itsx86_64-pc-windows-gnubuild ofobs-c-oraclestops on master's ownoutput_pause_queries.cmacro clash (bug: obs-c-oracle: pthread probe macro redefinition blocks Fast Gate #4069), so its Tier 2 lane did not run here and the head is pushed unstamped; PR CI runs the full suite. This PR changes no Rust or oracle file.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC (not applicable: no warning or flag change)