Skip to content

rust: Port the module list calls, step 1: extract them #4133

Closed

Description

@rdoupe

Unit

The public calls that fill the module lists, libobs/obs-module.c.h 224-310 on master (4a2d5ca), moved verbatim into a new live file libobs/obs-module-lists.c.h in the same unity group (core+). No Rust in this step; a later issue ports the file into rust/obs-core, beside module_paths, module_names and module_load_rules.

  • obs_log_loaded_modules (224-230, obs.h 538)
  • obs_module_add_source, _add_output, _add_encoder, _add_service (232-262, obs.h 559-568)
  • obs_find_module_file (264-270, obs.h 662) and obs_module_get_config_path (272-278, obs.h 690)
  • obs_add_module_path (280-292, obs.h 579)
  • obs_add_safe_module (294-301, obs.h 587) and obs_add_disabled_module (303-310, obs.h 669)

All are EXPORT and declared in obs.h, so nothing is renamed and no header is added. struct fail_info and get_plugin_info (312-317) stay with the load loop.

Phase and position

Phase 6 core migration (#444), the "obs.c private layouts" seam item. The extraction step of testing-policy.md ("Extracting a function before porting it"), then a seam over the core and module fields these calls touch, then the port. Tracking: #4.

Dependencies and existing tests

  • No dependencies. No open PR edits obs-module.c.h; the hotkey ports add their own lines to libobs.core+.h.c, which a rebase settles.
  • Existing tests: test_core_module_load (Linux only) pins the search paths, obs_find_module_file, obs_module_get_config_path, the safe and disabled list matching and obs_module_add_* on a disabled module; test_obs_core_info_characterization pins the NULL-module paths.
  • Not pinned anywhere: what obs_log_loaded_modules logs, and the list calls with no core. A portable characterization test test/cmocka/test_module_lists.c adds those (with a log handler that records lines), plus obs_module_add_*, the path calls and the list calls on a module made with obs_create_disabled_module, on every host.

Notes

Plan, one behaviour-neutral PR:

  1. Characterization test test_module_lists.c, registered in test/cmocka/build/test-graph.json (no Rust).
  2. Move 224-310 verbatim into libobs/obs-module-lists.c.h, included in libobs/build/libobs.core+.h.c ahead of obs-module.c.h (its locale loader calls obs_find_module_file; the obs.h declaration makes either order safe). naming.md's obs-core row names the new file. The exported symbol sets stay identical on the C, hybrid and C-reference builds; the move is checked against master's functions with a harness under gcc and clang, -O0 and -O2, and ASan/UBSan.

Characterized, not endorsed: obs_log_loaded_modules reads the core without checking it, so the test does not call it with no core; the port fixes that as an intentional difference.

Activity

  1. added
    enhancement
    port
    ready
    on Nov 9, 2026
  2. rdoupe commented on Nov 9, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: the extraction of the module list calls (obs-module.c.h 224-310 into obs-module-lists.c.h).

    1. Characterization test test/cmocka/test_module_lists.c (no Rust), in the test graph.
    2. Move the nine calls verbatim into libobs/obs-module-lists.c.h, in core+ ahead of obs-module.c.h, with the naming.md row. No change in behaviour; export sets identical on all three builds, checked with the move harness.

    Draft PR expected today.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 10, 2026
  4. zackees commented on Nov 18, 2026

    @zackees
    Member

    Landed on master in #4139 (643866b); verified the merge is an ancestor of origin/master and libobs/obs-module-lists.c.h exists there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementportready

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions