Skip to content

rust: Port libobs/util/platform-cocoa.m to obs-util #744

Closed

Description

@nathan-v

Unit

libobs/util/platform-cocoa.m to obs-util.

Phase and position

Phase 4, position 7 in docs/rust-port/testing-policy.md (platform.c, then platform-nix*.c / platform-windows.c). platform-nix.c is merged (#403). platform-windows.c is merged (#703). This is the macOS file those ports left. platform.c is still #262. Tracking issue #153.

Dependencies and existing tests

Depends on bmem, dstr, and the macOS os_gettime_ns clock already used by os_sleepto_ns. test/cmocka/test_platform.c does not call this file. A new test_platform_cocoa.c characterizes it and then stays unchanged. test_platform.c is not edited.

Notes

macOS only. ENABLE_RUST_LIBOBS drops util/platform-cocoa.m. Owns the Apple clock, Application Support paths, executable directory, CPU use, sleep inhibit, high-performance token, core counts, and process memory. cfstr_copy_cstr and cfstr_copy_dstr move with it because audio-monitoring/osx calls them. Linux and FreeBSD os_inhibit_sleep_* stay in util/platform-nix-inhibit.c.

Activity

  1. nathan-v commented on Oct 14, 2026

    @nathan-v
    ContributorAuthor

    Claiming: libobs/util/platform-cocoa.m

    1. Characterization: test/cmocka/test_platform_cocoa.c pins the current C behavior. test_platform.c stays as it is.
    2. RED: Tier 1 tests against todo!() stubs in obs-util.
    3. GREEN: safe core in platform::unix::cocoa, C shims, Tier 3 parity against the C oracle, and ENABLE_RUST_LIBOBS drops util/platform-cocoa.m.

    PR should open today on port/platform-cocoa. I can't add the claimed label from here.

  2. nathan-v commented on Oct 14, 2026

    @nathan-v
    ContributorAuthor

    PR: #746

    Characterization, RED, and GREEN are on port/platform-cocoa. Linux Tier 2 was 209/209 OFF and ON, exports identical (1766). No local-gate stamp from this Mac; PR CI runs the Linux jobs.

  3. zackees commented on Oct 14, 2026

    @zackees
    Member

    Done in #746 (merged via the merge queue): libobs/util/platform-cocoa.m is ported to obs-util and ENABLE_RUST_LIBOBS drops the Objective-C file on macOS.

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

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions