Repository navigation
obs-util: Port the portal sleep inhibitor - #1660
Merged
Merged
Conversation
nathan-v
force-pushed
the
port/platform-nix-portal
branch
2 times, most recently
from
October 22, 2026 03:46
6921a64 to
c17019f
Compare
The safe core is todo!(). Ten Tier 1 tests mirror test_inhibit_portal and panic not yet implemented.
The safe core follows platform-nix-portal.c. Ten Tier 1 tests cover the cmocka cases, and the parity tests compare the host trace with the C file. The three entry points stay hidden. The C file remains the reference.
Rc<dyn Fn(u32)> in the test host fields trips clippy type_complexity under -D warnings. Fast Gate stops there.
nathan-v
force-pushed
the
port/platform-nix-portal
branch
from
October 22, 2026 04:24
c17019f to
27b82c4
Compare
nathan-v
marked this pull request as ready for review
October 22, 2026 04:25
zackees
enabled auto-merge
October 22, 2026 04:41
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 #1631
What and why
The XDG portal sleep inhibitor (
libobs/util/platform-nix-portal.c.h) is Rust on Linux and FreeBSD when GIO is found. It sits with the session D-Bus inhibitor (#1577) inLIBOBS_NIX_GIO_PORTED_SOURCES. The three entry points have noEXPORT, so the shims stay hidden. The C file remains the reference.test_inhibit_portalincludes the C file, so it still characterizes that file.test_inhibit_sleepis the public OFF/ON path.Kept, characterized, not endorsed: destroying an active inhibit does not send
Request.Close. Onlyportal_inhibit(..., false)does. A NULL reason becomes"". The other fields sit behind one mutex.RED → GREEN
5a2c20ea2, rebased ontoee148335c. Earlier SHAs of this commit:d375a1fb5, thene1891544e. Ten Tier 1 tests againsttodo!()panic withnot yet implemented:test_discovery,test_request_and_success,test_rejected_responses,test_method_error,test_cancel_pending,test_destroy_pending,test_destroy_pending_close,test_response_before_reply,test_destroy_active, andtest_discovery_logs_the_c_messages.792e1292c(wasc17019f6ebefore this rebase). Arm64 imageobs-rust-linux-validate:3b1aa631be7db514(Ubuntu 26.04, image rustc 1.98.1, rust-lld). The GitHub ubuntu job is x86_64.cargo test -p obs-util --lib --locked portal_inhibitpassed 17 tests: the 10 Tier 1 tests, 6 parity tests (discovery_matches_c,inhibit_and_release_matches_c,rejected_and_errors_match_c,cancel_and_destroy_match_c,response_before_reply_matches_c,random_response_matches_oracle), andnix_inhibit::test_portal_inhibit_and_release. Thenix_inhibitfilter passed 28. SettingINHIBIT_FLAGSto0x4failedinhibit_and_release_matches_c(Rust trace flags 4, C trace flags 12). Restored before the commit.cargo clippy --lib --locked -D warningswith--features gioonobs-util, and the same flags onobs-c-oracleandobs-build, was clean. Hostexport_listpassed 3. The Docker command passedCFLAGS=-Wno-errorso the pre-existing arm64wchar_twarnings indstr-libc.c.handutf8.c.hstayed warnings. That flag is local only.27b82c4d3names the test-host response callback. Fast Gate onc17019f6efailed clippytype_complexityonRc<dyn Fn(u32)>in the two test hosts. After the alias, arm64cargo clippy -p obs-util --all-targets --locked -D warningsno longer reports it, and the 17 portal tests passed again. That arm64 clippy still stops on two pre-existingunnecessary_castnotes inbase_parity.rsanddstr_parity.rs, becausec_charis unsigned there. x86_64 CI does not hit them.Local CI before ready
soldr cargo fmt --all --check, workspace clippy-D warnings, andsoldr cargo dylint --all -- --workspace --lib --binspassed.SOLDR_RUSTC_WRAPPER=none.soldr cargo test --workspace --lockedpassed. The rust-test lane then stops on--target x86_64-pc-windows-gnu, which soldr will not host on this Mac. The cross lane stops onx86_64-pc-windows-msvcbecause the hostcchas no Windowsstdio.h.cargo testis not the GitHub x86_64 job. With the workspacegiofeature,dbus_inhibit_parity.rsdoes not compile here (c_charis unsigned). Left that file. The other crates failed inobs-graphicsrounding (0x7f800001) and in twonative_buildtests that setCC=clang. This image has no clang.OBS_CTEST_JOBS=8) did not reach ctest. zccache lost 8 requests, the uncached recovery killedcc1plus, and the Mac Docker mount foldedObs.hontoobs.h(obs-frontend-api.hmissing in the properties-dialog and screenshot tests).test_inhibit_sleepandtest_inhibit_portalcompiled. No portal error in the build log. Remote Tier 2 OFF and ON onc17019f6ealready passed. This follow-up does not change the production inhibitor. Tier 4 does not apply.Checklist
master(or the description starts with a Stacked: note)734ae280b; RED5a2c20ea2; GREEN792e1292c)docs/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 (not applicable: no flag change)