Skip to content

Commit 45fb51c

Browse files
zeyapmeta-codesync[bot]
authored andcommitted
Fix bump-hermes-version.js to write hermes-v prefixed tag to .hermesv1version (#57619)
Summary: ## Changelog: [Internal] - Fix bump-hermes-version.js to write hermes-v prefixed tag to .hermesv1version `scripts/hermes/bump-hermes-version.js` fetches the **bare** `hermes-compiler` npm version (e.g. `250829098.0.16`) and wrote it verbatim into `packages/react-native/sdks/.hermesv1version` via `setHermesTag`. But `.hermesv1version` is consumed by the Android Gradle build as a **git ref** to download the Hermes source: ``` https://github.com/facebook/hermes/tarball/<ref> (ReactAndroid/hermes-engine/build.gradle.kts) ``` Release tags on `facebook/hermes` are named `hermes-v<version>` (e.g. `hermes-v250829098.0.16`). The bare value `250829098.0.16` is not a valid ref → **HTTP 404**, which breaks the `build_fantom_runner` / `downloadHermes` build. ### Fix Normalize so `.hermesv1version` gets the `hermes-v`-prefixed **git tag**, while the `hermes-compiler` / prebuilt dependency versions (npm + Maven `HERMES_VERSION_NAME`) stay **bare**. Handles both bare and already-prefixed input. Pull Request resolved: #57619 Test Plan: - `curl -sL -o /dev/null -w '%{http_code}' https://github.com/facebook/hermes/tarball/hermes-v250829098.0.16` → **200** (bare `250829098.0.16` → 404). - After running the bump: `.hermesv1version` = `hermes-v<version>`; `hermes-compiler` dep and `HERMES_VERSION_NAME` remain the bare version. Reviewed By: cortinico Differential Revision: D112846952 Pulled By: zeyap fbshipit-source-id: 47afc19dc486e6ceeab115c13534528a6a96ccba
1 parent 9195e52 commit 45fb51c

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

packages/react-native/scripts/hermes/bump-hermes-version.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ async function main() {
6060
return;
6161
}
6262

63-
await setHermesTag(hermesVersion);
64-
await updateHermesCompilerVersionInDependencies(hermesVersion);
65-
await updateHermesRuntimeDependenciesVersions(hermesVersion);
63+
// `.hermesv1version` is used as a git ref to download the Hermes source
64+
// (https://github.com/facebook/hermes/tarball/<ref>), where release tags are
65+
// named `hermes-v<version>`. While hermes-compiler and prebuilt dependencies
66+
// use the bare npm version.
67+
const bareVersion = hermesVersion.replace(/^hermes-v/, '');
68+
await setHermesTag(`hermes-v${bareVersion}`);
69+
await updateHermesCompilerVersionInDependencies(bareVersion);
70+
await updateHermesRuntimeDependenciesVersions(bareVersion);
6671
}
6772

6873
void main().then(() => {

0 commit comments

Comments
 (0)