Skip to content

obs-util: Allow target-dependent wchar_t and c_char casts - #1485

Merged
zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/clippy-wchar-cast
Oct 20, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
rdoupe:fix/clippy-wchar-cast

Conversation

@rdoupe

@rdoupe rdoupe commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1484

What and why

The release gate's Rust Cross Lint fails on aarch64-unknown-linux-gnu, which blocks the daily release (none since 0.1.0-beta.20261018) and the scheduled full run. clippy's unnecessary_cast fires on casts of C character types that are signed on the PR-gate targets and unsigned on aarch64 Linux.

  • rust/obs-util/src/platform/unix/file.rs: File::open_wide and mbs_to_utf8 convert wchar_t with as u32. wchar_t is i32 on x86-64 Linux and macOS and u32 on aarch64 Linux.
  • rust/obs-util/src/ffi/cf_parser.rs (from obs-util: port cf-parser (#1466) #1467): as u8 on c_char, which is u8 on aarch64 Linux and aarch64-pc-windows-msvc.
  • The casts stay. The lint is allowed where the type depends on the target, with a comment saying why, as ffi/dstr.rs and platform/unix/nix.rs already do. No code changes behaviour.

RED → GREEN

  • RED: Release OBS-Studio-Rust run 39284837053, job "Release gate / Rust Cross Lint (release targets)": casting to the same type is unnecessary (u32 -> u32) at file.rs:55 and :158. On current master, cargo clippy -p obs-util --lib --target aarch64-unknown-linux-gnu -- -D warnings also reports the three cf_parser.rs casts (u8 -> u8 at :39 and twice at :56). This is a lint-only change, so there is no test commit.
  • GREEN: 24157e2. uv run ci/local_gate.py --lane cross-release (clippy and dylint, workspace, on aarch64-pc-windows-msvc, x86_64-apple-darwin and aarch64-unknown-linux-gnu) passes on this head. cargo clippy -p obs-util -- -D warnings also passes on x86_64-unknown-linux-gnu and aarch64-apple-darwin.

Checklist

  • Base is master
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits (lint only: the failing lint run is the RED)
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite

The release gate's cross lint runs clippy -D warnings on
aarch64-unknown-linux-gnu, where wchar_t is u32 and c_char is u8, so
`as u32` / `as u8` on them are no-ops there and clippy's unnecessary_cast
fails the release. They are needed on x86-64 Linux and macOS (i32 / i8),
which is why the PR gate passes.

Keep the casts and allow the lint with a comment where the type depends on
the target, as ffi/dstr.rs and platform/unix/nix.rs already do:
File::open_wide and mbs_to_utf8 in platform/unix/file.rs, and
ffi/cf_parser.rs (from obs-rust#1467).

Fixes obs-rust#1484
@rdoupe
rdoupe requested a review from zackees as a code owner October 20, 2026 02:09
@zackees
zackees added this pull request to the merge queue Oct 20, 2026
Merged via the queue into obs-rust:master with commit 21c4140 Oct 20, 2026
43 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ci: release lint fails on aarch64: unnecessary_cast on wchar_t/c_char in obs-util

2 participants