Skip to content

Commit ff1a079

Browse files
committed
Use Protobuf v25.5 in test_scala_version
As mentioned in the comments, Protobuf v25.5 is the maximum version supported by ScalaPB 0.9.8 (for Scala 2.11) and 0.11.17. This change sets up a future change to conditionally set Protobuf to v25.5 when testing Scala 2.11 after other Scala version update to ScalaPB 1.0.0-alpha.1. The test will use Protobuf v28.3 with those other Scala versions. Protobuf versions v26.x and v27.x aren't supported by any ScalaPB version. The `RULES_SCALA_TEST_ONLY` environment variable was invaluable for determining these parameters, as it allowed quickly trying versions with commands like: ```txt $ RULES_SCALA_TEST_ONLY='test_scala_version 2.11.12' ./test_version.sh ```
1 parent 2e097e4 commit ff1a079

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

test_version.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ run_in_test_repo() {
4949
scrooge_ws="scrooge_repositories($version_param)"
5050
fi
5151

52+
# ScalaPB 0.9.8 through 0.11.17 can support at least Protobuf v21.7 up to
53+
# Protobuf v25.5. ScalaPB 1.0.0-alpha.1 requires at least Protofuf 28.2.
54+
# Protobuf versions v26.x and v27.x aren't supported by any ScalaPB version.
55+
local protobuf_version='25.5'
56+
local protobuf_sha=(
57+
'3cf7d5b17c4ff04fe9f038104e9d0cae6da09b8ce271c13e44f8ac69f51e4e0f'
58+
)
59+
5260
sed -e "s%\${twitter_scrooge_repositories}%${scrooge_ws}\n%" \
61+
-e "s%\${protobuf_version}%${protobuf_version}%g" \
62+
-e "s%\${protobuf_sha}%${protobuf_sha}%g" \
5363
WORKSPACE.template >> $NEW_TEST_DIR/WORKSPACE
5464
cp ../.bazel{rc,version} $NEW_TEST_DIR/
5565

test_version/WORKSPACE.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ http_archive(
3131

3232
http_archive(
3333
name = "com_google_protobuf",
34-
sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae",
35-
strip_prefix = "protobuf-21.7",
36-
url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.7.tar.gz",
34+
sha256 = "${protobuf_sha}",
35+
strip_prefix = "protobuf-${protobuf_version}",
36+
url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v${protobuf_version}.tar.gz",
3737
)
3838

3939
load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies")

0 commit comments

Comments
 (0)