From 70281d6d0e5f60a040195517bcf3d5cd3fc2276b Mon Sep 17 00:00:00 2001 From: Alan Hughes Date: Tue, 21 Apr 2026 03:58:20 -0700 Subject: [PATCH] Skip use-hermes-nightly when hermes-compiler is already pinned (#56505) Summary: `use-hermes-nightly` unconditionally overwrites the `hermes-compiler` with whatever the `latest-v1` tag currently points to. On release branches, where `hermes-compiler` is pinned to a specific version, it replaces the pin. This doesn't cause an issue until the `latest-v1` tag moves off the pinned version. Looks to have been introduced by https://github.com/facebook/react-native/issues/53837. bypass-github-export-checks ## Changelog: [INTERNAL] [FIXED] - Preserve pinned `hermes-compiler` version when running `use-hermes-nightly` on release branches. Pull Request resolved: https://github.com/facebook/react-native/pull/56505 Test Plan: With `hermes-compiler` manually set to a real version, the script returns early without modifying `package.json` or `hermes-engine/version.properties`. Reviewed By: cortinico Differential Revision: D101633376 Pulled By: cipolleschi fbshipit-source-id: 666baa1a7838272b18e326b8597394d66b81343c --- scripts/releases/use-hermes-nightly.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/releases/use-hermes-nightly.js b/scripts/releases/use-hermes-nightly.js index 5dc782e93d1..24cad539552 100644 --- a/scripts/releases/use-hermes-nightly.js +++ b/scripts/releases/use-hermes-nightly.js @@ -10,9 +10,20 @@ 'use strict'; +const {getReactNativePackage} = require('../shared/monorepoUtils'); const {updateHermesVersionsToNightly} = require('./utils/hermes-utils'); async function main() { + const {packageJson} = await getReactNativePackage(); + const hermesCompilerVersion = packageJson.dependencies?.['hermes-compiler']; + + if (hermesCompilerVersion != null && hermesCompilerVersion !== '0.0.0') { + console.log( + `Skipping hermes nightly update: hermes-compiler is pinned to ${hermesCompilerVersion}`, + ); + return; + } + await updateHermesVersionsToNightly(); }