From bef5cc100771c3b8bc5dffa565b7c24fef3eb34d Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Thu, 24 Apr 2025 06:15:42 -0700 Subject: [PATCH] fix: build proper hermes for all debug variants (#50897) Summary: When building hermes from source in a project that has a debug scheme not named strictly "Debug", hermes is built with wrong flags which makes the compilation fail. We should use a better check for such cases, analogous to https://github.com/facebook/react-native/blob/ec43150b2a8db3a93137ae69ac414859a2fff73e/packages/react-native/scripts/react-native-xcode.sh#L16. I haven't found any other usages of this pattern: https://github.com/search?q=repo%3Afacebook%2Freact-native%20%24CONFIGURATION&type=code, hopefully other places use the correct semantics already. ## Changelog: [IOS] [FIXED] - properly check for debug schemes when building hermes from source Pull Request resolved: https://github.com/facebook/react-native/pull/50897 Test Plan: Use e.g. https://github.com/martinlAP/keyboardcrash with `Dev-Debug` scheme and try to build hermes from source based on https://github.com/facebook/hermes/blob/rn/0.79-stable/doc/ReactNativeIntegration.md. to see that it fails without this PR. Reviewed By: rshest Differential Revision: D73579031 Pulled By: cortinico fbshipit-source-id: 3a48c6fe63f78fbc9cf566d300b9518aa9abdd89 --- .../sdks/hermes-engine/utils/build-hermes-xcode.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh b/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh index 88ddd365932..b1ac920f395 100755 --- a/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh +++ b/packages/react-native/sdks/hermes-engine/utils/build-hermes-xcode.sh @@ -37,12 +37,12 @@ function get_deployment_target { } enable_debugger="false" -if [[ "$CONFIGURATION" == "Debug" ]]; then +if [[ "$CONFIGURATION" = *Debug* ]]; then enable_debugger="true" fi cmake_build_type="" -if [[ $CONFIGURATION == "Debug" ]]; then +if [[ "$CONFIGURATION" = *Debug* ]]; then # JS developers aren't VM developers. # Therefore we're passing as build type Release, to provide a faster build. cmake_build_type="Release"