Skip to content

rust: Port the module list calls (obs-module-lists.c) #4465

Closed

Description

@rdoupe

Unit

libobs/obs-module-lists.c.h (live C in libobs.core+) to rust/obs-core, new module module_lists: the ten module list calls, all EXPORT in obs.h and kept under their names.

  • obs_log_loaded_modules;
  • obs_module_add_source, obs_module_add_output, obs_module_add_encoder and obs_module_add_service;
  • obs_find_module_file and obs_module_get_config_path;
  • obs_add_module_path;
  • obs_add_safe_module and obs_add_disabled_module.

Phase and position

Phase 6 (libobs core), tracker #444; tracking issue #4. The third of three steps for the module list calls: after their extraction (#4133, merged as #4139) and the module list seam (#4219, merged as #4288), beside the module rules that are already Rust (module_paths, module_names, module_load_rules).

Dependencies and existing tests

Notes

  • Every field and list goes through the seam (obs-module-lists-seam.h); the shim never mirrors struct obs_core or struct obs_module. It does mirror struct obs_module_path (with a layout test) for the module_paths push.
  • The lists own their strings, and free_module and the core's shutdown free them with bfree, so the shim copies with bstrdup and pushes with darray_push_back, never with Rust's allocator.
  • obs_module_add_source(module, NULL) pushes a NULL entry today; that stays.
  • None of the calls takes a lock today; the port adds none.
  • One intentional difference: obs_log_loaded_modules reads obs->first_module without checking obs, while the calls beside it check it, so a frontend or script that calls it before obs_startup or after obs_shutdown crashes on a NULL read. The port returns without logging when there is no core. It is listed in the Tier 3 test and in rust/README.md, and the parity test leaves out exactly that input.

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: the port of the module list calls (libobs/obs-module-lists.c.h) to rust/obs-core, new module module_lists.

    1. RED: Tier 1 tests in rust/obs-core/tests/obs_core/module_lists.rs against a todo!() core: test_module_lists' assertions 1:1 over a model core, the NULL cases, and the call with no core.
    2. GREEN: the safe core, calling the module_paths and module_names cores directly.
    3. The exported C shims through the module list seam (libobs: Add the module list seam #4288), copying with bstrdup and pushing with darray_push_back, with a layout test for struct obs_module_path.
    4. Tier 3: the original file over the seam and a stand-in core against the shims, comparing every list, the returned paths and the log lines; the no-core log call is the one listed difference.
    5. Move obs-module-lists.c.h from libobs.core+ into its own ported group, and run the Tier 2 tests on the C, hybrid and C reference builds, with identical export sets.
    6. Docs, and the difference recorded on the tracking issue.

    The encoder registration's short-structure caps read was checked as part of this batch: it is already covered by test_encoder_short_scaling_caps (test_register_short_info.c) and test_encoder_sizes (module_register_copy), so no issue is filed for it.

    Draft PR expected today.

  3. rdoupe commented on Nov 10, 2026

    @rdoupe
    CollaboratorAuthor

    Fixed by the PR that ports the module list calls to rust/obs-core (#4467), merged through the merge queue. All ten calls (obs_log_loaded_modules, the four obs_module_add_*, obs_find_module_file, obs_module_get_config_path, obs_add_module_path, obs_add_safe_module, obs_add_disabled_module) now run in Rust in hybrid libobs; obs-module-lists.c.h moved into its own ported group and the C reference keeps the C.

    Left: nothing for this unit. The one intentional difference (obs_log_loaded_modules() returns without logging when there is no core, where the C crashed) is in the parity test header, rust/README.md and the Phase 6 tracking issue (#444). No follow-up issue is needed.

  4. moved this from In progress to Done in obs-rust Multiviewon Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementportready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions