Skip to content

Commit

Permalink
Suppressing bad file descriptor errors on native builds
Browse files Browse the repository at this point in the history
Summary:
When running native builds, we experience a lot of
bad file descriptor warnings. This diff is suppressing the issue on local builds (on Mac).

Changelog:
[Internal] [Changed] - Suppressed bad file descriptor on native builds

Reviewed By: ShikaSD

Differential Revision: D30487098

fbshipit-source-id: 8199fb8f2f18d19543d2861f1f2f852fff6ae73b
  • Loading branch information
cortinico authored and facebook-github-bot committed Aug 31, 2021
1 parent 2e8893f commit 24a9ef7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
inputs.dir("src/main/java/com/facebook/react/turbomodule/core/jni")
inputs.dir("src/main/java/com/facebook/react/modules/blob")
outputs.dir("$buildDir/react-ndk/all")
commandLine(getNdkBuildFullPath(),
def commandLineArgs = [
getNdkBuildFullPath(),
"APP_ABI=${reactNativeArchitectures()}",
"NDK_DEBUG=" + (nativeBuildType.equalsIgnoreCase("debug") ? "1" : "0"),
"NDK_PROJECT_PATH=null",
Expand All @@ -375,7 +376,12 @@ def buildReactNdkLib = tasks.register("buildReactNdkLib", Exec) {
"REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react",
"-C", file("src/main/jni/react/jni").absolutePath,
"--jobs", project.findProperty("jobs") ?: Runtime.runtime.availableProcessors()
)
]
if (Os.isFamily(Os.FAMILY_MAC)) {
// This flag will suppress "fcntl(): Bad file descriptor" warnings on local builds.
commandLineArgs.add("--output-sync=none")
}
commandLine(commandLineArgs)
}

def cleanReactNdkLib = tasks.register("cleanReactNdkLib", Exec) {
Expand Down

0 comments on commit 24a9ef7

Please sign in to comment.