Skip to content

Rename platform folders and files to hosts/{windows,macos,linux,posix} (match the Rust layout) #1009

Closed

Description

@zackees

CI picks OS lanes from the changed paths (#992). Today ci/platform_paths.py needs about 30 tokens and extensions, because platform code is named inconsistently: platform/unix, platform/posix, platform-nix.c, platform-cocoa.m, platform-osx.mm, ...

Standardize on the Rust crate layout, src/platform/<os>/ with <os> in {windows, macos, linux, posix}, and use the same names for C and shared code (platform/<os>/ or *-platform-<os>.c). Then one rule picks the lane:

/platform[/-](windows|macos|linux|posix)[/.]  ->  that OS lane (posix -> linux + macos)

Renames on master today:

  • rust/obs-util, rust/obs-media-io, rust/obs-nvenc: platform/unix -> platform/posix
  • libobs/util: platform-nix.c -> platform-posix.c, platform-cocoa.m -> platform-macos.m
  • plugins/text-freetype2: unix -> posix, cocoa -> macos
  • frontend/utility: osx -> macos
  • (shared/happy-eyeballs already uses windows/posix)

Enforce the names with the Dylint boundary lint and ci/platform_ifdef_ratchet.py, so a new platform file must use one of the four names. When this is done, drop the legacy tokens from ci/platform_paths.py. OS-named plugins (win-capture, mac-*, linux-*) stay as an explicit list until they are folded in.

Keep upstream diffing in mind: note the renames in the port docs so the C-to-Rust differential mapping still finds the originals.

Activity

  1. changed the title [-]Rename platform folders and files to platform/{windows,macos,linux,posix} (match the Rust layout)[/-] [+]Rename platform folders and files to host/{windows,macos,linux,posix} (match the Rust layout)[/+] on Oct 16, 2026
  2. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Naming change: these folders are host/, not platform/. A host is the machine the code runs on, while "platform" also means third-party services and target triples, and "host" is shorter. The wild linker uses the same name. The targets are now host/{windows,macos,linux,posix} and *-host-<os>.c. The CI rule becomes /host[/-](windows|macos|linux|posix)[/.], with platform accepted as an alias for one release. The full plan, including the Rust src/platform → src/host move and the Dylint rename to ban_host_cfg_outside_boundary, is in #1051.

  3. changed the title [-]Rename platform folders and files to host/{windows,macos,linux,posix} (match the Rust layout)[/-] [+]Rename platform folders and files to hosts/{windows,macos,linux,posix} (match the Rust layout)[/+] on Oct 16, 2026
  4. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Correction to my last comment: the folder is plural, hosts/ (hosts/{windows,macos,linux,posix}). Single files are *-host-<os>.c. The CI rule is /hosts?[/-](windows|macos|linux|posix)[/.]. See #1051.

  5. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Claiming a slice: the two C facades I added today, so they don't become legacy names:

    • shared/happy-eyeballs/platform/{windows,posix}/ → shared/happy-eyeballs/hosts/{windows,posix}/ (CMake include dir follows)
    • plugins/text-freetype2/text-freetype2-platform-{windows,cocoa,unix}.c → text-freetype2-host-{windows,macos,posix}.c (the unix file is Linux/FreeBSD/OpenBSD, i.e. posix), plus the header and test_text_freetype2_platform/test_text_aa_file wiring.

    Both stay blessed by the current ratchet tokens (windows/macos/posix) and match /hosts?[/-](windows|macos|linux|posix)[/.]. One PR, ci-full. Not touching the Rust crates, libobs/util, frontend or the lint/path rules.

  6. added
    claimed
    on Oct 16, 2026
  7. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Question: does #1051's "Plan changed (2026-10-16)" (no platform → hosts rename, keep src/platform/, don't restructure C files) supersede this issue? If yes, this can close and #1066 (my slice renaming two new facades to hosts/) should be closed too; I've dequeued it and moved it to draft until it's decided.

  8. zackees commented on Oct 16, 2026

    @zackees
    MemberAuthor

    Correction: #1066 had already merged (11:07Z) when I wrote the above, so it was not dequeued. Same question remains: if hosts/ is dropped per #1051, I'll send a follow-up renaming those two new facades back to platform naming.

  9. zackees commented on Oct 17, 2026

    @zackees
    MemberAuthor

    Resolved (maintainer decision, 2026-10-17): the policy is hosts/, not platform/, for host-specific C files (hosts/<os>/, *-host-<os>.c). #1066 stands as merged; no revert follow-up. Disregard my question above.

  10. removed
    claimed
    on Oct 19, 2026
  11. zackees commented on Oct 25, 2026

    @zackees
    MemberAuthor

    Closing as resolved by decision. The maintainer settled the naming on 2026-10-17 (comment above): host-specific C files use hosts/<os>/ and *-host-<os>.c. AGENTS.md now records that upstream files keep their names (platform-nix.c.h, platform-cocoa.m.h stay), new host files use the hosts/ names, and ci/platform_ifdef_ratchet.py enforces it. Master already has 30 files under hosts/. The blanket rename this issue proposed is no longer the plan. #1066 stands as merged.

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