Skip to content

Commit

Permalink
Disable fuzztest subprocess library on Android.
Browse files Browse the repository at this point in the history
In Chromium, we build against an older version of the Android NDK for compatibility with older Android devices. That version seems to lack the posix_spawnp APIs that are required by FuzzTest's subprocess library.

Disable the subprocess library on such systems.

PiperOrigin-RevId: 577169201
  • Loading branch information
FuzzTest Team authored and copybara-github committed Oct 31, 2023
1 parent 55cf0e9 commit a414a3c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fuzztest/internal/subprocess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

namespace fuzztest::internal {

#if !defined(_MSC_VER)
#if !defined(_MSC_VER) && !(defined(__ANDROID_MIN_SDK_VERSION__) && \
__ANDROID_MIN_SDK_VERSION__ < 28)

TerminationStatus::TerminationStatus(int status) : status_(status) {}

Expand Down Expand Up @@ -288,7 +289,8 @@ RunResults SubProcess::Run(
return {TerminationStatus(status.get()), stdout_output, stderr_output};
}

#endif // !defined(_MSC_VER)
#endif // !defined(_MSC_VER) && !(defined(__ANDROID_MIN_SDK_VERSION__) &&
// __ANDROID_MIN_SDK_VERSION__ < 28)

RunResults RunCommand(
const std::vector<std::string>& command_line,
Expand All @@ -297,6 +299,10 @@ RunResults RunCommand(
#if defined(_MSC_VER)
FUZZTEST_INTERNAL_CHECK(false,
"Subprocess library not implemented on Windows yet.");
#elif defined(__ANDROID_MIN_SDK_VERSION__) && __ANDROID_MIN_SDK_VERSION__ < 28
FUZZTEST_INTERNAL_CHECK(
false,
"Subprocess library not implemented on older Android NDK versions yet");
#else
SubProcess proc;
return proc.Run(command_line, environment, timeout);
Expand Down

0 comments on commit a414a3c

Please sign in to comment.