Repository navigation
rust: Let obs-util's gio-2.0 probe warn on cross targets - #1689
Merged
Merged
Conversation
Since the session D-Bus inhibitor port (obs-rust#1577), obs-util's build script requires gio-2.0 through pkg-config whenever the `gio` feature is on, also for a cross target. libobs-rust turns that feature on by default, so the release gate's `cross-release` lane, which lints the workspace for aarch64-unknown-linux-gnu, now fails: soldr's aarch64 sysroot has no GIO. Move the probe decision unchanged into build/gio.rs so it can be unit tested, and add Tier 1 cases: a native Linux build still requires GIO, a cross build must not. The cross case fails. Refs obs-rust#1688
The session D-Bus inhibitor port (obs-rust#1577) made obs-util's build script probe gio-2.0 through pkg-config and panic without it. The Rust inhibitor declares GIO's functions itself, so the probe only adds link flags. That is needed natively, where Cargo links the test binaries against GIO, but not for a cross target: the cross gates only lint or build the staticlib, and CMake links hybrid libobs with gio::gio itself. soldr's aarch64 Linux sysroot has no GIO, so the release gate's cross-release lane failed at obs-util's build script. A cross build now still probes gio-2.0 and uses it when found, and otherwise prints a Cargo warning instead of failing. A native build is unchanged: it requires GIO. Fixes obs-rust#1688
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 #1688
What and why
The release gate's Linux arm64 cross lint passes again. Since #1577 (session D-Bus sleep inhibitor port), obs-util's build script panicked without gio-2.0, also for a cross target. soldr's aarch64 Linux sysroot has no GIO, so
uv run ci/local_gate.py --lane cross-releasefailed in obs-util's build script. The release gate runs that lane (Rust Cross Lint 🦀 (release targets)), andrelease-rust.yamlpublishes only after the gate passes. No release has run since #1577 merged, so the next daily release would fail and publish nothing.libobs-rustturns onobs-util/gioby default, so every--workspacebuild probes gio-2.0 on Linux and FreeBSD targets.gio::gioitself.HOSTandTARGETdiffer, the build script still probes gio-2.0 and uses it when found. Without it, it prints a Cargo warning instead of failing. The C oracle's probe inobs-c-oracle/build.rswas already optional.rust/obs-util/build/gio.rs, which the build script and its unit test both include.Linux x86_64 host, soldr toolchain:
clippy --workspace --target aarch64-unknown-linux-gnu(the lane's step)--lane cross-release(win-arm64, mac-x64, linux-arm64)ENABLE_RUST_LIBOBS=ON), nativetest_inhibit_sleep_dbus,test_inhibit_sleep,test_inhibit_portalpassRED → GREEN
test: Check obs-util's gio-2.0 probe on cross targets. It moves the probe decision unchanged intobuild/gio.rsand adds three Tier 1 cases (platform::gio_probe). On master's logiccross_linux_does_not_require_giofails, 2 of 3 pass.platform::gio_probe3/3. Local gate:--lane cross-releaseok,--lane lintok,--lane rust-testok (1984 tests, 0 failed, plus the windows-gnu link).cargo test -p obs-util --lib --features giofordbus_inhibit,dbus_inhibit_parity,nix_inhibitandgio_probe: 38/38. Hybrid libobs built natively with CMake: the three inhibitor cmocka tests pass, 3/3, none skipped.Checklist
masterdocs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC