Skip to content

fix(ohos): restore ohos cfg gate on set_danmaku_config - #68

Merged
Shinokawa merged 1 commit into
mainfrom
fix/ohos-capi-cfg-gates
Jul 29, 2026
Merged

fix(ohos): restore ohos cfg gate on set_danmaku_config#68
Shinokawa merged 1 commit into
mainfrom
fix/ohos-capi-cfg-gates

Conversation

@Shinokawa

Copy link
Copy Markdown
Member

main currently fails the OpenHarmony native (arm64) job (see run on 204cdd7).

In crates/erika_capi/src/lib.rs every platform API is a pair: the real implementation under #[cfg(any(macos, ios, windows, android, target_env = "ohos"))] and a no-op stub under #[cfg(not(any(...same five...)))]. The two lists have to be exact complements — OpenHarmony reports target_os = "linux", so target_env = "ohos" is the only predicate that matches it.

Two gates lost that predicate:

  • erika_presenter_set_danmaku_config — implementation gated on four targets, stub gated on not(any(five)), so OpenHarmony got neither definition and erika_presenter_set_danmaku_config_ptr failed to resolve it (E0425).
  • c_presenter_set_upscaler_accepts_valid_handle — same predicate missing on the test.

Both came in through #58, whose branch predated OpenHarmony support; the merge kept the branch side of those hunks.

This restores the predicate on both. No behaviour change on any other target.

Note on #56 and #67

Those two PRs fail the same job for the same reason and are not fixed by this PR — they carry their own dropped predicates (9 and 19 gates respectively, including luma_upscaler_mode_from_c, the SubtitleStyleConfig import, the erika_presenter_get_upscaler_status stub, and the whole new subtitle/memory-font API surface). They will need the same treatment after rebasing on this.

Verification

  • cargo check -p erika_capi --all-targets
  • cargo fmt --all -- --check
  • Audited all 112 platform cfg blocks in erika_capi: every list mentioning android also mentions target_env = "ohos", and every impl/stub pair now has identical predicate sets.

🤖 Generated with Claude Code

`erika_presenter_set_danmaku_config` was gated on macos/ios/windows/android
while its no-op stub was gated on `not(any(..., target_env = "ohos"))`, so the
OpenHarmony target got neither definition and `erika_presenter_set_danmaku_config_ptr`
failed to resolve it. The upscaler test lost the same predicate.

Both gates came in through PR #58, whose branch predated OpenHarmony support.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Shinokawa
Shinokawa merged commit 1d79595 into main Jul 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant