-
Notifications
You must be signed in to change notification settings - Fork 24.7k
limit Android NDK jobs on CI #19747
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
Conversation
aHa, That's why. My first thought is the gradle need more memeory. |
ReactAndroid/build.gradle
Outdated
@@ -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() |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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()
@hramos Please review and merge 😉 |
clean version #19755 |
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 😍