Skip to content

infra: Split shared registration lists into per-unit fragments - #168

Merged
zackees merged 2 commits into
masterfrom
infra/registration-fragments
Oct 11, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/registration-fragments

Conversation

@zackees

@zackees zackees commented Oct 10, 2026

Copy link
Copy Markdown
Member

Fixes #137

Every port appended to the same handful of lists, so each merge forced 2–4 rebases of the other open port PRs (#59, #76, #77, #78 this week). Shared endif() placement in test/cmocka/CMakeLists.txt also broke CMake nesting twice. This PR makes each list per-unit or derived.

RED: test: RED checks that shared registration lists are split per unit

  • New ci/test_registration.py structural checks. All 5 fail on master:
    • the oracle's .c files are globbed, not listed;
    • oracle modules live in files, and lib.rs is a sorted pub mod list;
    • test/cmocka includes tests.d/*.cmake;
    • validate.sh has no hand-kept object list;
    • rust-exports.d/ replaces rust-exports.txt.
  • rust/obs-util/tests/export_list.rs now reads fragments, and adds rust_exports_are_one_fragment_per_ffi_module: each FFI module with exported shims owns exactly one <crate>-<module>.txt listing exactly those shims. All 3 tests fail on master.

GREEN: infra: Split shared registration lists into per-unit fragments

Before After
libobs/cmake/rust-exports.txt (173 lines) rust-exports.d/<crate>-<ffi module>.txt: 26 fragments, globbed by rust.cmake for Windows /EXPORT, with a README
oracle build.rs: one .file() per wrapper, plus ~80 hand-listed headers compiles oracle/*.c (*_posix.c on Unix only) and watches libobs/ as a directory
oracle lib.rs: 22 inline modules, 996 lines src/<name>.rs per module; lib.rs is 30 sorted pub mod lines
test/cmocka/CMakeLists.txt appended per test new tests go in test/cmocka/tests.d/<test>.cmake, globbed (existing blocks untouched), with a README
validate.sh: hand-kept list of 8 objects that must not compile with Rust ON derived from the ENABLE_RUST_LIBOBS guards: 28 objects, matched under libobs.dir/

The derived list closes a coverage gap: the old list checked 8 of the 28 ported files. Matching under libobs.dir/ was needed because libobs also links deps/libcaption/src/utf8.c, which has the same file name as util/utf8.c.

Evidence

  • ci/test_registration.py 5/5 OK; export_list 3/3 OK.
  • Local gate: 28 ported objects checked; 47/47 cmocka tests with the Rust port OFF and ON; exports IDENTICAL (1752 symbols). Stamped.
  • The Windows /EXPORT path from the fragments is covered by this PR's Windows Rust Tests and Tier 2 jobs.

Behaviour-neutral: same sources, same exports.

Note for open port PRs (#120, #121): add a fragment rather than editing rust-exports.txt or appending to test/cmocka/CMakeLists.txt.

zackees and others added 2 commits October 10, 2026 16:49
Every port appended to the same lists (rust-exports.txt, the oracle's
build.rs and lib.rs, test/cmocka/CMakeLists.txt, validate.sh's object
list), so concurrent port PRs conflicted on every merge. New structural
checks (ci/test_registration.py) and export_list.rs now expect
rust-exports.d/<crate>-<ffi module>.txt fragments, a globbed oracle,
file-based oracle modules, tests.d/*.cmake test fragments and a derived
Tier 2 object list. All fail on the current layout.

Refs #137

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every port appended to the same lists, so each merge forced 2-4 rebases
of the other open port PRs. Make each list per unit or derived:

- libobs/cmake/rust-exports.txt becomes rust-exports.d/<crate>-<ffi
  module>.txt, one fragment per FFI module, globbed by rust.cmake.
  export_list.rs checks each fragment against its module's shims.
- The oracle's build.rs compiles oracle/*.c (*_posix.c on Unix only)
  instead of listing each file, and watches libobs/ as a directory
  instead of a hand-kept header list.
- The oracle's inline modules move to src/<name>.rs; lib.rs is a sorted
  list of pub mod lines.
- test/cmocka/CMakeLists.txt includes tests.d/*.cmake, so a new test is a
  new file.
- validate.sh derives the objects that must not be compiled with
  ENABLE_RUST_LIBOBS=ON from the CMake guards. The hand-kept list covered
  8 of the 28 ported files.

Behaviour-neutral: same sources, same exports OFF and ON.

Refs #137

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Local-Gate: v1 tree=474fd82a6deb1861ca6e034be2148bcbf121a3f3 secs=132 lanes=lint:run,rust-test:run,tier2-linux:run
Ci-Attestation: {"at":1791676558,"gate":"rust/all/fmt","host":"linux-x86_64","key":"1f368adb6145ea029f729cf70d334c9160864c703621781309a57bc6d5c0b978","lane":"lint","parents":["41de2a3de432889f723ff6e0775c14ccfb05abdc"],"secs":64,"stamp":"899225ea9f729a3c0c6e439123727a5f","tree":"474fd82a6deb1861ca6e034be2148bcbf121a3f3","v":1,"via":"run"}
Ci-Attestation: {"at":1791676558,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"1f368adb6145ea029f729cf70d334c9160864c703621781309a57bc6d5c0b978","lane":"lint","parents":["41de2a3de432889f723ff6e0775c14ccfb05abdc"],"secs":64,"stamp":"8233d168913e0147e94f0eb53e3ee86a","tree":"474fd82a6deb1861ca6e034be2148bcbf121a3f3","v":1,"via":"run"}
Ci-Attestation: {"at":1791676558,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"8a10a6c658cf836e786151b0d96dc451404a61d37de2435634376e16d6ca04ef","lane":"rust-test","parents":["41de2a3de432889f723ff6e0775c14ccfb05abdc"],"secs":31,"stamp":"4e4abccc614a18300d26e5ac7f399b97","tree":"474fd82a6deb1861ca6e034be2148bcbf121a3f3","v":1,"via":"run"}
Ci-Attestation: {"at":1791676558,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"ad38322f01e9037c0652eb6ee9191734df8d97e23c15ce02397fa89298d88c61","lane":"tier2-linux","parents":["41de2a3de432889f723ff6e0775c14ccfb05abdc"],"secs":37,"stamp":"11ac3941c411fdbe14ac5868abe34570","tree":"474fd82a6deb1861ca6e034be2148bcbf121a3f3","v":1,"via":"run"}
@zackees
zackees merged commit 29e2dfa into master Oct 11, 2026
20 checks passed
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 11, 2026
Follows obs-rust#168: one fragment per test in
test/cmocka/tests.d/ instead of an appended block in CMakeLists.txt, so
concurrent test additions do not conflict. The ASan flags are preserved.
chriscoveries pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 11, 2026
Follows obs-rust#168: one fragment per test in
test/cmocka/tests.d/ instead of an appended block in CMakeLists.txt. The
ASan flags are preserved.
zackees pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 11, 2026
Follows obs-rust#168: one fragment per test in
test/cmocka/tests.d/ instead of an appended block in CMakeLists.txt. The
ASan flags are preserved.
zackees pushed a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 11, 2026
Follows obs-rust#168: one fragment per test in
test/cmocka/tests.d/ instead of an appended block in CMakeLists.txt, so
concurrent test additions do not conflict. The ASan flags are preserved.
@zackees
zackees deleted the infra/registration-fragments branch October 26, 2026 15:45
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.

infra: Split shared registration lists into per-unit fragments

1 participant