From bc8970ec9e3fdd3440ccb66e205587d886a7f8e4 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 13 Jan 2026 06:40:10 -0800 Subject: [PATCH] Fix Hermes opt mode for local mac runs (#55138) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55138 Some tests were failing locally on Mac, since //arvr/mode/mac-arm/opt doesn't correctly undefine REACT_NATIVE_DEBUG. Use `//xplat/mode/hermes/opt` as a short-cut since that directly defines rn_build_mode. Changelog: [Internal] Reviewed By: zeyap Differential Revision: D90536112 fbshipit-source-id: 55aeb78970c9d210206a6d86cd3e57d55b0a6396 --- private/react-native-fantom/runner/utils.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/private/react-native-fantom/runner/utils.js b/private/react-native-fantom/runner/utils.js index 495b2e5ecac..bcc51cb5653 100644 --- a/private/react-native-fantom/runner/utils.js +++ b/private/react-native-fantom/runner/utils.js @@ -54,8 +54,12 @@ export function getHermesCompilerTarget(variant: HermesVariant): string { export function getBuckModesForPlatform( enableRelease: boolean = false, ): $ReadOnlyArray { - let mode = enableRelease ? 'opt' : 'dev'; + let modes = ['@//xplat/mode/react-native/granite']; + if (enableRelease) { + modes.push('@//xplat/mode/hermes/opt'); + } + let mode = enableRelease ? 'opt' : 'dev'; if (enableRelease) { if (EnvironmentOptions.enableASAN || EnvironmentOptions.enableTSAN) { printConsoleLog({ @@ -101,7 +105,8 @@ export function getBuckModesForPlatform( throw new Error(`Unsupported platform: ${os.platform()}`); } - return ['@//xplat/mode/react-native/granite', osPlatform]; + modes.push(osPlatform); + return modes; } // TODO: T240293839 Remove when we get rid of RN_USE_ANIMATION_BACKEND preprocessor flag