Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Upgrade rules_swift and supported Bazel versions. (#134)
Browse files Browse the repository at this point in the history
Upgraded rules_swift to 0.27.0. Actually, the repository uses a commit immediately following the 0.27.0 release. The commit includes missing bzl_library declarations.
Upgraded rules_apple to 0.34.0.
Upgraded current Bazel version to 5.1.1
Removed support for Bazel version 4.2.2 as rules_swift include incompatible features.
Upgraded Bazel version 6.0 pre-release to 6.0.0-pre.20220405.2.
Renamed rules_cc repository to bazel_build_rules_cc. An incompatibility appeared with the 6.0 pre-release upgrade.
Upgraded bazel_build_rules_cc to point to the latest as of 2022-04-09.
  • Loading branch information
cgrindel authored Apr 9, 2022
1 parent b1d495f commit 3484e7a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0
5.1.1
5 changes: 2 additions & 3 deletions bazel_versions.bzl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""Tested/Supported Bazel Versions"""

CURRENT_BAZEL_VERSION = "5.0.0"
CURRENT_BAZEL_VERSION = "5.1.1"

OTHER_BAZEL_VERSIONS = [
"4.2.2",
"6.0.0-pre.20220112.2",
"6.0.0-pre.20220405.2",
]

SUPPORTED_BAZEL_VERSIONS = [
Expand Down
4 changes: 2 additions & 2 deletions examples/ios_sim/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ http_archive(

http_archive(
name = "build_bazel_rules_apple",
sha256 = "77e8bf6fda706f420a55874ae6ee4df0c9d95da6c7838228b26910fc82eea5a2",
url = "https://github.com/bazelbuild/rules_apple/releases/download/0.32.0/rules_apple.0.32.0.tar.gz",
sha256 = "4161b2283f80f33b93579627c3bd846169b2d58848b0ffb29b5d4db35263156a",
url = "https://github.com/bazelbuild/rules_apple/releases/download/0.34.0/rules_apple.0.34.0.tar.gz",
)

load(
Expand Down
4 changes: 2 additions & 2 deletions examples/local_package/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "build_bazel_rules_swift",
sha256 = "f872c0388808c3f8de67e0c6d39b0beac4a65d7e07eff3ced123d0b102046fb6",
url = "https://github.com/bazelbuild/rules_swift/releases/download/0.23.0/rules_swift.0.23.0.tar.gz",
sha256 = "a2fd565e527f83fb3f9eb07eb9737240e668c9242d3bc318712efa54a7deda97",
url = "https://github.com/bazelbuild/rules_swift/releases/download/0.27.0/rules_swift.0.27.0.tar.gz",
)

load(
Expand Down
22 changes: 17 additions & 5 deletions spm/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ def spm_rules_dependencies():
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
)

# Master as of 2022-04-09. Includes fix to 0.27.0 adding back missing bzl_library declarations.
_RULES_SWIFT_VERSION = "22192877498705ff1adbecd820fdc2724414b0b2"
maybe(
http_archive,
name = "build_bazel_rules_swift",
sha256 = "4f167e5dbb49b082c5b7f49ee688630d69fb96f15c84c448faa2e97a5780dbbc",
url = "https://github.com/bazelbuild/rules_swift/releases/download/0.24.0/rules_swift.0.24.0.tar.gz",
sha256 = "0844f7fc6d67eaaa2d7e2a620c27b3dfdc6e27c0cf35487b5c9890dd766c80be",
strip_prefix = "rules_swift-{}".format(_RULES_SWIFT_VERSION),
urls = [
"http://github.com/bazelbuild/rules_swift/archive/{}.tar.gz".format(_RULES_SWIFT_VERSION),
],
)

maybe(
Expand Down Expand Up @@ -48,9 +53,16 @@ def spm_rules_dependencies():
],
)

# Master as of 2022-04-09
_RULES_CC_VERSION = "58f8e026c00a8a20767e3dc669f46ba23bc93bdb"
maybe(
http_archive,
name = "rules_cc",
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.1/rules_cc-0.0.1.tar.gz"],
sha256 = "4dccbfd22c0def164c8f47458bd50e0c7148f3d92002cdb459c2a96a68498241",
# We purposefully do not name this rules_cc. An incompatibility appeared in Bazel 6.0 pre-release
# where action_names.bzl was no longer available.
name = "bazel_build_rules_cc",
sha256 = "c22f7b4b87c0604f08479190fc0fb09c928982ff8f52b797263505e3b5a75f89",
strip_prefix = "rules_cc-{}".format(_RULES_CC_VERSION),
urls = [
"http://github.com/bazelbuild/rules_cc/archive/{}.tar.gz".format(_RULES_CC_VERSION),
],
)
4 changes: 2 additions & 2 deletions spm/private/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ bzl_library(

bzl_library(
name = "rules_cc_action_names",
srcs = ["@rules_cc//cc:action_names.bzl"],
srcs = ["@bazel_build_rules_cc//cc:action_names.bzl"],
visibility = ["//spm:__subpackages__"],
)

bzl_library(
name = "rules_cc_defs",
srcs = [
"@rules_cc//cc:bzl_srcs",
"@bazel_build_rules_cc//cc:bzl_srcs",
],
visibility = ["//spm:__subpackages__"],
)
Expand Down
2 changes: 1 addition & 1 deletion spm/private/spm_archive.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Definition for spm_archive rule."""

load("@bazel_build_rules_cc//cc:action_names.bzl", "CPP_LINK_STATIC_LIBRARY_ACTION_NAME")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load("@rules_cc//cc:action_names.bzl", "CPP_LINK_STATIC_LIBRARY_ACTION_NAME")

# Heavily inspired by
# https://github.com/bazelbuild/rules_cc/blob/main/examples/my_c_archive/my_c_archive.bzl
Expand Down
2 changes: 1 addition & 1 deletion spm/private/spm_clang_library.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Definition for spm_clang_library rule."""

load("@rules_cc//cc:defs.bzl", "cc_library")
load("@bazel_build_rules_cc//cc:defs.bzl", "cc_library")
load(":spm_filegroup.bzl", "spm_filegroup")

def spm_clang_library(name, packages, deps = None, visibility = None):
Expand Down
2 changes: 1 addition & 1 deletion spm/private/spm_system_library.bzl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Definition for spm_system_library rule."""

load("@bazel_build_rules_cc//cc:defs.bzl", "cc_library")
load(
"@build_bazel_rules_swift//swift:swift.bzl",
"swift_c_module",
)
load("@rules_cc//cc:defs.bzl", "cc_library")
load(":spm_filegroup.bzl", "spm_filegroup")

def spm_system_library(name, packages, deps = None, visibility = None):
Expand Down

0 comments on commit 3484e7a

Please sign in to comment.