Skip to content

feat(moq-tokio,moq-ffi)!: always log to logcat on Android - #4608

Merged
kixelated merged 2 commits into
moq-dev:devfrom
pwrwpw:feat/android-logcat-default
Oct 1, 2026
Merged

kixelated merged 2 commits into
moq-dev:devfrom
pwrwpw:feat/android-logcat-default

Conversation

@pwrwpw

@pwrwpw pwrwpw commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Problem

moq_tokio::Log::init routed logs to logcat only with the android-logcat feature, and no shipped build enabled it: moq-c has no [features], and rs/moq-ffi/build.sh (used by the Kotlin and Dart release workflows) builds Android without it. Android app processes discard stderr, so every Rust log was lost. The published dev.moq:moq-ffi-android 0.4.8 does not import __android_log_* at all.

Closes #4456. Implements quest/m1/android-logcat.md.

Approach

  • Gate the logcat layer in rs/moq-tokio/src/log.rs on target_os = "android" alone. Logging stays opt-in at runtime, since Log::init runs only when the app calls it.
  • Make tracing-android a plain dependency under the existing cfg(target_os = "android") table. It stays target-gated because android_log-sys links liblog unconditionally.
  • Delete the android-logcat feature from moq-tokio and moq-ffi, with no no-op kept. The moq-native tombstone is left alone.
  • Regression check: just rs android now builds moq-ffi for arm64-v8a and asserts the .so imports __android_log_*. android.yml also triggers on rs/moq-ffi/** and rs/moq-tokio/**, the crates that decide that link.

Impact

  • moq-tokio: the android-logcat feature is removed (breaking, hence dev). Builds passing --features android-logcat stop resolving. No other feature in the repo requests it.
  • moq-ffi: the android-logcat feature is removed (breaking).
  • Android builds of moq-tokio, moq-ffi, and moq-c now always link logcat. moq-c consumers already needed -llog (std pulls it in), so no new link flag.
  • Wire: none.

Alternatives

Follow-ups

  • None.

(Written by Claude Opus 5.5)

@pwrwpw
pwrwpw force-pushed the feat/android-logcat-default branch from 156ff08 to 889d1eb Compare September 30, 2026 18:00
@pwrwpw
pwrwpw marked this pull request as ready for review September 30, 2026 18:44
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed #4608 at 889d1eb487e7bfc672461a0dcbfec3cc0112cc14.

No actionable findings.

Direction: the Android-only gate in rs/moq-tokio/src/log.rs:69–84 fixes the source of the missing logs while preserving runtime initialization and non-Android stderr output. Keeping tracing-android target-scoped and removing the opt-in features is simpler than propagating flags through each binding’s build, and matches the maintainer’s decision in #4456. The deliberate Cargo feature break belongs on dev; no wire change or extra abstraction is introduced.

Verification: reviewed all five changed files and logging callers. Android CI for this head passed, including the moq-ffi build and symbol assertion in rs/justfile:669–672; Check also passed. I did not run a device/emulator test: the symbol check establishes linkage, not observed logcat delivery.

(Written by OpenAI)

@pwrwpw
pwrwpw marked this pull request as draft October 1, 2026 03:53
@pwrwpw
pwrwpw force-pushed the feat/android-logcat-default branch from 889d1eb to 747f3c6 Compare October 1, 2026 03:55
@pwrwpw

pwrwpw commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto dev to resolve the rs/justfile conflict with #4038; the recipe now uses "$@".

@kixelated
kixelated marked this pull request as ready for review October 1, 2026 05:12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator

Merge summary:

  • Reviewed at 889d1eb with no findings. Since then the only changes are the rebase onto dev (the "$@" justfile conflict) and 59c1629, which deletes the finished quest/m1/android-logcat.md and its entry in quest/m1/README.md.
  • Breaking on dev: the android-logcat feature is removed from moq-tokio and moq-ffi; Android builds always link logcat. Wire: none.
  • The moq-native android-logcat = [] tombstone stays, per the quest.

Enabling auto-merge at 59c1629. Thanks @pwrwpw!

(Written by Claude Opus 5.5)

@kixelated
kixelated enabled auto-merge (squash) October 1, 2026 05:14
@kixelated
kixelated merged commit 836bdc0 into moq-dev:dev Oct 1, 2026
10 checks passed
@pwrwpw
pwrwpw deleted the feat/android-logcat-default branch October 1, 2026 07:06
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.

2 participants