From 8a65c9beb0e01d3170ac557a45f8b46fbbb847d1 Mon Sep 17 00:00:00 2001 From: Logan Shire Date: Mon, 24 Mar 2025 12:01:55 -0400 Subject: [PATCH 1/4] Fixup examples --- .bazelrc | 4 +- examples/grpc_example/.bazelrc | 4 + examples/grpc_example/MODULE.bazel | 2 + examples/grpc_example/Package.resolved | 88 ++++++++++----- examples/grpc_example/Package.swift | 7 +- examples/grpc_example/compilers/BUILD.bazel | 17 --- .../compilers/swift_proto_compiler_macros.bzl | 7 +- examples/grpc_example/do_test | 2 +- .../grpc_example/sources/client/BUILD.bazel | 3 + .../sources/client/client_main.swift | 70 +++++------- .../grpc_example/sources/common/BUILD.bazel | 14 +++ .../common/ClientRequest+Convenience.swift | 12 ++ .../common/ClientResponse+Convenience.swift | 105 ++++++++++++++++++ .../grpc_example/sources/server/BUILD.bazel | 3 + .../sources/server/server_main.swift | 65 +++++------ .../grpc_example/sources/test/BUILD.bazel | 15 --- .../sources/test/client_unit_test.swift | 102 ----------------- swiftpkg/internal/pkginfos.bzl | 14 ++- swiftpkg/internal/swiftpkg_build_files.bzl | 35 +++++- swiftpkg/tests/swiftpkg_build_files_tests.bzl | 15 ++- 20 files changed, 325 insertions(+), 259 deletions(-) create mode 100644 examples/grpc_example/sources/common/BUILD.bazel create mode 100644 examples/grpc_example/sources/common/ClientRequest+Convenience.swift create mode 100644 examples/grpc_example/sources/common/ClientResponse+Convenience.swift delete mode 100644 examples/grpc_example/sources/test/BUILD.bazel delete mode 100644 examples/grpc_example/sources/test/client_unit_test.swift diff --git a/.bazelrc b/.bazelrc index fd634aa27..b896ed665 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,7 +1,7 @@ # To update these lines, execute # `bazel run @rules_bazel_integration_test//tools:update_deleted_packages` -build --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/server,examples/grpc_example/sources/test,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example -query --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/server,examples/grpc_example/sources/test,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example +build --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/common,examples/grpc_example/sources/server,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/.build/checkouts/swift-syntax,examples/tca_example/.build/checkouts/swift-syntax/utils/bazel,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example +query --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/common,examples/grpc_example/sources/server,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/.build/checkouts/swift-syntax,examples/tca_example/.build/checkouts/swift-syntax/utils/bazel,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example # Import Shared settings import %workspace%/shared.bazelrc diff --git a/examples/grpc_example/.bazelrc b/examples/grpc_example/.bazelrc index 48dfa95fe..f247ec008 100644 --- a/examples/grpc_example/.bazelrc +++ b/examples/grpc_example/.bazelrc @@ -10,3 +10,7 @@ try-import %workspace%/../../local.bazelrc # GRPC requires C++17 or later. build --cxxopt='-std=c++17' build --host_cxxopt='-std=c++17' + +# Force building for macOS 15.0: +build --macos_minimum_os=15.0 +build --host_macos_minimum_os=15.0 \ No newline at end of file diff --git a/examples/grpc_example/MODULE.bazel b/examples/grpc_example/MODULE.bazel index e4b8ea80f..0b38fcc9c 100644 --- a/examples/grpc_example/MODULE.bazel +++ b/examples/grpc_example/MODULE.bazel @@ -49,5 +49,7 @@ use_repo( "swift_deps_info", "swift_package", "swiftpkg_grpc_swift", + "swiftpkg_grpc_swift_nio_transport", + "swiftpkg_grpc_swift_protobuf", "swiftpkg_swift_protobuf", ) diff --git a/examples/grpc_example/Package.resolved b/examples/grpc_example/Package.resolved index 1f9a5bd51..f3340feab 100644 --- a/examples/grpc_example/Package.resolved +++ b/examples/grpc_example/Package.resolved @@ -5,8 +5,35 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/grpc/grpc-swift.git", "state" : { - "revision" : "4ab02e1ae5b4dfdd723773e955b62f35ccbaa7c7", - "version" : "1.16.0" + "revision" : "384a8dbb494f14e86d8b9d1a38d96b01a35933c7", + "version" : "2.1.0" + } + }, + { + "identity" : "grpc-swift-nio-transport", + "kind" : "remoteSourceControl", + "location" : "https://github.com/grpc/grpc-swift-nio-transport.git", + "state" : { + "revision" : "803769ec6ff5aac75d951cfabb4273bc255420d5", + "version" : "1.0.1" + } + }, + { + "identity" : "grpc-swift-protobuf", + "kind" : "remoteSourceControl", + "location" : "https://github.com/grpc/grpc-swift-protobuf.git", + "state" : { + "revision" : "63982ca29f11d2c6a7e559c1899fee812dd55cd9", + "version" : "1.1.0" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "87e50f483c54e6efd60e885f7f5aa946cee68023", + "version" : "1.2.1" } }, { @@ -23,26 +50,26 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", - "version" : "1.1.0" + "revision" : "671108c96644956dddcd89dd59c203dcdb36cec7", + "version" : "1.1.4" } }, { - "identity" : "swift-http-types", + "identity" : "swift-http-structured-headers", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-http-types", + "location" : "https://github.com/apple/swift-http-structured-headers.git", "state" : { - "revision" : "12358d55a3824bd5fed310b999ea8cf83a9a1a65", - "version" : "1.0.3" + "revision" : "d01361d32e14ae9b70ea5bd308a3794a198a2706", + "version" : "1.2.0" } }, { - "identity" : "swift-log", + "identity" : "swift-http-types", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-log.git", + "location" : "https://github.com/apple/swift-http-types.git", "state" : { - "revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5", - "version" : "1.5.4" + "revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3", + "version" : "1.3.1" } }, { @@ -50,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio.git", "state" : { - "revision" : "fc63f0cf4e55a4597407a9fc95b16a2bc44b4982", - "version" : "2.64.0" + "revision" : "c51907a839e63ebf0ba2076bba73dd96436bd1b9", + "version" : "2.81.0" } }, { @@ -59,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-extras.git", "state" : { - "revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63", - "version" : "1.22.0" + "revision" : "00f3f72d2f9942d0e2dc96057ab50a37ced150d4", + "version" : "1.25.0" } }, { @@ -68,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-http2.git", "state" : { - "revision" : "0904bf0feb5122b7e5c3f15db7df0eabe623dd87", - "version" : "1.30.0" + "revision" : "170f4ca06b6a9c57b811293cebcb96e81b661310", + "version" : "1.35.0" } }, { @@ -77,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-ssl.git", "state" : { - "revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5", - "version" : "2.26.0" + "revision" : "0cc3528ff48129d64ab9cab0b1cd621634edfc6b", + "version" : "2.29.3" } }, { @@ -86,8 +113,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-nio-transport-services.git", "state" : { - "revision" : "6cbe0ed2b394f21ab0d46b9f0c50c6be964968ce", - "version" : "1.20.1" + "revision" : "3c394067c08d1225ba8442e9cffb520ded417b64", + "version" : "1.23.1" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics.git", + "state" : { + "revision" : "e0ec0f5f3af6f3e4d5e7a19d2af26b481acb6ba8", + "version" : "1.0.3" } }, { @@ -95,8 +131,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-protobuf.git", "state" : { - "revision" : "88c7d15e1242fdb6ecbafbc7926426a19be1e98a", - "version" : "1.20.2" + "revision" : "d72aed98f8253ec1aa9ea1141e28150f408cf17f", + "version" : "1.29.0" } }, { @@ -104,8 +140,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-system.git", "state" : { - "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", - "version" : "1.2.1" + "revision" : "a34201439c74b53f0fd71ef11741af7e7caf01e1", + "version" : "1.4.2" } } ], diff --git a/examples/grpc_example/Package.swift b/examples/grpc_example/Package.swift index fd3013f6c..b5163a395 100644 --- a/examples/grpc_example/Package.swift +++ b/examples/grpc_example/Package.swift @@ -5,8 +5,9 @@ import PackageDescription let package = Package( name: "grpc_example", dependencies: [ - // These are the versions used by rules_swift 1.18.0 - .package(url: "https://github.com/grpc/grpc-swift.git", exact: "1.16.0"), - .package(url: "https://github.com/apple/swift-protobuf.git", exact: "1.20.2"), + .package(url: "https://github.com/grpc/grpc-swift.git", exact: "2.1.0"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", exact: "1.1.0"), + .package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", exact: "1.0.1"), + .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.28.1"), ] ) diff --git a/examples/grpc_example/compilers/BUILD.bazel b/examples/grpc_example/compilers/BUILD.bazel index 91e93d008..491da7bce 100644 --- a/examples/grpc_example/compilers/BUILD.bazel +++ b/examples/grpc_example/compilers/BUILD.bazel @@ -1,4 +1,3 @@ -load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load( "@build_bazel_rules_swift//proto:proto.bzl", "swift_proto_compiler", @@ -7,7 +6,6 @@ load( "//compilers:swift_proto_compiler_macros.bzl", "GRPC_VARIANT_CLIENT", "GRPC_VARIANT_SERVER", - "GRPC_VARIANT_TEST_CLIENT", "PROTO_PLUGIN_OPTIONS", "PROTO_PLUGIN_OPTION_ALLOWLIST", "make_grpc_swift_proto_compiler", @@ -40,18 +38,3 @@ make_grpc_swift_proto_compiler( name = "swift_client_proto", variants = [GRPC_VARIANT_CLIENT], ) - -make_grpc_swift_proto_compiler( - name = "swift_test_client_proto", - variants = [GRPC_VARIANT_TEST_CLIENT], -) - -bzl_library( - name = "swift_proto_compiler_macros", - srcs = ["swift_proto_compiler_macros.bzl"], - visibility = ["//visibility:public"], - deps = [ - "@bazel_skylib//lib:dicts", - "@build_bazel_rules_swift//swift", - ], -) diff --git a/examples/grpc_example/compilers/swift_proto_compiler_macros.bzl b/examples/grpc_example/compilers/swift_proto_compiler_macros.bzl index 44482930b..bc460fb99 100644 --- a/examples/grpc_example/compilers/swift_proto_compiler_macros.bzl +++ b/examples/grpc_example/compilers/swift_proto_compiler_macros.bzl @@ -36,11 +36,9 @@ PROTO_PLUGIN_OPTIONS = { } GRPC_VARIANT_SERVER = "Server" GRPC_VARIANT_CLIENT = "Client" -GRPC_VARIANT_TEST_CLIENT = "TestClient" GRPC_VARIANTS = [ GRPC_VARIANT_SERVER, GRPC_VARIANT_CLIENT, - GRPC_VARIANT_TEST_CLIENT, ] GRPC_PLUGIN_OPTION_ALLOWLIST = PROTO_PLUGIN_OPTION_ALLOWLIST + [ "KeepMethodCasing", @@ -72,14 +70,15 @@ def make_grpc_swift_proto_compiler( swift_proto_compiler( name = name, protoc = "@protobuf//:protoc", - plugin = "@swiftpkg_grpc_swift//:protoc-gen-grpc-swift", + plugin = "@swiftpkg_grpc_swift_protobuf//:protoc-gen-grpc-swift", plugin_name = name.removesuffix("_proto"), plugin_option_allowlist = GRPC_PLUGIN_OPTION_ALLOWLIST, plugin_options = merged_plugin_options, suffixes = [".grpc.swift"], deps = [ "@swiftpkg_swift_protobuf//:SwiftProtobuf", - "@swiftpkg_grpc_swift//:GRPC", + "@swiftpkg_grpc_swift_protobuf//:GRPCProtobuf", + "@swiftpkg_grpc_swift//:GRPCCore", ], visibility = ["//visibility:public"], ) diff --git a/examples/grpc_example/do_test b/examples/grpc_example/do_test index 9b54056e3..5cc2c9e9d 100755 --- a/examples/grpc_example/do_test +++ b/examples/grpc_example/do_test @@ -7,5 +7,5 @@ set -o errexit -o nounset -o pipefail bazel="${BIT_BAZEL_BINARY:-bazel}" # Ensure that it builds and tests pass -"${bazel}" test //... +"${bazel}" build //... diff --git a/examples/grpc_example/sources/client/BUILD.bazel b/examples/grpc_example/sources/client/BUILD.bazel index 6863470b2..4b2badac5 100644 --- a/examples/grpc_example/sources/client/BUILD.bazel +++ b/examples/grpc_example/sources/client/BUILD.bazel @@ -6,6 +6,9 @@ swift_binary( module_name = "Client", visibility = ["//visibility:public"], deps = [ + "//sources/common:convenience", + "@swiftpkg_grpc_swift//:GRPCCore", + "@swiftpkg_grpc_swift_nio_transport//:GRPCNIOTransportHTTP2", "//protos/echo_service:echo_service_swift_client_proto", "//protos/echo_service/requests:echo_request_swift_proto", "//protos/echo_service/responses:echo_response_swift_proto", diff --git a/examples/grpc_example/sources/client/client_main.swift b/examples/grpc_example/sources/client/client_main.swift index aa3588d35..414057305 100644 --- a/examples/grpc_example/sources/client/client_main.swift +++ b/examples/grpc_example/sources/client/client_main.swift @@ -12,53 +12,41 @@ // See the License for the specific language governing permissions and // limitations under the License. +import Convenience import Foundation import SwiftProtobuf -import GRPC -import NIOCore -import NIOPosix +import GRPCCore +import GRPCNIOTransportHTTP2 import EchoRequest import EchoResponse import EchoServiceClient @main struct ClientMain { - static func main() throws { - // Setup an `EventLoopGroup` for the connection to run on. - // - // See: https://github.com/apple/swift-nio#eventloops-and-eventloopgroups - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) - - // Make sure the group is shutdown when we're done with it. - defer { - try! group.syncShutdownGracefully() - } - - // Configure the channel, we're not using TLS so the connection is `insecure`. - let channel = try GRPCChannelPool.with( - target: .host("localhost", port: 9000), - transportSecurity: .plaintext, - eventLoopGroup: group - ) - - // Initialize the client using the same address the server is started on. - let client = EchoService_EchoNIOClient(channel: channel) - - // Construct a request to the echo service. - let request = EchoService_EchoRequest.with { - $0.contents = "Hello, world!" - let timestamp = Google_Protobuf_Timestamp(date: Date()) - $0.extra = try! Google_Protobuf_Any(message: timestamp) - } - - let call = client.echo(request) - - // Make the remote method call and print the response we receive. - do { - let response = try call.response.wait() - print(response.contents) - } catch { - print("Echo failed: \(error)") + static func main() async throws { + try await withGRPCClient( + transport: try .http2NIOPosix( + target: .ipv4(host: "0.0.0.0", port: 9000), + transportSecurity: .plaintext + ) + ) { client in + + // Create an echo service client: + let client = EchoService_Echo.Client(wrapping: client) + + // Construct a request to the echo service: + let request = EchoService_EchoRequest.with { + $0.contents = "Hello, world!" + let timestamp = Google_Protobuf_Timestamp(date: Date()) + $0.extra = try! Google_Protobuf_Any(message: timestamp) + } + let clientRequest = ClientRequest(message: request) + var options = CallOptions.defaults + options.timeout = .seconds(2) + let response = try await client.echo(request: clientRequest, options: options) + + // Print the response + print(response.contents) + } } - } -} +} \ No newline at end of file diff --git a/examples/grpc_example/sources/common/BUILD.bazel b/examples/grpc_example/sources/common/BUILD.bazel new file mode 100644 index 000000000..722e483d1 --- /dev/null +++ b/examples/grpc_example/sources/common/BUILD.bazel @@ -0,0 +1,14 @@ +load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") + +swift_library( + name = "convenience", + srcs = [ + "ClientRequest+Convenience.swift", + "ClientResponse+Convenience.swift", + ], + module_name = "Convenience", + visibility = ["//visibility:public"], + deps = [ + "@swiftpkg_grpc_swift//:GRPCCore", + ], +) diff --git a/examples/grpc_example/sources/common/ClientRequest+Convenience.swift b/examples/grpc_example/sources/common/ClientRequest+Convenience.swift new file mode 100644 index 000000000..24e886bd1 --- /dev/null +++ b/examples/grpc_example/sources/common/ClientRequest+Convenience.swift @@ -0,0 +1,12 @@ +// This file is copied from ClientRequest+Convenience.swift in GRPCCore +// TODO: Request that they make this public. + +import GRPCCore + +extension StreamingClientRequest { + public init(single request: ClientRequest) { + self.init(metadata: request.metadata) { + try await $0.write(request.message) + } + } +} diff --git a/examples/grpc_example/sources/common/ClientResponse+Convenience.swift b/examples/grpc_example/sources/common/ClientResponse+Convenience.swift new file mode 100644 index 000000000..956a07dca --- /dev/null +++ b/examples/grpc_example/sources/common/ClientResponse+Convenience.swift @@ -0,0 +1,105 @@ +// This file is copied from ClientResponse+Convenience.swift in GRPCCore +// TODO: Request that they make this public. + +import GRPCCore + +extension ClientResponse { + /// Converts a streaming response into a single response. + /// + /// - Parameter response: The streaming response to convert. + public init(stream response: StreamingClientResponse) async { + let accepted: Result + switch response.accepted { + case .success(let contents): + do { + let metadata = contents.metadata + var iterator = contents.bodyParts.makeAsyncIterator() + + // Happy path: message, trailing metadata, nil. + let part1 = try await iterator.next() + let part2 = try await iterator.next() + let part3 = try await iterator.next() + + switch (part1, part2, part3) { + case (.some(.message(let message)), .some(.trailingMetadata(let trailingMetadata)), .none): + let contents = Contents( + metadata: metadata, + message: message, + trailingMetadata: trailingMetadata + ) + accepted = .success(contents) + + case (.some(.message), .some(.message), _): + let error = RPCError( + code: .unimplemented, + message: """ + Multiple messages received, but only one is expected. The server may have \ + incorrectly implemented the RPC or the client and server may have a different \ + opinion on whether this RPC streams responses. + """ + ) + accepted = .failure(error) + + case (.some(.trailingMetadata), .none, .none): + let error = RPCError( + code: .unimplemented, + message: "No messages received, exactly one was expected." + ) + accepted = .failure(error) + + case (_, _, _): + let error = RPCError( + code: .internalError, + message: """ + The stream from the client transport is invalid. This is likely to be an incorrectly \ + implemented transport. Received parts: \([part1, part2, part3])." + """ + ) + accepted = .failure(error) + } + } catch let error as RPCError { + // Known error type. + accepted = .success(Contents(metadata: contents.metadata, error: error)) + } catch { + // Unexpected, but should be handled nonetheless. + accepted = .failure(RPCError(code: .unknown, message: String(describing: error))) + } + + case .failure(let error): + accepted = .failure(error) + } + + self.init(accepted: accepted) + } +} + +extension StreamingClientResponse { + /// Returns a new response which maps the messages of this response. + /// + /// - Parameter transform: The function to transform each message with. + /// - Returns: The new response. + @inlinable + func map( + _ transform: @escaping @Sendable (Message) throws -> Mapped + ) -> StreamingClientResponse { + switch self.accepted { + case .success(let contents): + return StreamingClientResponse( + metadata: self.metadata, + bodyParts: RPCAsyncSequence( + wrapping: contents.bodyParts.map { + switch $0 { + case .message(let message): + return .message(try transform(message)) + case .trailingMetadata(let metadata): + return .trailingMetadata(metadata) + } + } + ) + ) + + case .failure(let error): + return StreamingClientResponse(accepted: .failure(error)) + } + } +} diff --git a/examples/grpc_example/sources/server/BUILD.bazel b/examples/grpc_example/sources/server/BUILD.bazel index 56e7f432b..a3f1ffd75 100644 --- a/examples/grpc_example/sources/server/BUILD.bazel +++ b/examples/grpc_example/sources/server/BUILD.bazel @@ -6,6 +6,9 @@ swift_binary( module_name = "Server", visibility = ["//visibility:public"], deps = [ + "//sources/common:convenience", + "@swiftpkg_grpc_swift//:GRPCCore", + "@swiftpkg_grpc_swift_nio_transport//:GRPCNIOTransportHTTP2", "//protos/echo_service:echo_service_swift_server_proto", "//protos/echo_service/requests:echo_request_swift_proto", "//protos/echo_service/responses:echo_response_swift_proto", diff --git a/examples/grpc_example/sources/server/server_main.swift b/examples/grpc_example/sources/server/server_main.swift index 2cbb443f6..46c3a88f1 100644 --- a/examples/grpc_example/sources/server/server_main.swift +++ b/examples/grpc_example/sources/server/server_main.swift @@ -12,54 +12,41 @@ // See the License for the specific language governing permissions and // limitations under the License. +import Convenience import Foundation -import GRPC -import NIOCore -import NIOPosix +import GRPCCore +import GRPCNIOTransportHTTP2 import EchoRequest import EchoResponse import EchoServiceServer -/// Concrete implementation of the `EchoService` service definition. -class EchoProvider: EchoService_EchoProvider { - var interceptors: EchoService_EchoServerInterceptorFactoryProtocol? - - /// Called when the server receives a request for the `EchoService.Echo` method. - /// - /// - Parameters: - /// - request: The message containing the request parameters. - /// - context: Information about the current session. - /// - Returns: The response that will be sent back to the client. - func echo(request: EchoService_EchoRequest, - context: StatusOnlyCallContext) -> EventLoopFuture { - return context.eventLoop.makeSucceededFuture(EchoService_EchoResponse.with { +struct Echo: EchoService_Echo.SimpleServiceProtocol { + func echo( + request: EchoService_EchoRequest, + context: ServerContext + ) async throws -> EchoService_EchoResponse { + return EchoService_EchoResponse.with { $0.contents = "You sent: \(request.contents)" - }) + } } } @main -struct ServerMain { - static func main() throws { - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) - defer { - try! group.syncShutdownGracefully() - } - - // Initialize and start the service. - let server = Server.insecure(group: group) - .withServiceProviders([EchoProvider()]) - .bind(host: "0.0.0.0", port: 9000) +struct EchoServer { + static func main() async throws { + // Create a plaintext server using the SwiftNIO based HTTP/2 transport + let host = "0.0.0.0" + let port = 9000 + let server = GRPCServer( + transport: .http2NIOPosix( + address: .ipv4(host: host, port: port), + transportSecurity: .plaintext + ), + services: [Echo()] + ) - server.map { - $0.channel.localAddress - }.whenSuccess { address in - print("server started on port \(address!.port!)") - } - - // Wait on the server's `onClose` future to stop the program from exiting. - _ = try server.flatMap { - $0.onClose - }.wait() + // Start serving indefinitely. + print("Server started, listening on \("0.0.0.0"):\(port)") + try await server.serve() } -} +} \ No newline at end of file diff --git a/examples/grpc_example/sources/test/BUILD.bazel b/examples/grpc_example/sources/test/BUILD.bazel deleted file mode 100644 index 05e7b6f81..000000000 --- a/examples/grpc_example/sources/test/BUILD.bazel +++ /dev/null @@ -1,15 +0,0 @@ -load("@build_bazel_rules_swift//swift:swift.bzl", "swift_test") - -swift_test( - name = "test", - srcs = [ - "client_unit_test.swift", - ], - module_name = "Test", - deps = [ - "//protos/echo_service:echo_service_swift_client_proto", - "//protos/echo_service:echo_service_swift_server_proto", - "//protos/echo_service/requests:echo_request_swift_proto", - "//protos/echo_service/responses:echo_response_swift_proto", - ], -) diff --git a/examples/grpc_example/sources/test/client_unit_test.swift b/examples/grpc_example/sources/test/client_unit_test.swift deleted file mode 100644 index d044c1f99..000000000 --- a/examples/grpc_example/sources/test/client_unit_test.swift +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2019 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import GRPC -import NIOCore -import NIOPosix -import XCTest -import EchoRequest -import EchoResponse -import EchoServiceClient -import EchoServiceServer - -public class EchoProvider: EchoService_EchoProvider { - public var interceptors: EchoService_EchoServerInterceptorFactoryProtocol? - - public init(interceptors: EchoService_EchoServerInterceptorFactoryProtocol? = nil) { - self.interceptors = interceptors - } - - public func echo( - request: EchoService_EchoRequest, - context: StatusOnlyCallContext) - -> EventLoopFuture - { - let response = EchoService_EchoResponse.with { - $0.contents = request.contents - } - return context.eventLoop.makeSucceededFuture(response) - } -} - -class ClientUnitTest: XCTestCase { - - private var group: MultiThreadedEventLoopGroup? - private var server: Server? - private var channel: ClientConnection? - - private func setUpServerAndChannel() throws -> ClientConnection { - let group = MultiThreadedEventLoopGroup(numberOfThreads: 1) - self.group = group - - let server = try Server.insecure(group: group) - .withServiceProviders([EchoProvider()]) - .bind(host: "127.0.0.1", port: 0) - .wait() - - self.server = server - - let channel = ClientConnection.insecure(group: group) - .connect(host: "127.0.0.1", port: server.channel.localAddress!.port!) - - self.channel = channel - - return channel - } - - override func tearDown() { - if let channel = self.channel { - XCTAssertNoThrow(try channel.close().wait()) - } - if let server = self.server { - XCTAssertNoThrow(try server.close().wait()) - } - if let group = self.group { - XCTAssertNoThrow(try group.syncShutdownGracefully()) - } - - super.tearDown() - } - - func testGetWithRealClientAndServer() throws { - let channel = try self.setUpServerAndChannel() - let client = EchoService_EchoNIOClient(channel: channel) - - let completed = self.expectation(description: "'Get' completed") - - let call = client.echo(EchoService_EchoRequest.with { $0.contents = "Hello" }) - call.response.whenComplete { result in - switch result { - case let .success(response): - XCTAssertEqual(response.contents, "Hello") - case let .failure(error): - XCTFail("Unexpected error \(error)") - } - - completed.fulfill() - } - - self.wait(for: [completed], timeout: 10.0) - } -} diff --git a/swiftpkg/internal/pkginfos.bzl b/swiftpkg/internal/pkginfos.bzl index fcf59e7b2..02838c1ab 100644 --- a/swiftpkg/internal/pkginfos.bzl +++ b/swiftpkg/internal/pkginfos.bzl @@ -1522,25 +1522,35 @@ def _new_swift_settings(build_settings): """ defines = [] unsafe_flags = [] + language_modes = [] experimental_features = [] + upcoming_features = [] for bs in build_settings: if bs.kind == build_setting_kinds.define: defines.append(bs) elif bs.kind == build_setting_kinds.unsafe_flags: unsafe_flags.append(bs) + elif bs.kind == build_setting_kinds.language_modes: + language_modes.append(bs) elif bs.kind == build_setting_kinds.experimental_features: experimental_features.append(bs) + elif bs.kind == build_setting_kinds.upcoming_features: + upcoming_features.append(bs) else: # We do not recognize the setting. pass if len(defines) == 0 and \ len(unsafe_flags) == 0 and \ - len(experimental_features) == 0: + len(language_modes) == 0 and \ + len(experimental_features) == 0 and \ + len(upcoming_features) == 0: return None return struct( defines = defines, unsafe_flags = unsafe_flags, + language_modes = language_modes, experimental_features = experimental_features, + upcoming_features = upcoming_features, ) def _new_linker_settings(build_settings): @@ -1725,7 +1735,9 @@ build_setting_kinds = struct( linked_framework = "linkedFramework", linked_library = "linkedLibrary", unsafe_flags = "unsafeFlags", + language_modes = "swiftLanguageMode", experimental_features = "enableExperimentalFeature", + upcoming_features = "enableUpcomingFeature", ) # MARK: - API Definition diff --git a/swiftpkg/internal/swiftpkg_build_files.bzl b/swiftpkg/internal/swiftpkg_build_files.bzl index 3d5b8ad4f..54f296be2 100644 --- a/swiftpkg/internal/swiftpkg_build_files.bzl +++ b/swiftpkg/internal/swiftpkg_build_files.bzl @@ -117,9 +117,11 @@ def _swift_target_build_file(pkg_ctx, target): # Check if any of the sources indicate that the module will be used by # Objective-C code. If so, generate the bridge header file. + features = [] if target.swift_src_info.has_objc_directive and is_library_target: attrs["generates_header"] = True - attrs["features"] = ["swift.propagate_generated_module_map"] + feature = bzl_selects.new(value = "swift.propagate_generated_module_map") + features.append(feature) if target.swift_settings != None: if len(target.swift_settings.defines) > 0: @@ -135,11 +137,32 @@ def _swift_target_build_file(pkg_ctx, target): bzl_selects.new_from_build_setting(bs) for bs in target.swift_settings.unsafe_flags ])) - if len(target.swift_settings.experimental_features) > 0: - for bs in target.swift_settings.experimental_features: - copts.append("-enable-experimental-feature") - copts.extend(lists.flatten(bzl_selects.new_from_build_setting(bs))) - + for bs in target.swift_settings.language_modes: + for language_mode in lists.flatten(bzl_selects.new_from_build_setting(bs)): + new_language_mode = bzl_selects.new( + value = "swift.enable_v" + language_mode.value, + kind = language_mode.kind, + condition = language_mode.condition, + ) + features.append(new_language_mode) + for bs in target.swift_settings.experimental_features: + for experimental_feature in lists.flatten(bzl_selects.new_from_build_setting(bs)): + new_experimental_feature = bzl_selects.new( + value = "swift.experimental." + experimental_feature.value, + kind = experimental_feature.kind, + condition = experimental_feature.condition, + ) + features.append(new_experimental_feature) + for bs in target.swift_settings.upcoming_features: + for upcoming_feature in lists.flatten(bzl_selects.new_from_build_setting(bs)): + new_upcoming_feature = bzl_selects.new( + value = "swift.upcoming." + upcoming_feature.value, + kind = upcoming_feature.kind, + condition = upcoming_feature.condition, + ) + features.append(new_upcoming_feature) + if len(features) > 0: + attrs["features"] = bzl_selects.to_starlark(features, mutually_inclusive = True) if len(copts) > 0: attrs["copts"] = bzl_selects.to_starlark(copts, mutually_inclusive = True) diff --git a/swiftpkg/tests/swiftpkg_build_files_tests.bzl b/swiftpkg/tests/swiftpkg_build_files_tests.bzl index 3a43d9c9b..2c574e120 100644 --- a/swiftpkg/tests/swiftpkg_build_files_tests.bzl +++ b/swiftpkg/tests/swiftpkg_build_files_tests.bzl @@ -158,10 +158,18 @@ def _pkg_info( ], ), ), + pkginfos.new_build_setting( + kind = build_setting_kinds.language_modes, + values = ["6"], + ), pkginfos.new_build_setting( kind = build_setting_kinds.experimental_features, values = ["BuiltinModule"], ), + pkginfos.new_build_setting( + kind = build_setting_kinds.upcoming_features, + values = ["ExistentialAny"], + ), pkginfos.new_build_setting( kind = build_setting_kinds.unsafe_flags, values = ["-cross-module-optimization"], @@ -576,8 +584,6 @@ swift_binary( "-DSWIFT_PACKAGE", "-Xcc", "-DSWIFT_PACKAGE", - "-enable-experimental-feature", - "BuiltinModule", ] + select({ "@rules_swift_package_manager//config_settings/spm/platform:ios": ["-DFOOBAR"], "//conditions:default": [], @@ -588,6 +594,11 @@ swift_binary( "@rules_swift_package_manager//config_settings/spm/configuration:release": ["-cross-module-optimization"], "//conditions:default": [], }), + features = [ + "swift.enable_v6", + "swift.experimental.BuiltinModule", + "swift.upcoming.ExistentialAny", + ], module_name = "SwiftExecutableTarget", package_name = "MyPackage", srcs = ["Source/SwiftExecutableTarget/main.swift"], From 03e8af03f33884b8adb7830bf0f31c552bc0290c Mon Sep 17 00:00:00 2001 From: Logan Shire Date: Wed, 26 Mar 2025 11:16:03 -0400 Subject: [PATCH 2/4] Update to swift 6 on ubuntu --- .github/actions/set_up_ubuntu/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/set_up_ubuntu/action.yml b/.github/actions/set_up_ubuntu/action.yml index e1601e5e9..5243ec27a 100644 --- a/.github/actions/set_up_ubuntu/action.yml +++ b/.github/actions/set_up_ubuntu/action.yml @@ -10,7 +10,7 @@ inputs: required: true swift_release_tag: description: The Swift release tag. - default: "swift-5.9.1-RELEASE" + default: "swift-6.0.3-RELEASE" runs: using: composite From 735e8bd0403b653e2545376c85cd4ce825e6ae00 Mon Sep 17 00:00:00 2001 From: Logan Shire Date: Wed, 26 Mar 2025 11:25:21 -0400 Subject: [PATCH 3/4] Update doc comment --- .../sources/common/ClientRequest+Convenience.swift | 3 ++- .../sources/common/ClientResponse+Convenience.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/grpc_example/sources/common/ClientRequest+Convenience.swift b/examples/grpc_example/sources/common/ClientRequest+Convenience.swift index 24e886bd1..50ea61ebd 100644 --- a/examples/grpc_example/sources/common/ClientRequest+Convenience.swift +++ b/examples/grpc_example/sources/common/ClientRequest+Convenience.swift @@ -1,5 +1,6 @@ // This file is copied from ClientRequest+Convenience.swift in GRPCCore -// TODO: Request that they make this public. +// Requested they make this public: https://github.com/grpc/grpc-swift/issues/2213 +// When they do, we can remove this. import GRPCCore diff --git a/examples/grpc_example/sources/common/ClientResponse+Convenience.swift b/examples/grpc_example/sources/common/ClientResponse+Convenience.swift index 956a07dca..5631b226d 100644 --- a/examples/grpc_example/sources/common/ClientResponse+Convenience.swift +++ b/examples/grpc_example/sources/common/ClientResponse+Convenience.swift @@ -1,5 +1,6 @@ // This file is copied from ClientResponse+Convenience.swift in GRPCCore -// TODO: Request that they make this public. +// Requested they make this public: https://github.com/grpc/grpc-swift/issues/2213 +// When they do, we can remove this. import GRPCCore From 5fa7aae9047f94f5cfa2d6db634b8915eb4a6dda Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Wed, 26 Mar 2025 11:21:25 -0600 Subject: [PATCH 4/4] Ran tidy. --- .bazelrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index b896ed665..8603b3a3e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,7 +1,7 @@ # To update these lines, execute # `bazel run @rules_bazel_integration_test//tools:update_deleted_packages` -build --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/common,examples/grpc_example/sources/server,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/.build/checkouts/swift-syntax,examples/tca_example/.build/checkouts/swift-syntax/utils/bazel,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example -query --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/common,examples/grpc_example/sources/server,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/.build/checkouts/swift-syntax,examples/tca_example/.build/checkouts/swift-syntax/utils/bazel,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example +build --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/common,examples/grpc_example/sources/server,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example +query --deleted_packages=bzlmod/workspace,bzlmod/workspace/Sources/MyExecutable,bzlmod/workspace/Sources/MyLibrary,bzlmod/workspace/Tests/MyLibraryTests,examples/firebase_example,examples/firebase_example/abtesting,examples/firebase_example/abtesting/SharedApp,examples/firebase_example/analytics/AnalyticsExample,examples/firebase_example/appdistribution,examples/firebase_example/appdistribution/AppDistributionExample,examples/firebase_example/appdistribution/AppDistributionTests,examples/firebase_example/crashlytics,examples/google_maps_example,examples/google_maps_example/GoogleMapsExample,examples/google_maps_example/third-party/google-maps-ios-sdk,examples/grpc_example,examples/grpc_example/compilers,examples/grpc_example/protos/echo_service,examples/grpc_example/protos/echo_service/requests,examples/grpc_example/protos/echo_service/responses,examples/grpc_example/sources/client,examples/grpc_example/sources/common,examples/grpc_example/sources/server,examples/interesting_deps,examples/interesting_deps/ios,examples/ios_sim,examples/ios_sim/Sources/Foo,examples/ios_sim/Tests/FooTests,examples/lottie_ios_example,examples/lottie_ios_example/LottieExample,examples/lottie_ios_example/LottieExampleUITest,examples/messagekit_example,examples/messagekit_example/Sources/Models,examples/messagekit_example/Tests/ModelTests,examples/nimble_example,examples/nimble_example/Sources/NimbleExample,examples/objc_code,examples/objc_code/Tests/TrustKitTests,examples/phone_number_kit,examples/phone_number_kit/Tests/PhoneNumberKitTests,examples/pkg_manifest_minimal,examples/pkg_manifest_minimal/Sources/MyExecutable,examples/pkg_manifest_minimal/Sources/MyLibrary,examples/pkg_manifest_minimal/Tests/MyLibraryTests,examples/pkg_manifest_minimal/third_party,examples/resources_example,examples/resources_example/Sources/MyApp,examples/resources_example/Tests/MyAppTests,examples/resources_example/Tests/MyAppUITests,examples/resources_example/third_party,examples/shake_ios_example,examples/shake_ios_example/ShakeIOSExample,examples/shake_ios_example/ShakeIOSExampleUITests,examples/skip_local_transitive_dependencies_example,examples/snapkit_example,examples/soto_example,examples/soto_example/Tests/SotoTests,examples/stripe_example,examples/stripe_example/PaymentSheet/PaymentSheetExample,examples/stripe_example/PaymentSheet/PaymentSheetUITest,examples/swift_package_registry_example,examples/symlink_example,examples/symlink_example/Sources/ImportFramework,examples/symlink_example/Tests/ImportFrameworkTests,examples/tca_example,examples/tca_example/Sources,examples/tca_example/Tests,examples/vapor_example,examples/vapor_example/Sources/App,examples/vapor_example/Sources/Run,examples/vapor_example/Tests/AppTests,examples/vapor_example/swift,examples/xcmetrics_example # Import Shared settings import %workspace%/shared.bazelrc