Repository navigation
build(libobs): the Rust staticlib is a cached lib-module (#3265) - #3324
Merged
Merged
Conversation
zackees
force-pushed
the
build/3265-rust-module-cache
branch
from
November 1, 2026 04:09
967205e to
5370e9f
Compare
zackees
marked this pull request as ready for review
November 1, 2026 04:09
zackees
enabled auto-merge
November 1, 2026 04:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3265. Stacked on #3321 (the module cache); this retargets to master once #3321 merges.
libobs-rustbecomes one more cached module.libobs/cmake/rust.cmakewriteslibobs-modcache-rust.json: the archive path, Corrosion's features, the triple, the profile and the C compiler.libobs_rust-cached, an IMPORTED archive that copies Corrosion's link libraries, options and directories, the macOS SDK path included.cargo-build_libobs_rustis excluded from the build, so cargo does not run. Corrosion still configures the crate, so the native link libraries stay correct.ci/libobs_modules.pykeys the staticlib on that json,Cargo.lock, rootCargo.toml,rust-toolchain.toml,rustc -vV, RUSTFLAGS and CFLAGS, and gio's pkg-config version. It also hashes every file of the 16 path crates libobs-rust builds with, found by walking theirCargo.tomlnormal and build dependencies (tests/andbenches/left out), plus the files outside them that their build scripts read:libobs/obs-hotkeys.hand the vendored jansson headers. The walk is stdlibtomllib, becausecargo metadata --offlinefails in the linux-validate container.RED:
aa5fe95a4adds 5 tests toci/test_libobs_modules_cache.py. Without the change they fail with 4 errors and 1 failure.GREEN:
967205e52. The 9 cache tests, the module tests,ci/test_rust_macos_sdk.pyand./lintpass.End to end (Linux, linux-validate container, final commit):
storelibobs/graphics/effect.c.hgraphics)libobs.soexports are identical between A and B (1,767). Before this change, the same fresh-dir warm-cache case spent 11.6 s in_cargo-build_libobs_rust.Not met: the acceptance criterion "warm rebuild 6.0 s → under 2 s". In this setup a no-op rebuild of
libobstakes about 17 ms with or without the cache (3 runs each), because cargo isn't invoked at all, so the 6.0 s baseline doesn't reproduce here. Dropping theobs_serialize_cargo_buildstalls is untouched as well.Tiers 1-4 don't apply: this is build tooling, and a hit links the archive the same cargo build produced, and the export set is identical.