Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: repairs $EXTRA_COMPILER_ARGS error with multiple args #38147

Closed
wants to merge 1 commit into from

Conversation

fergusean
Copy link
Contributor

@fergusean fergusean commented Jul 1, 2023

Summary:

Fixes a regression added on merge of #37531 (though oddly I don't see it in #37531's diff, so perhaps added during conflict resolution?) where multiple arguments in $EXTRA_COMPILER_ARGS are now incorrectly wrapped in quotes, including RN's own sourcemap support:

runner@SeansMacBookGo sampleapp % /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/Pods/hermes-engine/destroot/bin/hermesc -emit-binary -max-diagnostic-width=80 '-O -output-source-map' -out /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/build/derived-data/Build/Intermediates.noindex/ArchiveIntermediates/sampleapp/BuildProductsPath/Release-iphoneos/sampleapp.app/main.jsbundle /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/build/derived-data/Build/Intermediates.noindex/ArchiveIntermediates/sampleapp/BuildProductsPath/Release-iphoneos/main.jsbundle
hermesc: Unknown command line argument '-O -output-source-map'.  Try: '/Users/runner/builds/y_x6gsp4/0/sampleapp/ios/Pods/hermes-engine/destroot/bin/hermesc -help'
hermesc: Did you mean '-output-source-map'?

Changelog:

[IOS] [FIXED] - Fix build error when there are multiple EXTRA_COMPILER_ARGS

Test Plan:

Removing the quotes and running the command results a successful run of hermesc (exit code 0 and the expected files produced).

@facebook-github-bot
Copy link
Contributor

Hi @fergusean!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 9,047,338 -3
android hermes armeabi-v7a 8,296,755 +0
android hermes x86 9,563,637 -2
android hermes x86_64 9,405,789 -3
android jsc arm64-v8a 9,606,059 -2
android jsc armeabi-v7a 8,732,778 -3
android jsc x86 9,693,094 -3
android jsc x86_64 9,939,391 -1

Base commit: a9bfd7b
Branch: main

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 1, 2023
@louiszawadzki
Copy link
Contributor

I have noticed the same issue as well, I cannot generate sourcemaps on iOS with RN 0.72.

I've applied the changes described here with the following test plan to further test this fix and can attest that it works:

  1. Create a new RN project using npx react-native@latest init SourcemapsDemoApp
  2. Add export SOURCEMAP_FILE=./main.jsbundle.map to the end of the ios/.xcode.env file
  3. Open the project on XCode with xed ios
  4. Change the XCode Scheme to set "Release" as build configuration
  5. Build the project
  6. The build fails
  7. Edit node_modules/react-native/scripts/react-native-xcode.sh with the content from this PR
  8. The build succeeds
  9. Remove the line from ios/.xcode.env and rebuild
  10. The build succeeds again

@cipolleschi
Copy link
Contributor

Thanks for noticing. It was a mistake on my side. I'm going to have this landed.

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

This pull request was successfully merged by @fergusean in 28f4eba.

When will my fix make it into a release? | Upcoming Releases

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 6, 2023
@github-actions github-actions bot added the Merged This PR has been merged. label Jul 6, 2023
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in 28f4eba.

kelset pushed a commit that referenced this pull request Jul 10, 2023
Summary:
Fixes a regression added [on merge of https://github.com/facebook/react-native/issues/37531](https://github.com/facebook/react-native/commit/260bcf7f1bf78022872eb2f40f33fb552a414809#diff-16a358d6a9dea8469bfdb899d0990df1c32b8c3b1149c86685bec81f50bd24beR179) (though oddly I don't see it in [#37531 diff](https://github.com/facebook/react-native/pull/37531/files#diff-16a358d6a9dea8469bfdb899d0990df1c32b8c3b1149c86685bec81f50bd24beR179), so perhaps added during conflict resolution?) where multiple arguments in `$EXTRA_COMPILER_ARGS` are now incorrectly wrapped in quotes, including RN's own sourcemap support:

```
runner@SeansMacBookGo sampleapp % /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/Pods/hermes-engine/destroot/bin/hermesc -emit-binary -max-diagnostic-width=80 '-O -output-source-map' -out /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/build/derived-data/Build/Intermediates.noindex/ArchiveIntermediates/sampleapp/BuildProductsPath/Release-iphoneos/sampleapp.app/main.jsbundle /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/build/derived-data/Build/Intermediates.noindex/ArchiveIntermediates/sampleapp/BuildProductsPath/Release-iphoneos/main.jsbundle
hermesc: Unknown command line argument '-O -output-source-map'.  Try: '/Users/runner/builds/y_x6gsp4/0/sampleapp/ios/Pods/hermes-engine/destroot/bin/hermesc -help'
hermesc: Did you mean '-output-source-map'?
```

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Fix build error when there are multiple EXTRA_COMPILER_ARGS

Pull Request resolved: #38147

Test Plan: Removing the quotes and running the command results a successful run of `hermesc` (exit code 0 and the expected files produced).

Reviewed By: rshest

Differential Revision: D47254412

Pulled By: cipolleschi

fbshipit-source-id: 96b71bb05c7a6939088816e76a9a2d02e89ed768
Kudo pushed a commit to expo/react-native that referenced this pull request Jul 11, 2023
…38147)

Summary:
Fixes a regression added [on merge of https://github.com/facebook/react-native/issues/37531](https://github.com/facebook/react-native/commit/260bcf7f1bf78022872eb2f40f33fb552a414809#diff-16a358d6a9dea8469bfdb899d0990df1c32b8c3b1149c86685bec81f50bd24beR179) (though oddly I don't see it in [facebook#37531 diff](https://github.com/facebook/react-native/pull/37531/files#diff-16a358d6a9dea8469bfdb899d0990df1c32b8c3b1149c86685bec81f50bd24beR179), so perhaps added during conflict resolution?) where multiple arguments in `$EXTRA_COMPILER_ARGS` are now incorrectly wrapped in quotes, including RN's own sourcemap support:

```
runner@SeansMacBookGo sampleapp % /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/Pods/hermes-engine/destroot/bin/hermesc -emit-binary -max-diagnostic-width=80 '-O -output-source-map' -out /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/build/derived-data/Build/Intermediates.noindex/ArchiveIntermediates/sampleapp/BuildProductsPath/Release-iphoneos/sampleapp.app/main.jsbundle /Users/runner/builds/y_x6gsp4/0/sampleapp/ios/build/derived-data/Build/Intermediates.noindex/ArchiveIntermediates/sampleapp/BuildProductsPath/Release-iphoneos/main.jsbundle
hermesc: Unknown command line argument '-O -output-source-map'.  Try: '/Users/runner/builds/y_x6gsp4/0/sampleapp/ios/Pods/hermes-engine/destroot/bin/hermesc -help'
hermesc: Did you mean '-output-source-map'?
```

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Fix build error when there are multiple EXTRA_COMPILER_ARGS

Pull Request resolved: facebook#38147

Test Plan: Removing the quotes and running the command results a successful run of `hermesc` (exit code 0 and the expected files produced).

Reviewed By: rshest

Differential Revision: D47254412

Pulled By: cipolleschi

fbshipit-source-id: 96b71bb05c7a6939088816e76a9a2d02e89ed768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants