Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Upgrade jsc-android from 250230.2.1 to 294992.0.0 (@next) for BigInt #6314

Closed
wants to merge 5 commits into from

Conversation

leotm
Copy link
Member

@leotm leotm commented May 2, 2023

Description

294992.0.0 prevents need for an Android BigInt shim e.g. big-integer, till we've shipped the RN 0.71.6 Hermes upg

294992.0.0 also prevents need for (further pos) BE patches, till we've shipped the RN 0.71.6 Hermes upg

But 294992.0.0 results in below build error specific to our repo,
pos more deps needing resolving/patching (whackamole'ing)

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source. Android gradle plugin: 4.2.2
Gradle: 6.9

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings Error: Command failed: ./gradlew app:installProdDebug -PreactNativeDevServerPort=8081 OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/leo/Documents/GitHub/metamask-mobile/node_modules/react-native-reanimated/android/build.gradle' line: 1059

* What went wrong: A problem occurred evaluating project ':react-native-reanimated'.
> Expected directory '/Users/leo/Documents/GitHub/metamask-mobile/node_modules/react-native/../jsc-android/dist/org/webkit/android-jsc' to contain exactly one file, however, it contains no files.

Regardless 294992.0.0 was worth this brief exploration, efforts looking best continued on

Screenshots/Recordings

If applicable, add screenshots and/or recordings to visualize the before and after of your change

Issue

Progresses #???

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

- react-native-community/jsc-android-buildscripts#159 (comment)
- facebook/react-native#35504 (comment)
- vanilla RN 0.71.6 tested working: 1n+2n, BigInt(1)+BigInt(2)
- package.json>resolution not required (result: resolution field incompatible)
- org.webkit:android-jsc-intl:+ required (which we're already using)

294992.0.0 prevents need for e.g. `big-integer` shim, till RN 0.71.6 shipped
#6221

294992.0.0 prevents need for BE patches, till RN 0.71.6 upgrade shipped
e.g. #6305 cc @Cal-L

But (the catch) 294992.0.0 results in repo-specific dep build error,
possibly more deps to resolve, likely via patch(es):

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 4.2.2
Gradle: 6.9

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
Error: Command failed: ./gradlew app:installProdDebug -PreactNativeDevServerPort=8081
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/leo/Documents/GitHub/metamask-mobile/node_modules/react-native-reanimated/android/build.gradle' line: 1059

* What went wrong:
A problem occurred evaluating project ':react-native-reanimated'.
> Expected directory '/Users/leo/Documents/GitHub/metamask-mobile/node_modules/react-native/../jsc-android/dist/org/webkit/android-jsc' to contain exactly one file, however, it contains no files.
@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2023

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@socket-security
Copy link

socket-security bot commented May 2, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

@sethkfman
Copy link
Contributor

@leotm Do we need this PR anymore?

@socket-security
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
jsc-android 294992.0.0 None +0 30.1 MB kudochien

@leotm
Copy link
Member Author

leotm commented Jul 9, 2023

@leotm Do we need this PR anymore?

yes just to keep jsc-android (with BigInt) on ice (since enabling hermes-android in the upg)
and while we're still on React-jsc (on iOS via pods i.e. hermes_enabled => false)
and onto final 3 SES issues (Hermes initial investigation complete, now onto the work)

@leotm
Copy link
Member Author

leotm commented Jul 9, 2023

i merged in the upg (main) and started seeing a bootup runtime crash which investigated

initial emulator -avd Pixel_5_API_30 Flipper Crash Reporter logs:

FATAL EXCEPTION: main
Process: io.metamask, PID: 3551
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
	SoSource 0: com.facebook.soloader.DirectorySoSource[root = /data/app/~~A-t4yufOwBVj_Ee-8-qLcQ==/io.metamask--FLEaXAO631AWOo8BJGXyA==/lib/arm64 flags = 0]
	SoSource 1: com.facebook.soloader.DirectApkSoSource[root = (/data/app/~~A-t4yufOwBVj_Ee-8-qLcQ==/io.metamask--FLEaXAO631AWOo8BJGXyA==/base.apk!/lib/arm64-v8a, )]
	SoSource 2: com.facebook.soloader.DirectorySoSource[root = /system/lib64 flags = 2]
	SoSource 3: com.facebook.soloader.DirectorySoSource[root = /vendor/lib64 flags = 2]
	Native lib dir: /data/app/~~A-t4yufOwBVj_Ee-8-qLcQ==/io.metamask--FLEaXAO631AWOo8BJGXyA==/lib/arm64
 result: 0
	at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:1127)
	at com.facebook.soloader.SoLoader.loadLibraryBySoNameImpl(SoLoader.java:943)
	at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:855)
	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:802)
	at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:772)
	at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:26)
	at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
	at com.facebook.hermes.reactexecutor.HermesExecutor.loadLibrary(HermesExecutor.java:24)
	at com.facebook.react.ReactInstanceManagerBuilder.getDefaultJSExecutorFactory(ReactInstanceManagerBuilder.java:369)
	at com.facebook.react.ReactInstanceManagerBuilder.build(ReactInstanceManagerBuilder.java:316)
	at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:94)
	at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
	at io.metamask.MainApplication.onCreate(MainApplication.java:95)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7656)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

glad saved this the first time, as Flipper no longer seems to catch it

nb: https://stackoverflow.com/questions/57036317/react-native-java-lang-unsatisfiedlinkerror-couldnt-find-dso-to-load-libherm

@leotm
Copy link
Member Author

leotm commented Jul 9, 2023

i investigated briefly in a reproducer yday https://github.com/leotm/RN0721 unable to repro above runtime crash

but found the cause to be leotm/RN0721@f503de3 which got reverted during the RN upg - fixed here in 24fd57a

looking good now with prev 294992.0.0 build errors (in descreiption) fixed
after brief QA importing SRP, etc (screenshot)

@leotm leotm changed the title Test upgrading jsc-android from 250230.2.1 to 294992.0.0 (@next) for BigInt Upgrade jsc-android from _250230.2.1_ to 294992.0.0 (@next) for BigInt Jul 9, 2023
@leotm leotm changed the title Upgrade jsc-android from _250230.2.1_ to 294992.0.0 (@next) for BigInt Upgrade jsc-android from 250230.2.1 to 294992.0.0 (@next) for BigInt Jul 9, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jul 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@leotm leotm changed the title Upgrade jsc-android from 250230.2.1 to 294992.0.0 (@next) for BigInt feat: Upgrade jsc-android from 250230.2.1 to 294992.0.0 (@next) for BigInt Jul 10, 2023
@leotm
Copy link
Member Author

leotm commented Sep 14, 2023

Closing as merging into

@leotm leotm closed this Sep 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 14, 2023
@leotm leotm added the android Android specific issue label Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
android Android specific issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants