Skip to content

fix(mobile): honor requested terminal native architectures - #10709

Open
bompus wants to merge 1 commit into
pingdotgg:mainfrom
bompus:codex/mobile-terminal-abi
Open

fix(mobile): honor requested terminal native architectures#10709
bompus wants to merge 1 commit into
pingdotgg:mainfrom
bompus:codex/mobile-terminal-abi

Conversation

@bompus

@bompus bompus commented Sep 8, 2026

Copy link
Copy Markdown

What Changed

The terminal Android module now applies reactNativeArchitectures to its NDK ABI filters when the property is supplied. When it is absent, the module retains its existing defaults.

Why

Building with -PreactNativeArchitectures=arm64-v8a still scheduled terminal CMake builds for all four ABIs, even though the APK only needed ARM64. Honoring the requested architectures avoids this unnecessary native compilation.

Validation on Windows with Gradle 9.3.1:

  • The terminal native release task graph selects only ARM64 for arm64-v8a, and exactly ARM64 and x86_64 for arm64-v8a,x86_64.
  • With the property absent, the task graph still includes all four default ABIs.
  • The actual ARM64 native release build passed; llvm-readelf confirmed the resulting libt3terminal.so is an AArch64 shared library.
  • git diff --check passed. A full APK build was not repeated for this change.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI screenshots and interaction video: not applicable; no UI changes.

Prepared with GPT-6 in the Codex desktop app.

Note

Honor reactNativeArchitectures for Android NDK ABI filters in t3-terminal

Adds conditional logic to build.gradle that reads the reactNativeArchitectures project property and applies it as NDK ABI filters when present. Without the property, build behavior is unchanged.

Macroscope summarized 6aaa461.

Summary by CodeRabbit

  • New Features
    • Added support for configuring Android native architectures through the reactNativeArchitectures build setting.
    • Enables builds to target a selected list of device architectures.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 8, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — Although the diff is small and leaves builds without reactNativeArchitectures unchanged, it wires the property into the terminal’s CMake/NDK path, changing which ABIs are compiled and packaged. This build-pipeline filtering warrants review across the supported architecture combinations.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: cecd6bcd-57da-43a8-ae99-da111f5bb1af

📥 Commits

Reviewing files that changed from the base of the PR and between 134b719 and 6aaa461.

📒 Files selected for processing (1)
  • apps/mobile/modules/t3-terminal/android/build.gradle

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Android library now reads the reactNativeArchitectures Gradle property and applies its comma-separated values as NDK abiFilters when the property is non-empty.

Changes

Android build configuration

Layer / File(s) Summary
Configure React Native ABI filters
apps/mobile/modules/t3-terminal/android/build.gradle
The defaultConfig block conditionally reads reactNativeArchitectures, splits the value on commas, and configures NDK ABI filters.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 6aaa4

The terminal Android module now builds only requested native ABIs when configured, while retaining default ABI behavior otherwise. The change is ready to merge with minimal current risk.

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: honoring requested terminal native architectures in the mobile build.
Description check ✅ Passed The description explains what changed, why it changed, validation results, preserved default behavior, and checklist status. It is focused and sufficiently complete; UI changes are explicitly marked a…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@bompus

bompus commented Sep 8, 2026

Copy link
Copy Markdown
Author

Answering the approvability hold, since the concern is about ABI coverage rather than a defect in the diff.

The property has exactly one producer in this repo, scripts/mobile-showcase.ts:747:

...(abis.length > 0 ? [`-PreactNativeArchitectures=${abis.join(",")}`] : []),

so the value is always a comma-joined list with no spaces and no empty elements.

Those ABIs come from real attached devices, not a static matrix — scripts/mobile-showcase.ts:1420-1426 builds androidAbis from capture.device.abi for android captures and dedupes through a Set. Every element is a genuine ABI string reported by a device, and the list is 1..n devices long.

The no-property path is provably unchanged. When no android device is captured, abis is empty and line 747 omits the flag entirely; findProperty then returns null, the if is false, and no abiFilters block is emitted at all. -PreactNativeArchitectures= (empty string) takes the same path, since an empty string is falsy in Groovy.

The shape matches the React Native template verbatim — same findProperty read, same truthiness guard, same split(","), same spread into abiFilters, same defaultConfig.ndk placement:

def reactNativeArchitectures() {
    def value = project.getProperties().get("reactNativeArchitectures")
    return value ? value.split(",") : ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
}
...
ndk { abiFilters (*reactNativeArchitectures()) }

RN does not trim elements either, so this does not introduce a handling difference from the framework convention.

On the bug being fixed: abiFilters appears nowhere else in the repo. Without this, the t3-terminal native module compiles and packages every ABI even when the build was asked for a single device's ABI — wasted CMake work, and an APK whose native payload does not match the requested set.

One deliberate omission: split(',') does not tolerate spaces, so a hand-typed -PreactNativeArchitectures="arm64-v8a, x86_64" would yield the invalid ABI " x86_64". I left that alone rather than add *.trim().findAll { it }, since no caller in the repo does it and trimming would deviate from the RN convention above. Happy to add it if you would rather be defensive about manual gradlew invocations.

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant