From 2d833346033c9cce9c96a3c73fd5347eda8c0820 Mon Sep 17 00:00:00 2001 From: Patrick Balestra Date: Thu, 22 Dec 2022 10:40:22 +0100 Subject: [PATCH 1/3] Add rules_swift 1.5.0 --- modules/rules_swift/1.5.0/MODULE.bazel | 34 +++++++++++++++++++++++++ modules/rules_swift/1.5.0/presubmit.yml | 28 ++++++++++++++++++++ modules/rules_swift/1.5.0/source.json | 4 +++ modules/rules_swift/metadata.json | 3 ++- 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 modules/rules_swift/1.5.0/MODULE.bazel create mode 100644 modules/rules_swift/1.5.0/presubmit.yml create mode 100644 modules/rules_swift/1.5.0/source.json diff --git a/modules/rules_swift/1.5.0/MODULE.bazel b/modules/rules_swift/1.5.0/MODULE.bazel new file mode 100644 index 00000000000..61b449da05b --- /dev/null +++ b/modules/rules_swift/1.5.0/MODULE.bazel @@ -0,0 +1,34 @@ +# Generated by update-module-version.sh. DO NOT EDIT. +module( + name = "rules_swift", + compatibility_level = 1, + repo_name = "build_bazel_rules_swift", + version = "1.5.0", +) + +# --- End generated content + +bazel_dep(name = "bazel_skylib", version = "1.3.0") +bazel_dep(name = "apple_support", repo_name = "build_bazel_apple_support", version = "1.3.2") +bazel_dep(name = "rules_cc", version = "0.0.2") +bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "3.19.2") # To be removed once rules_proto is bzlmod-ready. + +non_module_deps = use_extension("//swift:extensions.bzl", "non_module_deps") + +use_repo( + non_module_deps, + "build_bazel_rules_swift_local_config", + "com_github_apple_swift_protobuf", + "com_github_grpc_grpc_swift", + "com_github_apple_swift_nio", + "com_github_apple_swift_nio_http2", + "com_github_apple_swift_nio_transport_services", + "com_github_apple_swift_nio_extras", + "com_github_apple_swift_log", + "com_github_nlohmann_json", + "rules_proto", + "build_bazel_rules_swift_index_import", +) + +# Dev dependencies +bazel_dep(name = "stardoc", dev_dependency = True, repo_name = "io_bazel_skydoc", version = "0.5.3") diff --git a/modules/rules_swift/1.5.0/presubmit.yml b/modules/rules_swift/1.5.0/presubmit.yml new file mode 100644 index 00000000000..4b4e32aca65 --- /dev/null +++ b/modules/rules_swift/1.5.0/presubmit.yml @@ -0,0 +1,28 @@ +shell_commands: &shell_commands +- "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" +- "mkdir $SWIFT_HOME" +- "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" + +matrix: + platform: + - ubuntu2004 +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + environment: + CC: "clang" + SWIFT_VERSION: "5.5.3" + SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" + PATH: "$PATH:$SWIFT_HOME/usr/bin" + shell_commands: *shell_commands + build_flags: + - "--action_env=PATH" + build_targets: + - "@rules_swift//examples/xplatform/..." + - "-@rules_swift//examples/xplatform/grpc/..." # TODO: Fix grpc on Linux + verify_targets_macos: + name: Verify build targets + platform: macos + build_targets: + - "@rules_swift//examples/apple/..." diff --git a/modules/rules_swift/1.5.0/source.json b/modules/rules_swift/1.5.0/source.json new file mode 100644 index 00000000000..15c6905e258 --- /dev/null +++ b/modules/rules_swift/1.5.0/source.json @@ -0,0 +1,4 @@ +{ + "integrity": "sha256-MvldvmqI6ymKqnkPBQZUNPMqZixl7Apqq9r2iB5PFp8=", + "url": "https://github.com/bazelbuild/rules_swift/releases/download/1.5.0/rules_swift.1.5.0.tar.gz" +} diff --git a/modules/rules_swift/metadata.json b/modules/rules_swift/metadata.json index 895904e140d..5f8d0f10f34 100644 --- a/modules/rules_swift/metadata.json +++ b/modules/rules_swift/metadata.json @@ -16,7 +16,8 @@ "github:bazelbuild/rules_swift" ], "versions": [ - "1.2.0" + "1.2.0", + "1.5.0" ], "yanked_versions": {} } From 3ffb4d9e7a7ea10a6bcfc05c620b7a013b390b06 Mon Sep 17 00:00:00 2001 From: Patrick Balestra Date: Fri, 23 Dec 2022 10:28:01 +0100 Subject: [PATCH 2/3] Add platforms dep --- modules/rules_swift/1.5.0/MODULE.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rules_swift/1.5.0/MODULE.bazel b/modules/rules_swift/1.5.0/MODULE.bazel index 61b449da05b..392a75e5593 100644 --- a/modules/rules_swift/1.5.0/MODULE.bazel +++ b/modules/rules_swift/1.5.0/MODULE.bazel @@ -11,6 +11,7 @@ module( bazel_dep(name = "bazel_skylib", version = "1.3.0") bazel_dep(name = "apple_support", repo_name = "build_bazel_apple_support", version = "1.3.2") bazel_dep(name = "rules_cc", version = "0.0.2") +bazel_dep(name = "platforms", version = "0.0.5") bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "3.19.2") # To be removed once rules_proto is bzlmod-ready. non_module_deps = use_extension("//swift:extensions.bzl", "non_module_deps") From 874202cc8d792873ed2d7bd31e11cf3985378990 Mon Sep 17 00:00:00 2001 From: Patrick Balestra Date: Fri, 23 Dec 2022 10:32:43 +0100 Subject: [PATCH 3/3] Add patch for platforms dep --- .../patches/add-dependency-on-platforms.patch | 24 +++++++++++++++++++ modules/rules_swift/1.5.0/source.json | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 modules/rules_swift/1.5.0/patches/add-dependency-on-platforms.patch diff --git a/modules/rules_swift/1.5.0/patches/add-dependency-on-platforms.patch b/modules/rules_swift/1.5.0/patches/add-dependency-on-platforms.patch new file mode 100644 index 00000000000..d80e42d7a41 --- /dev/null +++ b/modules/rules_swift/1.5.0/patches/add-dependency-on-platforms.patch @@ -0,0 +1,24 @@ +From 7de898d7ccbf8cf3b0cabcd5ead1858573480ab3 Mon Sep 17 00:00:00 2001 +From: Patrick Balestra +Date: Fri, 23 Dec 2022 10:28:51 +0100 +Subject: [PATCH] Add dependency on platforms + +--- + MODULE.bazel | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/MODULE.bazel b/MODULE.bazel +index 61b449d..392a75e 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -11,6 +11,7 @@ module( + bazel_dep(name = "bazel_skylib", version = "1.3.0") + bazel_dep(name = "apple_support", repo_name = "build_bazel_apple_support", version = "1.3.2") + bazel_dep(name = "rules_cc", version = "0.0.2") ++bazel_dep(name = "platforms", version = "0.0.5") + bazel_dep(name = "protobuf", repo_name = "com_google_protobuf", version = "3.19.2") # To be removed once rules_proto is bzlmod-ready. + + non_module_deps = use_extension("//swift:extensions.bzl", "non_module_deps") +-- +2.37.0 (Apple Git-136) + diff --git a/modules/rules_swift/1.5.0/source.json b/modules/rules_swift/1.5.0/source.json index 15c6905e258..d72554e3fbe 100644 --- a/modules/rules_swift/1.5.0/source.json +++ b/modules/rules_swift/1.5.0/source.json @@ -1,4 +1,8 @@ { "integrity": "sha256-MvldvmqI6ymKqnkPBQZUNPMqZixl7Apqq9r2iB5PFp8=", + "patch_strip": 1, + "patches": { + "add-dependency-on-platforms.patch": "sha256-QOemXmLkzi87jipl/a1pi9/XSkBxdG6IbAXKSMz7iFg=" + }, "url": "https://github.com/bazelbuild/rules_swift/releases/download/1.5.0/rules_swift.1.5.0.tar.gz" }