Skip to content

build(libobs): content-addressed module artifact cache #3262

Closed

Description

@zackees

Scope

Add ci/libobs_modules.py. It computes each module's key (BLAKE3 over its sources, depfile include closure, generated headers, normalised flags, compiler identity, triple, build type and LTO mode), restores modcache/<key>.a before the build and imports hits as IMPORTED libraries (-DOBS_LIBOBS_MODULE_CACHE=<dir>). On a miss it builds and stores. The default cache dir sits next to the zccache root.

Acceptance criteria

A fresh build directory with a warm cache builds libobs in at most 30% of the baseline cold wall time with zero C compiles, and changing one group rebuilds only its module.

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

Activity

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

    @zackees
    MemberAuthor

    /investigate
    Blocked by #3261 (cached .a files need static module archives to import) and #3257 (the 30% criterion needs the baseline).

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

    @zackees
    MemberAuthor

    Claiming: #3262 (stacked on #3318, which turns the modules into archives).

    Plan, one PR:

    1. RED: ci/test_libobs_modules_cache.py. Over the compile commands of a configured tree, a module's key must be the same for two build dirs, and must change only for the module whose group or included header changed. The CMake side must import a hit as an IMPORTED archive.
    2. GREEN: ci/libobs_modules.py:
      • key: per module, BLAKE3 over the module's group sources, their header closure (-M -MG, preprocessor only), the compile commands with the build dir normalised, and the compiler's --version.
      • restore: copies hits to <build>/libobs-modcache/ and writes hits.cmake.
      • store: copies the built archives of the misses.
      • libobs/cmake/modules.cmake: when OBS_LIBOBS_MODULE_CACHE is set, a hit becomes add_library(... STATIC IMPORTED) and its sources are not compiled.
    3. Before and after times: a fresh build dir with a warm cache, and a one-group edit.
  5. github-actions commented on Nov 1, 2026

    @github-actions

    Claim bot: @zackees, this can't be claimed yet: it needs investigation before anyone can implement it. Comment Claiming: investigation to take the research.

  6. zackees commented on Nov 1, 2026

    @zackees
    MemberAuthor

    Done in #3321: libobs modules are keyed by their normalised compile commands, header closure and compiler version, restored as imported archives, and stored with pruning. MSVC keying is not supported yet; #3264 wires the cache into CI.

  7. 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:L

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions