Skip to content

[codex] Port remaining Android XR compatibility fixes#182

Open
matthargett wants to merge 3 commits into
BabylonJS:mainfrom
rebeckerspecialties:codex/android-xr-compat-remaining
Open

[codex] Port remaining Android XR compatibility fixes#182
matthargett wants to merge 3 commits into
BabylonJS:mainfrom
rebeckerspecialties:codex/android-xr-compat-remaining

Conversation

@matthargett
Copy link
Copy Markdown

@matthargett matthargett commented Jun 4, 2026

Summary

This ports the remaining relevant functional pieces from the closed Android XR compatibility work in #115 that are still not present on current main.

Changes included here:

  • move the Android unit-test app and CI emulator target to API level 35, while keeping NDK r28c as the default
  • update the Android JavaScriptCore package from 250231.0.0 to 294992.0.0
  • route Android debug trace output through logcat for clearer connected-test diagnostics
  • make the V8 inspector frontend connection handle both older and newer V8 inspector APIs via V8_MAJOR_VERSION
  • avoid the basic_string<char16_t> to uint16_t* inspector string-buffer path that newer toolchains reject
  • align README Android setup notes with API 35 / NDK r28c

Validation

Ran gtest and JS unit tests:

  • with JSC (OS-installed) backend on M4 MacBook (with and without ASan, TSan, UBSan)
  • with JSC (jsc-android) backend on Pixel 2 API 35 emulator (no sanitizers, still tricky to run them on-device)
  • with v8 backend on PIxel 32 API 35 emulator
  • with JSC (jsc-android) backend on Meta Quest 1, 2, and 3
  • with JSC (OS-installed) on Apple Vision Pro (visionOS 26.5)

Note

jsc-android is a dead package with a maintainer that's MIA. bumping to the latest (which is still 6 years old) helps, but I think the right longer-term move is to use bun's android builds of their JSC since they've already built a non-browser N-API v10+ compliant ecosystem around it.

@matthargett matthargett force-pushed the codex/android-xr-compat-remaining branch from 91cf1ad to 625af30 Compare June 4, 2026 19:24
@matthargett matthargett marked this pull request as ready for review June 4, 2026 22:44
Copilot AI review requested due to automatic review settings June 4, 2026 22:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the Android unit test harness and related dependencies to newer Android tooling (API 35 / newer NDK), improves Android-native logging, and adds compatibility for different V8 Inspector connect() signatures.

Changes:

  • Bumped Android compile/target SDK to 35, updated NDK version handling, and improved ABI filter selection logic.
  • Switched native test trace output to Logcat and updated Android emulator CI to API level 35.
  • Updated JSC Android dependency and adjusted V8 Inspector agent for V8 version API differences.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Tests/UnitTests/Android/app/src/main/cpp/JNI.cpp Routes debug trace output to Android Logcat instead of stdout.
Tests/UnitTests/Android/app/build.gradle Updates SDK/NDK configuration and refines ABI filter behavior.
README.md Updates Android setup instructions to match new SDK/NDK/API level expectations.
Core/Node-API/package-jsc.json Bumps jsc-android dependency version.
Core/AppRuntime/V8Inspector/Source/V8InspectorAgent.cpp Adds V8 version-based connect() handling and adjusts string buffer creation.
.github/workflows/build-android.yml Moves CI emulator image to API level 35.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Core/AppRuntime/V8Inspector/Source/V8InspectorAgent.cpp Outdated
Comment thread Tests/UnitTests/Android/app/src/main/cpp/JNI.cpp
Comment thread Tests/UnitTests/Android/app/build.gradle
@matthargett matthargett requested a review from Copilot June 5, 2026 06:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread Core/AppRuntime/V8Inspector/Source/V8InspectorAgent.cpp
Comment thread Core/AppRuntime/V8Inspector/Source/V8InspectorAgent.cpp
Comment thread Tests/UnitTests/Android/app/build.gradle
Wrap the v8-version.h probe in `#if defined(__has_include)` so it's safe even on a preprocessor that
doesn't provide __has_include (standard in C++17+, which this project uses, but the guarded form is the
conventional portable idiom). When __has_include is unavailable, V8_MAJOR_VERSION stays undefined and
ConnectFrontend() falls back to the 3-arg connect().
Document that the DebugTrace callback uses __android_log_print with a dedicated "JsRuntimeHost" tag
rather than routing through AndroidExtensions StdoutLogger -- so connected-test diagnostics are
filterable via `adb logcat -s JsRuntimeHost` instead of interleaving with all stdout under one tag.
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