From 28d99e8e1c857a86f17ba33cda62f8e3c4d4add3 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 13 Jan 2026 05:30:31 -0800 Subject: [PATCH] Fix Hermes opt mode for local mac runs (#55138) Summary: 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] Differential Revision: D90536112 --- 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 495b2e5ecacc9a..bcc51cb56534cf 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