Repository navigation
Open
8 / 98 of 9 issues completedOpen
8 / 98 of 9 issues completed
Copy link
Labels
trackerTracks work in sub-issues or a checklist; not claimable itself
Description
Goal (maintainer, 2026-10-31)
Refactor the libobs build into decentralized lib-modules. Each module is stored in an artifact cache keyed by its content, so code is not recompiled when nothing in that module changed. All modules are then relinked into libobs, and the public C ABI and export set stay unchanged.
Current state
- C build: one
libobs-objectsOBJECT library (libobs/cmake/implementation.cmake:10-11) holds the 194LIBOBS_SOURCES, fed by 166 unity groups inlibobs/build/(source-sets.json,ported-source-sets/*.json). Ported C (108 sources) is compiled only forlibobs-c-reference. - Rust: a Corrosion release staticlib, linked whole-archive (
libobs/cmake/rust.cmake:20-35), with the export map, Windows list and macOS unexport list inrust-os-*.cmake. - zccache already content-caches every translation unit. So the costs that remain are:
- A shared precompiled header. Every core group shares
libobs/build/libobs.pch.h(BUILD.md rule 2), so one header edit rebuilds nearly all of libobs. - The oracle compiles libobs a third time.
rust/obs-c-oracle/build.rs:3-12hashes all oflibobs/and re-runsccover libobs C on any edit, sharing nothing with CMake. - Configure, Corrosion and link run every time. Warm and edited-input rebuilds take about 6 s wall for 0.6 s of CPU (
docs/rust-port/benchmarks/hybrid-build-2026-10-20.json).
- A shared precompiled header. Every core group shares
- CI saves zccache only on master (
docs/ci-tooling.md:243-250).
Target
- Modules:
libobs-mod-<name>static libraries along the existing group families: util, core, graphics, media, platform-, ported, rust-shims. They share onelibobs-headersINTERFACE for flags and each has its own narrowed precompiled header. - Keys: each module's key hashes its sources, its depfile include closure, normalised flags and the toolchain identity. Modules are restored from a module cache (local dir plus the existing
.github/actions/cache) as IMPORTED libraries, skipping compilation entirely. This reuses zccache/soldr; there is no new tool. - Relink: libobs links every module whole-archive plus the Rust staticlib, with the unchanged export map. A symbol diff runs on all three operating systems.
- Oracle: it links the cached
portedandutilmodules, and falls back toccfor plaincargo test.
Rules
- The public C ABI and export set are unchanged, verified by a symbol diff.
- BUILD.md unity and precompiled-header rules hold, and each group belongs to exactly one module.
- No new workflow files.
- Every sub-issue records before and after build times against the baseline from the first sub-issue.
Risks
- Static archives dropping registration objects: whole-archive is mandatory, backed by a module-load smoke test.
- Duplicate symbols: a group in two modules; the checker in the manifest sub-issue guards this.
- Visibility and
IS_LIBOBS: these stay onlibobs-headersonly. - LTO/IPO (perf: build: enable IPO for the shipped RelWithDebInfo C build #3193): cached IR is tied to the compiler version, so the LTO mode goes into the key.
- Linkers: MSVC
/WHOLEARCHIVElink cost, ld64-force_loadwith the unexport list, and GNU ld archive order. - Generated headers:
obsconfig.hand the version object must be part of the key.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 9 sub-issues
Metadata
Metadata
Assignees
Labels
trackerTracks work in sub-issues or a checklist; not claimable itself
Type
Projects
- StatusShow more project fieldsTracker
Activity