Page MenuHomePhabricator

[CI] update NDK to 23 and bump Corrosion
ClosedPublic

Authored by kamil on Mar 10 2025, 6:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 7, 11:28 PM
Unknown Object (File)
Fri, Apr 4, 9:07 PM
Unknown Object (File)
Thu, Apr 3, 5:05 PM
Unknown Object (File)
Thu, Apr 3, 9:50 AM
Unknown Object (File)
Mon, Mar 31, 11:26 PM
Unknown Object (File)
Fri, Mar 28, 5:17 PM
Unknown Object (File)
Mon, Mar 24, 9:12 PM
Unknown Object (File)
Sun, Mar 23, 4:34 PM
Subscribers
None

Details

Summary

ENG-10302


Android

The issue
There was a new, major version of rustup (1.28.0) with two breaking changes:

  1. rustup will no longer automatically install the active toolchain if it is not installed - this makes our CI to fail on most of our pipelines
  2. rustup show's output format has been cleaned up, making it easier to find out about your toolchains' status - this command is used by Corrosion, which we use to integrate Rust on Android

Fix for 1
In D14429, there is an example of how to do it explicitly, and it works, but because this major update caused many CI's to fail, there is a hotfix for this in 1.28.1

Fix for 2
To achieve that, we need to update Corrosion version to 0.5.1 which is prepared for new output format, v0.5.1.

Why NDK update?
We need to bump Corrosion from 0.2.1 to 0.5.1, which is a lot, and the minimal Rust version has been changed. According to this blog post, the minimum supported NDK version is 23. I took it from 0.71-stable. It should be fine as we're probably going to have 27 soon after the react-native upgrade (cc. @angelika). There is some context on this in D5900 (cc. @ashoat).


Commtest

It is going to be fixed, but in a not-yet published version 1.28.2, we can patch it by explicitly adding a target in the Dockerfile.

Test Plan

CI - not sure if I need to test something else; not familiar with Android configuration

Diff Detail

Repository
rCOMM Comm
Branch
fix-ci
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil edited the test plan for this revision. (Show Details)

Add the Rust target for ARM64 architecture

kamil edited the test plan for this revision. (Show Details)
kamil published this revision for review.Mar 10 2025, 7:16 AM
native/android/build.gradle
10

Wondering why we're regressing from 24 to 23 for aarch64 here. Does this make performance worse for M1 users?

CI - not sure if I need to test something else; not familiar with Android configuration

I think it would be good to check the Android app for both emulator and physical device targets, and play around with it a little bit just to make sure nothing is broken and performance isn't degraded

CI - not sure if I need to test something else; not familiar with Android configuration

I think it would be good to check the Android app for both emulator and physical device targets, and play around with it a little bit just to make sure nothing is broken and performance isn't degraded

Okay, makes sense

native/android/build.gradle
10

I did the same as react-native did for 0.71 compared to 0.70, so I think it is fine. It was done in this PR.

I can try doing 24 for aarch64 if diverging with react-native is okay

native/android/build.gradle
10

Ah, seems fine if React Native is doing it

native/android/build.gradle
10

I'm not sure if downgrading it from 24 to 23 for M users is ok. Maybe RN didn't support building on M1 at that time (0.71 was a bit ago)?
Also note that this is about what system are you using to build the project. The CI runs on Linux. Have you tried building the app on M1 machine?

Tested this on a physical device and emulator, everything seems to be fine

native/android/build.gradle
10

I tried building this on a physical device and an emulator on my M3 machine, in both dev and release modes, everything seems to work

This revision is now accepted and ready to land.Tue, Mar 11, 6:44 AM
This revision was automatically updated to reflect the committed changes.