You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Separates the latest dependency versions that we test against from the
minimum required versions and bumps `protobuf` to v30.2. Part of bazel-contrib#1482.
Adds `scala/latest_deps.bzl` for `WORKSPACE` and `deps/latest` for
Bzlmod, used by our internal test repos.
Tests used to validate these dependency versions will land in a future
change.
Also fixes a bug in the failure message of `_default_platform()` in
`protoc_toolchains.bzl` by calling `string.join()` on the
`HOST_CONSTRAINTS` list. (Didn't notice this until building on Windows
ARM64, since there's no such binary `protobuf` release yet.)
---
This avoids forcing users to upgrade to the latest versions that
`rules_scala` tests against.
Inspired by a thread in the #bzlmod channel of the Bazel Slack workspace
on 2025-01-01 indicating that rules should require the minumum versions
possible:
- https://bazelbuild.slack.com/archives/C014RARENH0/p1743597941149639
|`platforms`| 0.0.9 | Creates the `@host_platform` repo used to auto-detect the toolchain for the host platform. |
362
+
|`rules_java`| 7.10.0 (with `--experimental_google_legacy_api`), 8.3.0 |`protobuf` v29 needs 7.8.0 with `--experimental_google_legacy_api` for `ProguardSpecProvider`. Then it needs 7.10.0 for `//java/private:proto_support.bzl` visibility.<br/>`protobuf` v29 needs `@rules_java//java/private:proto_support.bzl` from v8.2.0. See [bazelbuild/rules_java@94d5617](https://github.com/bazelbuild/rules_java/commit/94d5617cf3d97ddda10c81ba05a865e8e3a0408e).<br/>v8.3.0 fixes bazelbuild/rules_java#233. |
363
+
|`rules_proto`| 7.0.0 | Required by `protobuf` v29 and later. |
364
+
|`bazel_skylib`| 1.7.0 | Contains `paths.is_normalized`, required by `//bazel/private:bazel_proto_library_rule.bzl` in `protobuf` v29. See [bazelbuild/bazel-skylib@0e485c8](https://github.com/bazelbuild/bazel-skylib/commit/0e485c80b7992f5ebfab50637f86e966f544ad58). |
365
+
332
366
#### Common setup
333
367
334
368
To set the flag in your `.bazelrc` file:
335
369
336
370
```txt
371
+
# .bazelrc
337
372
common --incompatible_enable_proto_toolchain_resolution
338
373
```
339
374
@@ -455,20 +490,21 @@ package of your repository, add the following to your `MODULE.bazel`:
455
490
# protocolbuffers/protobuf#19679.
456
491
bazel_dep(
457
492
name="protobuf",
458
-
version="30.1",
493
+
version="30.2",
459
494
repo_name="com_google_protobuf",
460
495
)
461
496
single_version_override(
462
497
module_name="protobuf",
463
498
patch_strip=1,
464
499
patches= ["//:protobuf.patch"],
465
-
version="30.1",
500
+
version="30.2",
466
501
)
467
502
```
468
503
469
504
#### `protobuf` patch setup under `WORKSPACE`
470
505
471
-
[`scala/deps.bzl`](./scala/deps.bzl) currently applies the `protobuf` patch to `protobuf` v30.1.
506
+
[`scala/latest-deps.bzl`](./scala/latest-deps.bzl) currently applies the
507
+
`protobuf` patch to `protobuf` v30.2.
472
508
473
509
If you need to apply the patch to a different version of `protobuf`, copy it to
474
510
your repo as described in the Bzlmod setup above. Then apply it in your own
@@ -477,9 +513,9 @@ your repo as described in the Bzlmod setup above. Then apply it in your own
0 commit comments