Suppressing bad file descriptor errors on native builds

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
This commit is contained in:
Nicola Corti
2021-08-31 09:51:58 -07:00
committed by Facebook GitHub Bot
parent 2e8893fb5b
commit 24a9ef7384
+8 -2
View File
@@ -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",
@@ -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) {