Skip to content

bug(libobs): macOS Tier 2 red on the enum -> int seam conversions after #2877 #2896

Closed

Description

@zackees

What

After #2877 enabled -Wsign-conversion on the libobs targets, the macOS Tier 2 lane is red on the Rust seam call sites: every helper the port declares with an int parameter where the caller passes a C enum fails on AppleClang.

Evidence: Rust Tier 2 (macos-26) on #2887's head (run 40841202389, job 123343547757) — once the obs-cocoa.m.h four were fixed, the lane reported:

libobs/obs-canvas.c.h:328:42: 'enum video_format' to 'int' [-Werror,-Wsign-conversion]
libobs/obs-display.c.h:197:37: 'enum gs_color_space' to 'int'
libobs/obs-scene.c.h:433:45 / :460:45: 'enum obs_bounds_type' to 'int'
libobs/obs-scene.c.h:578:25 / :579:25 / :580:23: 'const enum obs_scale_type' / 'obs_blending_method' / 'obs_blending_type' to 'int'
libobs/obs-scene.c.h:649:32 / :674:31:46 / :676:66:81 / :771:43 / :808:89: obs_scale_type, gs_color_space, obs_blending_type, obs_blending_method to 'int'
libobs/obs-source-deinterlace.c.h:237:45 / :283:76 / :285:43:76 / :289:86: obs_deinterlace_mode, gs_color_space to 'int'

19 sites in 4 files (clang reports every diagnostic in a TU, so the set is complete for these groups).

Why macOS only

Clang gives an enumeration whose enumerators are all non-negative an unsigned underlying type; AppleClang does that for obs_bounds_type, obs_scale_type, gs_color_space, obs_deinterlace_mode and video_format, GCC and Linux clang keep int. So the same call is a sign conversion only on Apple platforms, which is why #2877's Linux replay of the libobs TUs could not see them.

Cause

The port's seam helpers take int for those enums on purpose (the Rust ABI of rust/obs-scene, rust/obs-source, rust/obs-canvas is c_int, and some carry -1 sentinels), e.g. bool obs_scene_item_transform_bounded(int bounds_type);. Every call site that passes the real enum value is therefore an implicit enum -> int conversion.

Blocks

This is master breakage, not just this lane: the merge group for #2872 (run 40841144417) failed Rust Tier 2 (macos-26) and #2872 was ejected from the queue. Every PR that selects the lane is blocked until it is fixed.

Fix

State the conversion at each call site: obs_scene_item_transform_bounded((int)item->bounds_type), obs_canvas_rules_format_set((int)ovi->output_format), obs_display_clear_linear((int)gs_get_color_space()), the deinterlace set, and the .scale_filter / .blend_method / .blend_type initializers, with one comment where the reason is not obvious. The seam signatures and the Rust ABI stay unchanged, so no Rust test changes; libobs/obs-cocoa.m.h is the separate #2887.

Activity

  1. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Claiming: #2896 — the enum -> int conversions at the Rust seam call sites

    Plan (one PR, one commit; this is the repo's warning-ratchet shape, so the RED evidence is the macOS lane log already on the issue and the commit is the GREEN):

    1. Cast at the 19 sites the lane reports: libobs/obs-scene.c.h (12), libobs/obs-source-deinterlace.c.h (5), libobs/obs-display.c.h (1), libobs/obs-canvas.c.h (1). The seam signatures and the Rust c_int ABI stay as they are, with a comment where the cast's justification is not self-evident.
    2. ./lint locally; no Rust or cmocka change is needed (no signature moves), and Linux cannot reproduce the finding — the macOS lane on the PR is the proof.
    3. If the lane reports a further wave behind these four groups, it lands in the same PR before the branch is marked ready.

    First PR in this tick.

  2. added
    ready
    on Oct 29, 2026
  3. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    The remaining seam casts are on master (obs-output.c.h:1084/1092/1131/1189, obs-hotkey-name-map.c.h:109, plus 997c3d5 for the caption shift), so #2897 had nothing left and is closed as superseded. What is still missing is evidence: the macOS Tier 2 lane only runs on schedule/merge-queue, and the merge-queue runs skip the macOS build job, so the next Scheduled run is the first chance to confirm. Leaving this open until that run is green.

  4. zackees commented on Oct 29, 2026

    @zackees
    MemberAuthor

    Closing with the evidence this issue was waiting for: the macOS Tier 2 lane is green on a merge-queue run at the current master tip.

    master f907d09db, merge-group run 40869896715 (2026-10-29T12:01Z): Build 🧱 / Rust Tier 2 (macos-26) = success.

    One correction to the open question above: the merge-queue path does run the lane that compiles these seams. It skips Build 🧱 / macOS 🏗️ (the full app), but Build 🧱 / Rust Tier 2 (macos-26) runs and is the job that produced every diagnostic listed in the body (libobs/obs-canvas.c.h:328, obs-scene.c.h, obs-source-deinterlace.c.h, and the obs-cocoa.m.h set). So a green merge-group run is the acceptance evidence, not only the next schedule run.

    The casts for the listed groups are on master (997c3d546 caption shift, obs-output.c.h:1084/1092/1131/1189, obs-hotkey-name-map.c.h:109, plus 5298ad7ec for the source frame-copy seams). #2897 stayed closed as superseded.

    The next Scheduled run is still worth reading for the unrelated CEF-EOL pin job, but this lane no longer blocks anything.

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

Metadata

Metadata

Assignees

Labels

ready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions