Skip to content

chore: do not build Hermes from source (-25% build time)#25035

Merged
sethkfman merged 2 commits intoMetaMask:chore/do-no-build-hermes-from-source-margelofrom
margelo:chore/do-no-build-hermes-from-source
Jan 22, 2026
Merged

chore: do not build Hermes from source (-25% build time)#25035
sethkfman merged 2 commits intoMetaMask:chore/do-no-build-hermes-from-source-margelofrom
margelo:chore/do-no-build-hermes-from-source

Conversation

@Nodonisko
Copy link
Copy Markdown
Contributor

@Nodonisko Nodonisko commented Jan 22, 2026

Description

We are patching only React Native Android source code so we don't need to build also Hermes engine which is adding lot of build time. On my machine it reduced build time by about 25% and I guess it could be even more on CI.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Uses prebuilt Hermes to avoid compiling the engine from source, reducing Android build time and setup complexity.

  • Patch React Native (ReactAndroid/build.gradle.kts) to depend on compileOnly("com.facebook.react:hermes-android:0.76.9") and drop the hermes-engine preBuild dependency
  • Remove hermes-engine includes/substitutions from RN settings.gradle.kts and app android/settings.gradle (resolve Hermes from Maven instead)
  • Update Yarn config: apply a new RN patch (.yarn/patches/react-native-patch-d76d50a92f.patch) via package.json and yarn.lock
  • Clean build script: delete ICU install step and its invocation in prebuild_android()

Written by Cursor Bugbot for commit 096aebf. This will update automatically on new commits. Configure here.

@Nodonisko Nodonisko requested a review from a team as a code owner January 22, 2026 12:58
@github-actions
Copy link
Copy Markdown
Contributor

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.

@Nodonisko Nodonisko changed the title chore: do not build Hermes from source chore: do not build Hermes from source (-25% build time) Jan 22, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

}

installICULibraries(){
# Install ICU libraries for Hermes
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Redundant ICU installation steps remain in CI configuration

Low Severity

The installICULibraries function was removed from scripts/build.sh because Hermes is now fetched from Maven Central instead of built from source. However, bitrise.yml still contains two CI steps that install ICU libraries explicitly titled "Install ICU libraries for Hermes" (lines 2248-2254 and 2433-2439). These steps are now redundant and add unnecessary time to CI builds, partially negating the build time improvements this PR aims to achieve.

Fix in Cursor Fix in Web

@sethkfman sethkfman changed the base branch from main to chore/do-no-build-hermes-from-source-margelo January 22, 2026 16:18
@sethkfman sethkfman merged commit c6e4dbc into MetaMask:chore/do-no-build-hermes-from-source-margelo Jan 22, 2026
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants