Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
publish-to-bcr-bot[bot] and brentleyjones authored Dec 10, 2024
1 parent 7f66b92 commit f08e303
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 1 deletion.
73 changes: 73 additions & 0 deletions modules/rules_swift/2.3.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
module(
name = "rules_swift",
version = "2.3.0",
bazel_compatibility = [">=6.0.0"],
compatibility_level = 2,
repo_name = "build_bazel_rules_swift",
)

bazel_dep(name = "bazel_features", version = "1.3.0")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "apple_support", version = "1.15.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_cc", version = "0.0.2")
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "protobuf", version = "21.7", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_proto", version = "5.3.0-21.7")
bazel_dep(name = "nlohmann_json", version = "3.6.1", repo_name = "com_github_nlohmann_json")
bazel_dep(
name = "swift_argument_parser",
version = "1.3.1.1",
repo_name = "com_github_apple_swift_argument_parser",
)

non_module_deps = use_extension("//swift:extensions.bzl", "non_module_deps")
use_repo(
non_module_deps,
"build_bazel_rules_swift_index_import",
"build_bazel_rules_swift_local_config",
"com_github_apple_swift_docc_symbolkit",
"com_github_apple_swift_log",
"com_github_apple_swift_nio",
"com_github_apple_swift_nio_extras",
"com_github_apple_swift_nio_http2",
"com_github_apple_swift_nio_transport_services",
"com_github_apple_swift_protobuf",
"com_github_grpc_grpc_swift",
)

apple_cc_configure = use_extension("@build_bazel_apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc")

register_toolchains("@build_bazel_rules_swift_local_config//:all")

# Dev dependencies
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "SwiftSyntax",
dev_dependency = True,
sha256 = "527a5c6d19987acbb5019efa067b0fbd127e06187a0689c3f1098fd22c1a7d43",
strip_prefix = "swift-syntax-01fc3e3ed4d26121c06790abf8fe5ddaa22a4cc5",
url = "https://github.com/apple/swift-syntax/archive/01fc3e3ed4d26121c06790abf8fe5ddaa22a4cc5.tar.gz",
)

# TODO: Remove override when a protobuf release is available that supports
# Bazel 8
archive_override(
module_name = "protobuf",
integrity = "sha256-+dloYVexGlGsxKLTARuU4KXZ5ORo/BWPR6obFk73d+Q=",
strip_prefix = "protobuf-b93b8e5f64ed922d101759380d7c6a2bbe474e26",
urls = ["https://github.com/protocolbuffers/protobuf/archive/b93b8e5f64ed922d101759380d7c6a2bbe474e26.zip"],
)

# TODO: Remove override when a protobuf release that marks `stardoc` as a
# dev_dependency is available, until then it's upgrading our stardoc version
# so override it here.
single_version_override(
module_name = "stardoc",
version = "0.6.2",
)
12 changes: 12 additions & 0 deletions modules/rules_swift/2.3.0/patches/module_dot_bazel_version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===================================================================
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -1,7 +1,7 @@
module(
name = "rules_swift",
- version = "0",
+ version = "2.3.0",
bazel_compatibility = [">=6.0.0"],
compatibility_level = 2,
repo_name = "build_bazel_rules_swift",
)
40 changes: 40 additions & 0 deletions modules/rules_swift/2.3.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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:
bazel:
- 7.x
# TODO: Uncomment once Bazel 8 is released
# - 8.x
# TODO: Uncomment once we support HEAD again
# - latest
platform:
- ubuntu2004
tasks:
verify_targets:
name: Verify build targets
bazel: ${{ bazel }}
platform: ${{ platform }}
environment:
CC: "clang"
SWIFT_VERSION: "5.9.2"
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/macros/..." # Has a dev dependency
- "-@rules_swift//examples/xplatform/grpc/..." # TODO: Fix grpc on Linux
- "-@rules_swift//examples/xplatform/proto_library_group/..." # TODO: Fix grpc on Linux
verify_targets_macos:
name: Verify build targets
bazel: ${{ bazel }}
platform: macos
build_targets:
- "@rules_swift//examples/apple/..."
build_flags:
- "--repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1"
9 changes: 9 additions & 0 deletions modules/rules_swift/2.3.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"integrity": "sha256-emJiN8pNns9PW0y1vxP/Y6trJ+EB+DTn4uB8O5jVg/k=",
"strip_prefix": "",
"url": "https://github.com/bazelbuild/rules_swift/releases/download/2.3.0/rules_swift.2.3.0.tar.gz",
"patches": {
"module_dot_bazel_version.patch": "sha256-MJ98l0cidzH3c1NHb6UUpsiGtOztHSFISalYc/FsHoQ="
},
"patch_strip": 1
}
3 changes: 2 additions & 1 deletion modules/rules_swift/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"2.2.1",
"2.2.2",
"2.2.3",
"2.2.4"
"2.2.4",
"2.3.0"
],
"yanked_versions": {}
}

0 comments on commit f08e303

Please sign in to comment.