From a0543d9328d868ccc8bde2feba6960e8abfe6d40 Mon Sep 17 00:00:00 2001 From: Hannah Shi Date: Thu, 2 May 2024 14:06:23 -0700 Subject: [PATCH] [ObjC] Support visionos (#36476) This should be able to unblock using grpc on vision os, will add tests later Closes #36476 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36476 from HannahShiSFB:support-visionos edbde32d230560bbbb6cabfb21d90242cc40387d PiperOrigin-RevId: 630173448 --- BUILD | 5 +++++ gRPC-C++.podspec | 1 + gRPC-Core.podspec | 1 + gRPC-ProtoRPC.podspec | 1 + gRPC-RxLibrary.podspec | 1 + gRPC.podspec | 6 ++++++ src/core/BUILD | 1 + src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec | 1 + src/objective-c/!ProtoCompiler-gRPCPlugin.podspec | 1 + src/objective-c/!ProtoCompiler.podspec | 1 + src/objective-c/BoringSSL-GRPC.podspec | 1 + src/objective-c/README.md | 1 + templates/gRPC-C++.podspec.template | 1 + templates/gRPC-Core.podspec.template | 1 + templates/gRPC-ProtoRPC.podspec.template | 1 + templates/gRPC-RxLibrary.podspec.template | 1 + templates/gRPC.podspec.template | 6 ++++++ .../!ProtoCompiler-gRPCCppPlugin.podspec.template | 1 + .../objective-c/!ProtoCompiler-gRPCPlugin.podspec.template | 1 + templates/src/objective-c/!ProtoCompiler.podspec.template | 1 + templates/src/objective-c/BoringSSL-GRPC.podspec.template | 1 + tools/internal_ci/helper_scripts/prepare_build_macos_rc | 2 +- 22 files changed, 36 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index 3f5dafb6c11..8fa3b398200 100644 --- a/BUILD +++ b/BUILD @@ -127,6 +127,11 @@ config_setting( values = {"apple_platform_type": "tvos"}, ) +config_setting( + name = "visionos", + values = {"apple_platform_type": "visionos"}, +) + config_setting( name = "watchos", values = {"apple_platform_type": "watchos"}, diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index fc0b9d7b912..89639734113 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -38,6 +38,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' s.requires_arc = false diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 892e42ba1b5..899134ecbfc 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -42,6 +42,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' s.requires_arc = false diff --git a/gRPC-ProtoRPC.podspec b/gRPC-ProtoRPC.podspec index 38a01605115..1e9d53cd623 100644 --- a/gRPC-ProtoRPC.podspec +++ b/gRPC-ProtoRPC.podspec @@ -37,6 +37,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' name = 'ProtoRPC' s.module_name = name diff --git a/gRPC-RxLibrary.podspec b/gRPC-RxLibrary.podspec index 36c6cac45e4..78653a71107 100644 --- a/gRPC-RxLibrary.podspec +++ b/gRPC-RxLibrary.podspec @@ -37,6 +37,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' name = 'RxLibrary' s.module_name = name diff --git a/gRPC.podspec b/gRPC.podspec index 9108c7d8eac..bc87111af0e 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -49,6 +49,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # Exposes the privacy manifest. Depended on by any subspecs containing # non-interface files. @@ -83,6 +84,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'Interface' do |ss| @@ -118,6 +120,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'GRPCCore' do |ss| @@ -155,6 +158,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'GRPCCoreCronet' do |ss| @@ -179,6 +183,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'InternalTesting' do |ss| @@ -191,5 +196,6 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end end diff --git a/src/core/BUILD b/src/core/BUILD index 8536fe347ed..ea798533546 100644 --- a/src/core/BUILD +++ b/src/core/BUILD @@ -2663,6 +2663,7 @@ grpc_cc_library( ], "//:ios": ["cf_event_engine"], "//:tvos": ["cf_event_engine"], + "//:visionos": ["cf_event_engine"], "//:watchos": ["cf_event_engine"], "//conditions:default": ["posix_event_engine"], }, diff --git a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec index b200ae805e5..10c1b8dac46 100644 --- a/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec @@ -106,6 +106,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # This is only for local development of the plugin: If the Podfile brings this pod from a local # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be diff --git a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec index 76747553b7d..83da675c87e 100644 --- a/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec +++ b/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec @@ -108,6 +108,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # Restrict the gRPC runtime version to the one supported by this plugin. s.dependency 'gRPC-ProtoRPC', v diff --git a/src/objective-c/!ProtoCompiler.podspec b/src/objective-c/!ProtoCompiler.podspec index 4fc4114e4b6..6fbf3181d00 100644 --- a/src/objective-c/!ProtoCompiler.podspec +++ b/src/objective-c/!ProtoCompiler.podspec @@ -114,6 +114,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # This is only for local development of protoc: If the Podfile brings this pod from a local # directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be diff --git a/src/objective-c/BoringSSL-GRPC.podspec b/src/objective-c/BoringSSL-GRPC.podspec index c237973e009..34bb565a76f 100644 --- a/src/objective-c/BoringSSL-GRPC.podspec +++ b/src/objective-c/BoringSSL-GRPC.podspec @@ -83,6 +83,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' name = 'openssl_grpc' diff --git a/src/objective-c/README.md b/src/objective-c/README.md index af88b7f6cf8..2f6103078a0 100644 --- a/src/objective-c/README.md +++ b/src/objective-c/README.md @@ -47,6 +47,7 @@ Pod::Spec.new do |s| s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # Base directory where the .proto files are. src = '.' diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 3231a52e24a..ffc8b75d415 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -122,6 +122,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' s.requires_arc = false diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template index 20a4c934855..5b7669aaacc 100644 --- a/templates/gRPC-Core.podspec.template +++ b/templates/gRPC-Core.podspec.template @@ -118,6 +118,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' s.requires_arc = false diff --git a/templates/gRPC-ProtoRPC.podspec.template b/templates/gRPC-ProtoRPC.podspec.template index 59004cf5cd8..1d335b84735 100644 --- a/templates/gRPC-ProtoRPC.podspec.template +++ b/templates/gRPC-ProtoRPC.podspec.template @@ -39,6 +39,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' name = 'ProtoRPC' s.module_name = name diff --git a/templates/gRPC-RxLibrary.podspec.template b/templates/gRPC-RxLibrary.podspec.template index 0cc7373659e..5e401fde86e 100644 --- a/templates/gRPC-RxLibrary.podspec.template +++ b/templates/gRPC-RxLibrary.podspec.template @@ -39,6 +39,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' name = 'RxLibrary' s.module_name = name diff --git a/templates/gRPC.podspec.template b/templates/gRPC.podspec.template index 0f098fcec3a..7867721d876 100644 --- a/templates/gRPC.podspec.template +++ b/templates/gRPC.podspec.template @@ -51,6 +51,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # Exposes the privacy manifest. Depended on by any subspecs containing # non-interface files. @@ -85,6 +86,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'Interface' do |ss| @@ -120,6 +122,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'GRPCCore' do |ss| @@ -157,6 +160,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'GRPCCoreCronet' do |ss| @@ -181,6 +185,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end s.subspec 'InternalTesting' do |ss| @@ -193,5 +198,6 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' end end diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template index 6c611939162..873f69e5d6c 100644 --- a/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler-gRPCCppPlugin.podspec.template @@ -108,6 +108,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # This is only for local development of the plugin: If the Podfile brings this pod from a local # directory using `:path`, CocoaPods won't download the zip file and so the plugin won't be diff --git a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template index 27bbe463ef5..6a3f72faebd 100644 --- a/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template @@ -110,6 +110,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # Restrict the gRPC runtime version to the one supported by this plugin. s.dependency 'gRPC-ProtoRPC', v diff --git a/templates/src/objective-c/!ProtoCompiler.podspec.template b/templates/src/objective-c/!ProtoCompiler.podspec.template index 80463e36ee3..b39e902eea2 100644 --- a/templates/src/objective-c/!ProtoCompiler.podspec.template +++ b/templates/src/objective-c/!ProtoCompiler.podspec.template @@ -116,6 +116,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' # This is only for local development of protoc: If the Podfile brings this pod from a local # directory using `:path`, CocoaPods won't download the zip file and so the compiler won't be diff --git a/templates/src/objective-c/BoringSSL-GRPC.podspec.template b/templates/src/objective-c/BoringSSL-GRPC.podspec.template index 7fc56ac912a..3e2f2c38f12 100644 --- a/templates/src/objective-c/BoringSSL-GRPC.podspec.template +++ b/templates/src/objective-c/BoringSSL-GRPC.podspec.template @@ -114,6 +114,7 @@ s.osx.deployment_target = '10.12' s.tvos.deployment_target = '12.0' s.watchos.deployment_target = '6.0' + s.visionos.deployment_target = '1.0' name = 'openssl_grpc' diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc index 54a999f149c..8b3de1ab8ff 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc @@ -99,7 +99,7 @@ then # cocoapods export LANG=en_US.UTF-8 # use "sudo" to avoid permission error on kokoro monterey image - time sudo gem install cocoapods --version 1.12.0 --no-document --user-install + time sudo gem install cocoapods --version 1.15.2 --no-document --user-install # pre-fetch cocoapods master repo's most recent commit only mkdir -p ~/.cocoapods/repos time git clone --depth 1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master