From e5c768b5f2788dc52bb08567f50304ce77036d31 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 28 Oct 2026 15:00:19 -0700 Subject: [PATCH] Make Hermes source archive extraction repository-agnostic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Download Hermes sources from the canonical `meta/hermes` repository and strip the archive’s top-level directory without matching its owner or repository name. This keeps `CMakeLists.txt` at the expected source root after repository moves; exclude empty directories so the archive wrapper is not recreated. Changelog: [Android][Fixed] - Fix Hermes source builds after the Hermes repository move Differential Revision: D128177063 --- .../ReactAndroid/hermes-engine/build.gradle.kts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts index 7db67e79333a..74fedb432fcc 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts @@ -104,7 +104,7 @@ val downloadHermes by tasks.registering(Download::class) { src( providers.provider { - "https://github.com/facebook/hermes/tarball/${hermesVersionProvider.get()}" + "https://github.com/meta/hermes/tarball/${hermesVersionProvider.get()}" }, ) onlyIfModified(true) @@ -119,13 +119,8 @@ val unzipHermes by tasks.registering(Copy::class) { dependsOn(downloadHermes) from(tarTree(downloadHermesDest)) { - eachFile { - // We flatten the unzip as the tarball contains a `facebook-hermes-` - // folder at the top level. - if (this.path.startsWith("facebook-hermes-")) { - this.path = this.path.substringAfter("/") - } - } + eachFile { path = path.substringAfter("/") } + includeEmptyDirs = false } into(hermesDir) }