From 6d0b498afdad04ceada6b6a2b9c65de28a9cf13d Mon Sep 17 00:00:00 2001 From: Abhijeet Kandalkar Date: Fri, 23 May 2025 02:01:58 +0530 Subject: [PATCH] Disable fuzztest subprocess library on Apple tvOS On tvOS, creating child processes is forbidden at an API level, so the posix_spawn_* functions used by FuzzTest in the subprocess code cause build errors. This change disables the subprocess library on Apple tvOS to avoid calling unsupported functions. This isssue is similar to b222049 Co-Authored-By: kubo@igalia.com --- fuzztest/internal/subprocess.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fuzztest/internal/subprocess.cc b/fuzztest/internal/subprocess.cc index a670bd7a0..fe7fb1e76 100644 --- a/fuzztest/internal/subprocess.cc +++ b/fuzztest/internal/subprocess.cc @@ -34,6 +34,10 @@ #include #include +#if defined(__APPLE__) +#include +#endif + #include "absl/container/flat_hash_map.h" #include "absl/functional/function_ref.h" #include "absl/strings/str_cat.h" @@ -49,8 +53,10 @@ extern char** environ; namespace fuzztest::internal { -#if !defined(_MSC_VER) && !(defined(__ANDROID_MIN_SDK_VERSION__) && \ - __ANDROID_MIN_SDK_VERSION__ < 28) +#if !defined(_MSC_VER) && \ + !(defined(__ANDROID_MIN_SDK_VERSION__) && \ + __ANDROID_MIN_SDK_VERSION__ < 28) && \ + !(defined(TARGET_OS_TV) && TARGET_OS_TV) TerminationStatus::TerminationStatus(int status) : status_(status) {} @@ -335,6 +341,9 @@ TerminationStatus RunCommandWithOutputCallbacks( FUZZTEST_INTERNAL_CHECK( false, "Subprocess library not implemented on older Android NDK versions yet"); +#elif defined(TARGET_OS_TV) && TARGET_OS_TV + FUZZTEST_INTERNAL_CHECK( + false, "Subprocess library not implemented on Apple tvOS yet"); #else SubProcess proc; return proc.Run(command_line, on_stdout_output, on_stderr_output, environment,