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

Slow build process due to static analyzer #11107

Closed
oNaiPs opened this issue Nov 24, 2016 · 4 comments
Closed

Slow build process due to static analyzer #11107

oNaiPs opened this issue Nov 24, 2016 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@oNaiPs
Copy link
Contributor

oNaiPs commented Nov 24, 2016

Description

When building either for Debug or Release configurations, static analyzer also runs making the builds run for much longer.
This xcode flag makes React source files to be compiled twice, which doubles build time (if you don't have any native code in the project).

Reproduction

  1. Create a project with react-native init myproject
  2. Build the project
    3 . Observe Analyzing files when building.

screen shot 2016-11-23 at 10 08 18 pm

Solution

Analyze During 'Build' xcode configuration should be off.

Additional Information

  • React Native version: 0.38
  • Platform: iOS
  • Operating System: MacOS
@mkonicek
Copy link
Contributor

There's an alternative: use react-native run-ios from the command line if you only write JS. That way Xcode is not running and no code is being analyzed.

@oNaiPs
Copy link
Contributor Author

oNaiPs commented Nov 24, 2016

@mkonicek I don't only write JS (our codebase has over 30 source files and counting).
I'm making a case for it because if you put this into CI you have a couple minutes overhead for nothing.

Is there any use case for the developers doing the Analyze of react source code files? It seems to me it would only be interesting for people modifying the SDK.

@gastonmorixe
Copy link

I added this in package.json to stop static analyzer

  "scripts": {
   ...
    "postinstall": "sed -i '' '/RUN_CLANG_STATIC_ANALYZER/d;/CLANG_STATIC_ANALYZER_MODE/d;/CLANG_ANALYZER_NONNULL/d' ./node_modules/react-native/React/React.xcodeproj/project.pbxproj"
  }

@oNaiPs
Copy link
Contributor Author

oNaiPs commented Jan 15, 2018

@gastonmorixe thanks for your input. I ended up doing something similar 👍

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants