Skip to content

rust: Let obs-util's gio-2.0 probe warn on cross targets - #1689

Merged
zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/cross-release-aarch64-gio
Oct 22, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
rdoupe:fix/cross-release-aarch64-gio

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

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-release failed in obs-util's build script. The release gate runs that lane (Rust Cross Lint 🦀 (release targets)), and release-rust.yaml publishes only after the gate passes. No release has run since #1577 merged, so the next daily release would fail and publish nothing.

  • libobs-rust turns on obs-util/gio by default, so every --workspace build probes gio-2.0 on Linux and FreeBSD targets.
  • The Rust inhibitor declares GIO's functions itself (no headers, no bindgen), so the probe only adds link flags. Natively, Cargo links the test binaries against GIO, so GIO stays required there. The cross gates only lint or build the staticlib, which links nothing. A real build gets GIO from CMake, which links hybrid libobs with gio::gio itself.
  • When Cargo's HOST and TARGET differ, 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 in obs-c-oracle/build.rs was already optional.
  • The decision is in rust/obs-util/build/gio.rs, which the build script and its unit test both include.
  • Not changed: CI workflows, the soldr toolchain, and the native build. Adding GIO to soldr's aarch64 sysroot would also fix it, but nothing in a cross lint needs GIO.

Linux x86_64 host, soldr toolchain:

Build Step Result
master 4ffe715 (before #1577) release gate, Rust Cross Lint (release targets) passed
master eaf4903 clippy --workspace --target aarch64-unknown-linux-gnu (the lane's step) obs-util build script panics: "GIO feature needs gio-2.0"
This branch --lane cross-release (win-arm64, mac-x64, linux-arm64) ok; obs-util warns "gio-2.0 not found for aarch64-unknown-linux-gnu"
This branch hybrid libobs (CMake, ENABLE_RUST_LIBOBS=ON), native links libgio-2.0; test_inhibit_sleep_dbus, test_inhibit_sleep, test_inhibit_portal pass

RED → GREEN

  • RED commit: a6fc2ff test: Check obs-util's gio-2.0 probe on cross targets. It moves the probe decision unchanged into build/gio.rs and adds three Tier 1 cases (platform::gio_probe). On master's logic cross_linux_does_not_require_gio fails, 2 of 3 pass.
  • GREEN: 2321107. platform::gio_probe 3/3. Local gate: --lane cross-release ok, --lane lint ok, --lane rust-test ok (1984 tests, 0 failed, plus the windows-gnu link). cargo test -p obs-util --lib --features gio for dbus_inhibit, dbus_inhibit_parity, nix_inhibit and gio_probe: 38/38. Hybrid libobs built natively with CMake: the three inhibitor cmocka tests pass, 3/3, none skipped.
  • Real app: N/A. Build script only; the native build is unchanged.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with scripting ON (PR CI builds no OBS app: run gh workflow run ci.yml --ref <branch> for the full builds) and cross-checked with clang and MSVC
  • Intentional differences from C listed in the parity test header and rust/README.md (ports)

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
@rdoupe
rdoupe requested a review from zackees as a code owner October 22, 2026 01:04
@zackees
zackees enabled auto-merge October 22, 2026 01:11
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into obs-rust:master with commit cd01bce Oct 22, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: obs-util: the release gate's Linux arm64 cross lint fails, gio-2.0 not found

2 participants