Skip to content

build(obs-c-oracle): link the cached libobs modules instead of recompiling libobs C #3263

Closed as not planned

Description

@zackees

Scope

When OBS_LIBOBS_MODULE_DIR is set, rust/obs-c-oracle/build.rs links libobs-mod-ported and libobs-mod-util and hashes the module-key manifest, replacing the FNV walk over all of libobs/ (build.rs:3-12). A plain cargo test keeps the cc fallback. Assert that the oracle-only flags match the module flags.

Acceptance criteria

A Rust-only port edit runs no oracle cc compiles, Tier 3 results are unchanged, and a plain cargo test still works.

RED then GREEN where a check applies; record before and after build times. Parent: #3256.

Activity

  1. added
    infra
    P2
    size:M
    on Oct 31, 2026
  2. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    /investigate
    Blocked by #3262 (it links the cached modules and hashes the module-key manifest that #3262 introduces).

  3. added
    needs-investigation
    on Oct 31, 2026
  4. zackees commented on Nov 1, 2026

    @zackees
    MemberAuthor

    Investigated before claiming. The proposed mechanism can't work, and the acceptance criterion already holds.

    Why the oracle can't link CMake's module archives: each of the 227 wrappers in rust/obs-c-oracle/oracle/ renames every global symbol with #define foo oracle_foo before it includes the original C (for example array_serializer.c → util/array-serializer.c.h), so the C links next to the Rust implementation of the same functions. libobs-mod-ported compiles those sources unrenamed. Linking it into the test binaries would collide with the Rust exports, and it would have none of the oracle_* entry points the Tier 3 tests call. Matching the rename set in CMake would mean a second, CMake-side copy of all 227 rename lists.

    Acceptance criterion "a Rust-only port edit runs no oracle cc compiles" already holds. I appended a line to rust/obs-output/src/interleave.rs and rebuilt obs-tests-core (soldr cargo test -p obs-data --test obs-tests-core --no-run -v). Cargo reports Fresh obs-c-oracle: no build-script rerun and no cc compile. The build script only reruns on oracle/, vendor/, libobs/ and two nvenc files (rerun-if-changed, build.rs:783-789).

    What's left is the cost the #3257 baseline measured: any libobs C edit reruns the script and recompiles the oracle (about 3.5 s, with cc's parallel feature on since #3255). Narrowing that would mean rerunning only for the wrappers whose include closure changed, which is a different change from this issue's.

    Proposal: close #3263 as not planned (the scope is infeasible, and the stated goal is met). If the 3.5 s per libobs edit matters, file a new sub-issue under #3256 for per-wrapper invalidation. I'll close it on the next tick unless someone objects.

  5. zackees commented on Nov 1, 2026

    @zackees
    MemberAuthor

    Closing as not planned, per the investigation above. The oracle's wrappers rename every symbol to oracle_*, so CMake's module archives can't stand in for them. The stated goal already holds: a Rust-only port edit leaves obs-c-oracle Fresh, with no cc compiles. Per-wrapper invalidation for libobs C edits (about 3.5 s) can be filed separately under #3256 if it's worth doing.

  6. moved this from Investigating to Done in obs-rust Multiviewon Nov 1, 2026
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

    P2infraneeds-investigationsize:M

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions