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

limit Android NDK jobs on CI #19747

Closed
wants to merge 3 commits into from

Conversation

dulmandakh
Copy link
Contributor

@dulmandakh dulmandakh commented Jun 15, 2018

Limit number of NDK jobs of ReactAndroid on CI using $BUILD_THREADS environment variable. Otherwise, it was spawning 32 jobs while building RNTester, which caused in OOM or unexpected failure.

CI: https://circleci.com/gh/dulmandakh/react-native/322

Test Plan

Android CI is green again 😍

@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 Jun 15, 2018
@react-native-bot react-native-bot added ✅Test Plan Missing Changelog This PR appears to be missing a changelog, or they are incorrectly formatted. Platform: Android Android applications. labels Jun 15, 2018
@gengjiawen
Copy link
Contributor

aHa, That's why. My first thought is the gradle need more memeory.

@@ -221,7 +222,7 @@ task buildReactNdkLib(dependsOn: [prepareJSC, prepareBoost, prepareDoubleConvers
"THIRD_PARTY_NDK_DIR=$buildDir/third-party-ndk",
"REACT_COMMON_DIR=$projectDir/../ReactCommon",
'-C', file('src/main/jni/react/jni').absolutePath,
'--jobs', project.hasProperty("jobs") ? project.property("jobs") : Runtime.runtime.availableProcessors()
'--jobs', ndkJobs ?: project.hasProperty("jobs") ? project.property("jobs") : Runtime.runtime.availableProcessors()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With two ?: this looks a little confusing, maybe split it up. Are you revert to jobs if ndkJobs not defined ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one ?: which means

value ?: default 

then default value is ternary operator.

 '--jobs', ndkJobs ?: project.hasProperty("jobs") ? project.property("jobs") : Runtime.runtime.availableProcessors()

Means get ndkJobs value or check if project has "jobs" property then get it's value or Runtime.runtime.availableProcessors()

@dulmandakh
Copy link
Contributor Author

@hramos Please review and merge 😉

@dulmandakh
Copy link
Contributor Author

dulmandakh commented Jun 16, 2018

clean version #19755

@dulmandakh dulmandakh closed this Jun 16, 2018
@dulmandakh dulmandakh deleted the limit-ndk-jobs branch June 21, 2018 01:38
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. Missing Changelog This PR appears to be missing a changelog, or they are incorrectly formatted. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants