Skip to content

Commit f846226

Browse files
authored
Use Xcode 16.4 in CI and fix non-bzlmod dependency issues (#1591)
Fixes: ``` buildkite-agent annotate --style=warning Your selected Xcode version 16.2 was not available on the machine. --   | Bazel CI automatically picked a fallback version: 26.0. ``` Also fixes issues in non-blzmod mode. We were resolving to dependency versions that were newer than what was defined in `MODULE.bazel`, since workspace mode does not upgrade deps for us it was failing to build due to zlib issues fixed in newer protobuf versions. This updates the versions to be set to what bzlmod is upgrading our deps to so we can more accurately set the versions while in workspace mode Fixes: ``` WARNING: For repository 'bazel_features', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off WARNING: For repository 'bazel_skylib', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off WARNING: For repository 'build_bazel_apple_support', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off WARNING: For repository 'platforms', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off WARNING: For repository 'com_google_protobuf', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off ```
1 parent 3dfbf33 commit f846226

File tree

4 files changed

+60
-32
lines changed

4 files changed

+60
-32
lines changed

.bazelci/presubmit.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ x_defaults:
44
# it doesn't know about; so that is used to avoid repeating common subparts.
55
mac_common: &mac_common
66
platform: macos_arm64
7-
xcode_version: "16.2"
7+
xcode_version: "16.4"
88
build_targets:
99
- "//examples/..."
1010
test_targets:
@@ -63,7 +63,8 @@ tasks:
6363

6464
macos_last_green:
6565
name: "Last Green Bazel"
66-
bazel: last_green
66+
# TODO: Use `last_green` when https://github.com/bazelbuild/bazel/pull/27330 merges
67+
bazel: f2985041cb1170be4545049e1b4d25eea8a84660
6768
<<: *mac_common
6869

6970
macos_latest_head_deps:
@@ -98,9 +99,8 @@ tasks:
9899

99100
ubuntu2004_last_green:
100101
name: "Last Green Bazel"
101-
# TODO: Use `last_green` when https://github.com/bazelbuild/bazel/issues/26962 is fixed
102-
# bazel: last_green
103-
bazel: 0522f8e58bf864005207eb8f09162d35ddd1f678
102+
# TODO: Use `last_green` when https://github.com/bazelbuild/bazel/pull/27330 merges
103+
bazel: f2985041cb1170be4545049e1b4d25eea8a84660
104104
shell_commands:
105105
- "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME"
106106
- "mkdir $SWIFT_HOME"

MODULE.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ module(
88
repo_name = "build_bazel_rules_swift",
99
)
1010

11-
bazel_dep(name = "bazel_features", version = "1.10.0")
12-
bazel_dep(name = "bazel_skylib", version = "1.3.0")
13-
bazel_dep(name = "apple_support", version = "1.21.0", repo_name = "build_bazel_apple_support")
11+
bazel_dep(name = "bazel_features", version = "1.30.0")
12+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
13+
bazel_dep(name = "apple_support", version = "1.23.1", repo_name = "build_bazel_apple_support")
1414
bazel_dep(name = "rules_cc", version = "0.1.2")
1515
bazel_dep(name = "rules_shell", version = "0.3.0")
16-
bazel_dep(name = "platforms", version = "0.0.9")
17-
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
16+
bazel_dep(name = "platforms", version = "0.0.11")
17+
bazel_dep(name = "protobuf", version = "29.0", repo_name = "com_google_protobuf")
1818
bazel_dep(name = "nlohmann_json", version = "3.6.1", repo_name = "com_github_nlohmann_json")
1919
bazel_dep(
2020
name = "swift_argument_parser",

WORKSPACE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ load("@rules_shell//shell:repositories.bzl", "rules_shell_dependencies", "rules_
8181
rules_shell_dependencies()
8282

8383
rules_shell_toolchains()
84+
85+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
86+
87+
protobuf_deps()
88+
89+
load("@rules_java//java:rules_java_deps.bzl", "rules_java_dependencies")
90+
91+
rules_java_dependencies()

swift/repositories.bzl

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
4848
http_archive,
4949
name = "bazel_skylib",
5050
urls = [
51-
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
52-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
51+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
52+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
5353
],
54-
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
54+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
5555
)
5656

5757
_maybe(
5858
http_archive,
5959
name = "build_bazel_apple_support",
60-
url = "https://github.com/bazelbuild/apple_support/releases/download/1.21.0/apple_support.1.21.0.tar.gz",
61-
sha256 = "293f5fe430787f3a995b2703440d27498523df119de00b84002deac9525bea55",
60+
url = "https://github.com/bazelbuild/apple_support/releases/download/1.23.1/apple_support.1.23.1.tar.gz",
61+
sha256 = "ee20cc5c0bab47065473c8033d462374dd38d172406ecc8de5c8f08487943f2f",
6262
)
6363

6464
_maybe(
@@ -72,9 +72,19 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
7272
_maybe(
7373
http_archive,
7474
name = "com_google_protobuf",
75-
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz"],
76-
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
77-
strip_prefix = "protobuf-27.0",
75+
urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v29.0/protobuf-29.0.tar.gz"],
76+
sha256 = "10a0d58f39a1a909e95e00e8ba0b5b1dc64d02997f741151953a2b3659f6e78c",
77+
strip_prefix = "protobuf-29.0",
78+
)
79+
80+
# NOTE: this is required since `com_google_protobuf` depends on a bad 7.x version
81+
# and WORKSAPCE mode does not upgrade the dependency correctly.
82+
# This version matches that of the resolved rules_java version in `bazel mod graph`.
83+
_maybe(
84+
http_archive,
85+
name = "rules_java",
86+
url = "https://github.com/bazelbuild/rules_java/releases/download/8.14.0/rules_java-8.14.0.tar.gz",
87+
sha256 = "bbe7d94360cc9ed4607ec5fd94995fd1ec41e84257020b6f09e64055281ecb12",
7888
)
7989

8090
_maybe(
@@ -93,22 +103,40 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
93103
_maybe(
94104
http_archive,
95105
name = "bazel_features",
96-
sha256 = "95fb3cfd11466b4cad6565e3647a76f89886d875556a4b827c021525cb2482bb",
97-
strip_prefix = "bazel_features-1.10.0",
98-
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.10.0/bazel_features-v1.10.0.tar.gz",
106+
sha256 = "a660027f5a87f13224ab54b8dc6e191693c554f2692fcca46e8e29ee7dabc43b",
107+
strip_prefix = "bazel_features-1.30.0",
108+
url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.30.0/bazel_features-v1.30.0.tar.gz",
99109
)
100110

101111
_maybe(
102112
http_archive,
103113
name = "com_github_apple_swift_argument_parser",
104-
urls = ["https://github.com/apple/swift-argument-parser/archive/refs/tags/1.3.0.tar.gz"],
105-
sha256 = "e5010ff37b542807346927ba68b7f06365a53cf49d36a6df13cef50d86018204",
106-
strip_prefix = "swift-argument-parser-1.3.0",
114+
urls = ["https://github.com/apple/swift-argument-parser/archive/refs/tags/1.3.1.tar.gz"],
115+
sha256 = "4d964f874b251abc280ee28f0f187de3c13a6122a9561524f66a10768ca2d837",
116+
strip_prefix = "swift-argument-parser-1.3.1",
107117
build_file = Label(
108118
"//third_party:com_github_apple_swift_argument_parser/BUILD.overlay",
109119
),
110120
)
111121

122+
_maybe(
123+
http_archive,
124+
name = "rules_shell",
125+
sha256 = "d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53",
126+
strip_prefix = "rules_shell-0.3.0",
127+
url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz",
128+
)
129+
130+
_maybe(
131+
http_archive,
132+
name = "platforms",
133+
urls = [
134+
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
135+
"https://github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
136+
],
137+
sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f",
138+
)
139+
112140
_maybe(
113141
http_archive,
114142
name = "com_github_apple_swift_protobuf",
@@ -252,14 +280,6 @@ def swift_rules_dependencies(include_bzlmod_ready_dependencies = True):
252280
sha256 = "9a54fc1674af6031125a9884480a1e31e1bcf48b8f558b3e8bcc6b6fcd6e8b61",
253281
)
254282

255-
_maybe(
256-
http_archive,
257-
name = "rules_shell",
258-
sha256 = "d8cd4a3a91fc1dc68d4c7d6b655f09def109f7186437e3f50a9b60ab436a0c53",
259-
strip_prefix = "rules_shell-0.3.0",
260-
url = "https://github.com/bazelbuild/rules_shell/releases/download/v0.3.0/rules_shell-v0.3.0.tar.gz",
261-
)
262-
263283
_maybe(
264284
swift_autoconfiguration,
265285
name = "build_bazel_rules_swift_local_config",

0 commit comments

Comments
 (0)