Skip to content

rust: Port util/platform-nix-dbus.c to obs-util #1576

Closed

Description

@zackees

Unit

Port libobs/util/platform-nix-dbus.c.h to obs-util, preserving dbus_sleep_info_create, dbus_inhibit_sleep, and dbus_sleep_info_destroy and the GIO feature gate. This is the session D-Bus fallback called by the Rust platform-nix-inhibit implementation. Keep the portal inhibitor as a separate unit.

Phase and position

Phase 4, after the platform-nix-inhibit port (#1500) and within the remaining platform work tracked by #153. The file is a separate unity member, so it can move to the ported group without restructuring platform-nix-portal.c.h.

Dependencies and characterization

The unchanged test/cmocka/test_inhibit_sleep_dbus.c covers a private fake session bus, ScreenSaver service selection, reason, cookie, repeated calls, destroy while active, and fallback. Audit its Tier 2 OFF/ON result before the swap. The GIO API and its synchronous bus calls are host behavior; keep them behind src/platform/ or src/ffi/.

Acceptance

RED Tier 1 tests against stubs; GREEN safe Rust core; a thin C ABI shim; Tier 3 differential parity against the original C oracle for service selection and state transitions; unchanged C tests against both libobs variants; exact export parity. Preserve public headers and existing C tests. No intended behavior changes. Linux and FreeBSD host gates must build, with Linux GIO Tier 2 passing in PR CI. Follow docs/rust-port/testing-policy.md and one port unit per PR.

Activity

  1. added
    port
    on Oct 20, 2026
  2. zackees commented on Oct 20, 2026

    @zackees
    MemberAuthor

    Claiming: libobs/util/platform-nix-dbus.c.h. 1. Verify the existing private-bus C characterization and add Tier 1 RED cases in the platform test binary. 2. Port the synchronous D-Bus state machine and C symbols to obs-util with differential and layout/export checks. 3. Run focused and Tier 2 validation, then open a PR against master. First draft PR today.

  3. added
    claimed
    on Oct 20, 2026
  4. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Implementation is in draft PR #1577. The opaque C ABI handle owns a Rust Box instead of a C allocation. A null reason pointer becomes an empty string when passed to GIO; the deterministic C differential oracle covers non-null reasons. The existing C ABI, GIO feature gate, and exported symbols are preserved.

  5. zackees commented on Oct 21, 2026

    @zackees
    MemberAuthor

    Completed by #1577, merged as 02428da.

    The session D-Bus inhibitor is implemented in obs-util with the preserved C ABI, GIO feature gate, Rust state tests, original-C differential oracle, and unchanged D-Bus C characterization. The final PR CI Gate passed, including Linux OFF/ON Tier 2 and Windows Tier 2. The Windows cm_print_error blocker (#1580) is closed.

    The separate portal inhibitor and broader platform migration remain outside this unit and are tracked under #153. This records the source merge; no application installation was performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimedport

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions