Repository navigation
build: Always build libobs-with-rust beside the C libobs; link and ship the C one (#1065) - #1086
Merged
Merged
Conversation
zackees
enabled auto-merge
October 16, 2026 13:11
Member
Author
|
Fast Gate's lint lane failed only on rustfmt in |
) - rust/obs-nvenc/tests/ffi.rs: obs-nvenc keeps cuda-load.c and an obs-nvenc-with-rust twin builds cuda-load-rust.c with the staticlib (fails: the plugin still swaps loaders on ENABLE_RUST_LIBOBS). - ci/test_tier2_fanout.py: the Tier 2 build job uploads one tree (tier2-tree) and every mode x shard job tests it (fails: one tree per ENABLE_RUST_LIBOBS mode). - ci/test_tier2_run.py: the Docker harness builds out of source from the read-only checkout, with no rsync copy, and keeps crate downloads on shared volumes (fails: it rsyncs into /src). Refs #1065
…ip the C one (#1065) One configure builds two libobs binaries from one compile of the shared code: libobs-objects (OBJECT) holds every unported source and the usage requirements; libobs adds the ported C (LIBOBS_PORTED_SOURCES and the host's, libobs/cmake/sources.cmake) and is what everything links, installs and packages; libobs-with-rust adds the Rust ports (the libobs-rust staticlib, cmake/rust.cmake) and the C variadic halves, takes libobs's final file name and SONAME after set_target_properties_obs, and lands in <build>/libobs-with-rust, never installed or linked. It is built whenever cargo is found (the Flatpak sandbox has none). libobs-version and libobs-core-modules are linked into each shared library directly (CMake does not carry object libraries' objects through another), and Windows' OBS::obfuscate is link-only on the objects so its interface source is compiled once. obs-nvenc keeps cuda-load.c; obs-nvenc-with-rust is the never-installed twin with cuda-load-rust.c and the obs-nvenc-plugin staticlib. ENABLE_RUST_LIBOBS no longer picks a libobs: it only names the app OBS-Studio-Rust (identity, paths, version), so the release scripts that pass it keep their identity and now ship the C libobs. The daily beta's release notes say so. Tier 2 builds once and runs the unchanged C tests against each libobs: - Linux (validate.sh): mode OFF as linked, mode ON with LD_LIBRARY_PATH pointing at libobs-with-rust; one tree is packed for the CI shards (tier2-tree); checks the SONAME match, identical exports, the ported objects (all in libobs, none in the twin), both nvenc loaders, and that a test binary really loads the expected libobs. - macOS: DYLD_FRAMEWORK_PATH picks the framework, checked with DYLD_PRINT_LIBRARIES. Windows: PATH picks obs.dll; an obs.dll beside a test would shadow it, so that fails. - The Docker harness builds out of source from the read-only checkout (no rsync copy; -DOBS_BUILD_NUMBER keeps CMake from writing the build number into it), keeps crate downloads on shared volumes, links with RUNPATH, and resets a build tree configured from another source path. - sanitize.sh: RUST_LIBOBS=ON runs the tests and the app against the twin. Local: Tier 2 Linux from the read-only mount, one build: SONAME libobs.so.30 for both, exports IDENTICAL (1766), 258/258 against libobs; against libobs-with-rust the run reached test 246 (all passing) when the Docker daemon restarted, rerun pending. Fixes #1065
bosn's manifest Dockerfile builds take the whole checkout as the build
context and refuse one over 64 MiB ("manifest Dockerfile context was
refused"); with no .dockerignore that included target/ (22 GB), .git and
build trees, so bosn run --task appimage never started. The root file
admits only what build-aux/appimage/Dockerfile and
build-aux/appimage/manylinux/Dockerfile COPY. Verified: bosn manifest
ensure succeeds for both stacks (appimage, appimage-228).
forge-ci/bosn#657 asks bosn for a default ignore set and a precise error.
… volumes (forge-ci/bosn#666) ci/docker-task.sh emulates bosn#666 until bosn does it itself: - run: an ephemeral container named <task>-<checkout id> (--rm), one at a time per checkout: a running one refuses the run (exit 75) or --wait waits on it (docker wait); a stopped leftover is removed. Per-checkout (stack) and shared (machine) named volumes, labelled with task, scope and checkout path, are reattached every run; --clean / --clean-all drop them first. The source is ro, rw or overlay (a read-only checkout under a throwaway upper layer). Images are tagged by content hash and capped at the newest three per task. - gc: lists (with --apply removes) stack volumes whose labelled checkout is gone, stopped task containers and images beyond three; unlabelled legacy volumes only with --apply-legacy, never this checkout's or one in use. rust/tools/linux-validate/run.sh runs Tier 2 through it (same volume names, so warm builds carry over) and gains --clean, --clean-all and --wait. cmake/cross/docker.sh runs the cross-compile check the same way: the checkout as an overlay at /src; /build per checkout; soldr's root and the prebuilt deps on shared volumes, so the host needs only Docker. Host (no Docker) Tier 2: rust/tools/sanitize/shell.nix gains what the cmocka tests start (xvfb-run, PipeWire, WirePlumber, pactl, VLC), and OBS_TIER2_KEEP_PATH=1 keeps the Nix shell's PATH (NixOS's envfs /usr/bin cmake can't find its modules). Verified against Docker: the smoke test (container removed, volume reattached, --clean, overlay writes discarded and the host untouched, concurrent run refused, --wait) passes 11/11 and gc cleans up after it; a cold cmake/cross mac-arm64 in a fresh container downloads soldr, provisions LLVM and the Apple SDK, and compiles libobs 103/103; the warm rerun takes 4 s (no downloads, ninja: no work to do), no container left. Refs #1065
Volumes that only ever grow (cargo targets, compiler caches, soldr's
root) are now bounded two ways:
- docker-task.sh --budget VOL=SIZE: after every run (failed ones too), a
volume over its budget is removed and the next run starts it cold. Tier 2:
build 8G, ccache 3G, crates 2G each; cross: build 6G, soldr 12G, deps 2G.
- docker-task.sh --prune-cargo DIR: after every run, in the same container,
soldr cache prune-target --keep-latest on DIR and each DIR/<triple>
(soldr only scans the top-level profiles). Safe here because each target
is built one way. soldr comes from a shared docker-task-soldr-<version>
volume, fetched once at the version and SHA256 cmake/common/soldr.cmake
pins. Tier 2 prunes Corrosion's /build/tree{,-debug}/cargo/build.
- CARGO_INCREMENTAL=0 in both tasks: no incremental caches in one-shot
builds.
One image and one target dir serve every platform: cargo keeps each
target in target/<triple>/<profile>, sharing host build scripts and
proc-macros.
Verified against Docker: a crate built for x86_64-unknown-linux-gnu with
two feature sets leaves two rlibs; the pruned run keeps one (60.1 KB
reclaimed) and the next build finishes in 0.04 s, nothing rebuilt.
Refs #1065
Incremental rebuilds are the fast path for the crates being edited. The keep-latest prune after every run keeps each crate's newest incremental data and drops superseded copies, and the volume budget stays the hard ceiling, so CARGO_INCREMENTAL=0 isn't needed to bound the volume. Refs #1065
…ss aliases - CMake 4.2's Windows-Clang platform requires CMAKE_RC_COMPILER; soldr's LLVM has no llvm-rc and the check compiles no .rc, so the generated toolchain names an existing program. - cmake/cross regenerates its toolchain when soldr.cmake or the alias changes, so a fix reaches existing build trees. - cmake/cross/docker.sh downloads soldr once per version into the shared soldr volume instead of into every alias's build tree. Refs #1065
…ibobs-with-rust - test_tier2_native: the source root is /ro; git's safe.directory is set unconditionally before the first git command. - test_tier2_env: every ctest line runs with mode_env, built from test_env (mode ON adds LD_LIBRARY_PATH for the Rust twin). - test_rust_macos_sdk: the fixture defines libobs-with-rust, the target rust.cmake now configures. - cmake/cross: the alias also comes from OBS_CROSS_TARGET in the environment, because CMake drops -D options when a toolchain change resets the cache; docker.sh sets it per alias. Refs #1065
…ustfmt - docker-task.sh: volume budgets are measured at most once an hour per volume (DOCKER_TASK_BUDGET_SECS), concurrently when due, and the overlay cleanup runs in the background. A warm cmake/cross/docker.sh run goes from 8-11 s to 2-6 s (a bare docker run is 1.3-2.8 s on the same host). - soldr.cmake writes the generated toolchain only when its content changes (COPY_FILE ONLY_IF_DIFFERENT): rewriting it unchanged kept CMake resetting an existing tree's cache, 263 reconfigures in a row. The old win-x64 tree now configures once and compiles libobs 105/105 in 16 s. - rustfmt rust/obs-nvenc/tests/ffi.rs. Local: ./lint (lane lint) ok; ci/ 516 tests ok. Refs #1065
libobs has no OUTPUT_NAME on macOS (the file name is the target name), so the property copy left the twin as libobs-with-rust.framework and Tier 2 could not find it.
zackees
force-pushed
the
infra/1065-always-build-rust
branch
from
October 16, 2026 13:49
cd6c120 to
c68ca2f
Compare
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 17, 2026
… C libobs (obs-rust#1253) * release-rust: Look for Rust code in libobs-with-rust, not the shipped C libobs Since obs-rust#1086 (obs-rust#1065) the package ships the C libobs and the Rust ports are linked into its never-installed twin. The beta still required Rust in the packaged obs.dll / libobs.framework, so the 2026-10-17 daily beta (run 39034168041) failed on Windows and macOS: 'no Rust code in ...'. Check the twin the build made instead. Refs obs-rust#926 * release-rust: Keep the collector's end marker for its test
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 17, 2026
…rust#1255) * release-rust: Look for Rust code in libobs-with-rust, not the shipped C libobs Since obs-rust#1086 (obs-rust#1065) the package ships the C libobs and the Rust ports are linked into its never-installed twin. The beta still required Rust in the packaged obs.dll / libobs.framework, so the 2026-10-17 daily beta (run 39034168041) failed on Windows and macOS: 'no Rust code in ...'. Check the twin the build made instead. Refs obs-rust#926 * release-rust: Keep the collector's end marker for its test * build: macOS OBS-Studio-Rust builds also build libobs-with-rust xcodebuild -target obs-studio leaves out the never-installed Rust-linked twin, so the beta's 'Rust is linked' check found no libobs-with-rust on macOS (verify run 39042455015). Build it as a second target.
6 of 7 tasks
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.
Fixes #1065.
What
One configure, both libobs builds
libobs-objects(OBJECT) compiles every unported source once.libobs= the objects + the ported C. Everything links, installs and packages it.libobs-with-rust= the objects + thelibobs-ruststaticlib + the C variadic halves.libobs.so.30), copied afterset_target_properties_obs.<build>/libobs-with-rust/and is never installed or linked.obs-nvenckeepscuda-load.c.obs-nvenc-with-rustis the never-installed twin with the Rust loader.ENABLE_RUST_LIBOBSno longer picks a libobs. It only names the app OBS-Studio-Rust.Tier 2: one build, the unchanged C tests against each libobs
LD_LIBRARY_PATHloads the twin.tier2-tree).DYLD_FRAMEWORK_PATHloads the twin, checked withDYLD_PRINT_LIBRARIES.PATHloads the twin. Anobs.dllbeside a test would shadow it, so that fails the run.Docker harness: emulates forge-ci/bosn#666 via
ci/docker-task.sh<task>-<checkout id>. The name is the singleton lock.--clean/--clean-allreset them.soldr cache prune-target --keep-latest, ontarget/and eachtarget/<triple>). Incremental compilation stays on.gcreclaims volumes whose checkout is gone.Other changes
cmake/cross/docker.shruns the cross-compile check the same way. The host needs only Docker..dockerignoreletsbosn run --task appimagebuild again. It was refused before: the whole checkout was over bosn's 64 MiB context cap.shell.nixgains PipeWire, WirePlumber,pactl,xvfb-runand VLC, andOBS_TIER2_KEEP_PATH=1keeps the Nix shell's PATH.RED
295fdde4a. These tests fail against the old layout:ffi.rs: the nvenc C loader plus a Rust twin.test_tier2_fanout.py: one tier2 tree.test_tier2_run.py: a read-only source with no rsync.Verified locally
Linux Tier 2 in Docker, one build from the read-only mount
libobs.so.30, and their exports are IDENTICAL (1766).libobs.libobs-with-rust, every test passed up to test 246, when the Docker daemon restarted (an external restart).Linux Tier 2 natively on NixOS
libobs. The 4 failures are environment-specific: Ubuntu font path (fixed on master by test: Isolate fontconfig in test_text_freetype2_bundled_font #1081), PipeWire-pulse, and two timing tests on a loaded machine. They pass in the Ubuntu container.Full product built and launched on the host
Number of memory leaks: 0.docker-task.shagainst real Docker--clean, overlay, singleton,--wait, and gc.cmake/cross/docker.shmac-arm64103/103.