From e018027560d632627285d7fd8c11033c82206287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Wed, 5 Jul 2023 18:02:14 +0200 Subject: [PATCH] fix(xcode): Pass `hermesc` $EXTRA_COMPILER_ARGS as individual arguments If "$EXTRA_COMPILER_ARGS" is wrapped by `"` it will be passed to `hermesc` binary as one argument which will cause `Unknown command line argument` error when using `$SOURCEMAP_FILE` to generate Hermes source maps. ``` + EXTRA_COMPILER_ARGS='-O -output-source-map' + /Users/krystofwoldrich/repos/sentry-react-native/sample-new-architecture/ios/Pods/hermes-engine/destroot/bin/hermesc -emit-binary -max-diagnostic-width=80 '-O -output-source-map' -out /Users/krystofwoldrich/Library/Developer/Xcode/DerivedData/sampleNewArchitecture-dtnzzmpchfyuyyajisnbghavfleb/Build/Products/Release-iphonesimulator/sampleNewArchitecture.app/main.jsbundle /Users/krystofwoldrich/Library/Developer/Xcode/DerivedData/sampleNewArchitecture-dtnzzmpchfyuyyajisnbghavfleb/Build/Products/Release-iphonesimulator/main.jsbundle hermesc: Unknown command line argument '-O -output-source-map'. Try: '/Users/krystofwoldrich/repos/sentry-react-native/sample-new-architecture/ios/Pods/hermes-engine/destroot/bin/hermesc -help' ``` --- packages/react-native/scripts/react-native-xcode.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/scripts/react-native-xcode.sh b/packages/react-native/scripts/react-native-xcode.sh index 080ed233ec25be..7e2f1190771cb5 100755 --- a/packages/react-native/scripts/react-native-xcode.sh +++ b/packages/react-native/scripts/react-native-xcode.sh @@ -176,7 +176,7 @@ else if [[ $EMIT_SOURCEMAP == true ]]; then EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map" fi - "$HERMES_CLI_PATH" -emit-binary -max-diagnostic-width=80 "$EXTRA_COMPILER_ARGS" -out "$DEST/main.jsbundle" "$BUNDLE_FILE" + "$HERMES_CLI_PATH" -emit-binary -max-diagnostic-width=80 $EXTRA_COMPILER_ARGS -out "$DEST/main.jsbundle" "$BUNDLE_FILE" if [[ $EMIT_SOURCEMAP == true ]]; then HBC_SOURCEMAP_FILE="$DEST/main.jsbundle.map" "$NODE_BINARY" "$COMPOSE_SOURCEMAP_PATH" "$PACKAGER_SOURCEMAP_FILE" "$HBC_SOURCEMAP_FILE" -o "$SOURCEMAP_FILE"