Skip to content

build(obs-c-oracle): compile the oracle's C in parallel (cc 'parallel' feature is off) #3253

Closed

Description

@zackees

What

rust/obs-c-oracle/build.rs compiles more than 225 C translation units: 217 files under oracle/, plus jansson and libobs sources pulled in by the wrappers. It does this through cc::Build::compile() without the cc crate's parallel feature. rust/obs-c-oracle/Cargo.toml:15 declares cc = { workspace = true, default-features = true }, and cc's defaults are empty. Only rust/obs-build/Cargo.toml:19 enables parallel.

Feature unification doesn't save it either. In soldr cargo tree -p obs-c-oracle -e features,build -i cc, and the same for -p obs-data, cc has only feature "default". So whenever the oracle archive misses the cache, every C file compiles in series.

The build script reruns on any change under libobs/ (build.rs:783-789 watches it recursively), which includes switching branches. A warm rebuild with zccache hits takes about 21 s for 225 objects. A cold one runs file after file, and on a loaded box it ran for tens of minutes (a 2026-10-31 local soldr cargo test -p obs-data --test obs-tests-core run spent more than 37 minutes inside this build script).

Proposed change

Enable features = ["parallel"] for the cc build-dependency of obs-c-oracle, and of every other crate whose build script compiles C (obs-data has a cc build-dependency too). Or enable it once in [workspace.dependencies]. cc then respects the cargo jobserver, so it doesn't oversubscribe.

Acceptance criteria

  • cargo tree -e features -i cc shows parallel for the oracle.
  • On a forced cold rebuild of the oracle (touch a libobs header and clear target/*/build/obs-c-oracle-*), the wall time drops roughly by the core count. Record the before and after.

Parent: #3249

Activity

  1. zackees commented on Oct 31, 2026

    @zackees
    MemberAuthor

    Claiming: enable cc's parallel feature for every build script that compiles C, with before/after numbers for a cold oracle rebuild. PR today.

  2. added
    ready
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions