Skip to content

libobs: Extract module initialization before its Rust port - #4166

Merged
zackees merged 1 commit into
masterfrom
port/4160-module-init-extract
Nov 9, 2026
Merged

zackees merged 1 commit into
masterfrom
port/4160-module-init-extract

Conversation

@zackees

@zackees zackees commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Refs #4160

obs_init_module still lives inside the large module loader, so replacing it with Rust requires first separating the C unit. This prerequisite moves its body byte-for-byte to libobs/obs-module-init.c.h, registers it in the existing core unity group, and records its target crate in the naming table. The same loadingModule global is defined beside the initializer and declared externally for the registration callers. No behavior, ABI, public header, existing C test, Rust code, or module-list call changes.

This is the separate behavior-neutral extraction required by the testing policy. RED/GREEN Rust commits belong to follow-up #4164 after this prerequisite lands. Existing test_core_module_load calls the initializer and checks registration ownership for source, output, encoder and service types.

Validation: full lint passed, including the build-group checks; workspace formatting passed using a matching soldr verdict. The original and extracted function bodies are byte-identical. Both bodies passed focused GCC and Clang harnesses at O0 and O2 with AddressSanitizer and UndefinedBehaviorSanitizer (eight runs). The harness covers missing module/core, already-loaded early return, success, failure and retry, callback loading-module identity and reset, profiling and warning arguments. This harness uses stand-ins and does not replace Tier 2 validation. The unchanged C tests against hybrid and C-reference libobs and exported-symbol parity were not run locally; PR CI supplies those checks. No new Rust test binary or test-graph change.

Claim accepted on #4160 for pool im-module, slot obs-studio10. No user-visible change or features-ledger update. The lane remains partly unported; the module-name and whole-field-size wrappers are false gaps, and module-list work is excluded.

Refs #4160. Move obs_init_module verbatim into its own implementation file in the existing core unity group. Retain loadingModule as the same global, with its definition beside the initializer and an extern declaration for the registration callers. Rust swap follows in #4164.
@zackees
zackees enabled auto-merge November 9, 2026 07:55
@zackees
zackees added this pull request to the merge queue Nov 9, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Nov 9, 2026
@zackees
zackees merged commit 3497a22 into master Nov 9, 2026
117 of 123 checks passed
@zackees
zackees deleted the port/4160-module-init-extract branch November 9, 2026 18:03
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to Done in obs-rust Multiview Nov 9, 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