From 1d3cad0d98c391e3a6cee53087772a0c2f636d67 Mon Sep 17 00:00:00 2001 From: "jh.xiong" Date: Sat, 31 Oct 2026 16:10:51 +0800 Subject: [PATCH] Name the Hermes source archive after the Hermes version The archive is always downloaded to `downloadsDir/hermes.tar.gz`, so every Hermes version shares one destination file while `build/download-task/etags.json` remembers an ETag per URL. After a build has already seen a version's tarball URL, switching back to it answers 304 and the download is skipped, leaving the other version's bytes on disk and building the wrong Hermes source. Name the archive `hermes-.tar.gz`, the way the other third-party sources in that directory are named. --- .../ReactAndroid/hermes-engine/build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts index 74fedb432fc..c480b52262b 100644 --- a/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts +++ b/packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts @@ -99,7 +99,11 @@ val prefabHeadersDir = File("$buildDir/prefab-headers") // CMake reads the backslashes of a Windows path as escape sequences, so we pass forward slashes. val jsiDir = File(reactNativeRootDir, "ReactCommon/jsi") -val downloadHermesDest = File(downloadsDir, "hermes.tar.gz") +// Naming the tarball after the Hermes version lets `downloadsDir` hold more than one Hermes +// version, like it already does for the other third-party sources. Release tags are +// `hermes-v`, so that prefix is stripped to keep the name at `hermes-.tar.gz`. +val hermesTarballName = "hermes-${hermesVersionProvider.get().removePrefix("hermes-v")}.tar.gz" +val downloadHermesDest = File(downloadsDir, hermesTarballName) val downloadHermes by tasks.registering(Download::class) { src(