Skip to content

Commit 2933a15

Browse files
committed
Update 6.5.0 tips, add twitter_scrooge changes
Updates `README.md` with a couple editorial improvements to "Limited Bazel 6.5.0 compatibiity" and the new "Removal of `bind()` aliases for `twitter_scrooge` dependencies" section.
1 parent ab5d5b0 commit 2933a15

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed

README.md

+53-2
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,9 @@ with Bazel 6.5.0 won't work at all because [Bazel 6.5.0 doesn't support
950950
https://github.com/bazelbuild/rules_scala/issues/1482#issuecomment-2515496234).
951951

952952
At the moment, `WORKSPACE` builds mostly continue to work with Bazel 6.5.0, but
953-
not out of the box, and may break at any time. You will have to choose one of
954-
the following approaches to resolve `protobuf` compatibility issues.
953+
not out of the box, and may break at any time.
954+
955+
#### Maximum of `protobuf` v29
955956

956957
First of all, you _must_ use `protobuf` v29 or earlier. `rules_scala` now uses
957958
v30 by default, which removes `py_proto_library` and other symbols that Bazel
@@ -976,6 +977,12 @@ ERROR: .../src/java/io/bazel/rulesscala/worker/BUILD:3:13:
976977
and referenced by '//src/java/io/bazel/rulesscala/worker:worker'
977978
```
978979

980+
#### Using a prebuilt `@com_google_protobuf//:protoc` or C++ compiler flags
981+
982+
Newer versions of `@com_google_protobuf//:protoc` fail to compile under Bazel
983+
6.5.0 by default. You will have to choose one of the following approaches to
984+
resolve this problem, if migrating to Bazel 7 or 8 isn't an immediate option.
985+
979986
You may use protocol compiler toolchainization with `protobuf` v29 to avoid
980987
recompiling `protoc`. See the [Using a precompiled protocol compiler](#protoc)
981988
section for details.
@@ -999,6 +1006,8 @@ Note that this example uses `common:` config settings instead of `build:`. This
9991006
seems to prevent invalidating the action cache between `bazel` runs, which
10001007
improves performance.
10011008

1009+
#### Using older `protobuf` versions
1010+
10021011
If you have a dependency that requires `protobuf` version before v28, use the
10031012
following maximum versions of key dependencies. Note that no `ScalaPB` release
10041013
supports `protobuf` v25.6, v26, or v27.
@@ -1025,6 +1034,48 @@ under `WORKSPACE`](#6.5.0), with the maximum dependency versions specified in
10251034
that section. While this may continue to work for some time, it is not
10261035
officially supported.
10271036

1037+
### Removal of `bind()` aliases for `twitter_scrooge` dependencies
1038+
1039+
`rules_scala` 7.x removes all of the obsolete [`bind()`][] aliases under
1040+
`//external:io_bazel_rules_scala/dependency/` created for `twitter_scrooge`
1041+
toolchain dependencies. If your project happens to depend on these aliases, you
1042+
can replace them with the following repository references:
1043+
1044+
| `bind()` alias under `//external:io_bazel_rules_scala/dependency/` | Repository reference |
1045+
| :-- | :-- |
1046+
| `scala/guava` | `@io_bazel_rules_scala_guava` |
1047+
| `thrift/javax_annotation_api` | `@io_bazel_rules_scala_javax_annotation_api` |
1048+
| `thrift/libthrift` | `@libthrift` |
1049+
| `thrift/mustache` | `@io_bazel_rules_scala_mustache` |
1050+
| `thrift/scopt` | `@io_bazel_rules_scala_scopt` |
1051+
| `thrift/scrooge_core` | `@io_bazel_rules_scala_scrooge_core` |
1052+
| `thrift/scrooge_generator` | `@io_bazel_rules_scala_scrooge_generator` |
1053+
| `thrift/util_core` | `@io_bazel_rules_scala_util_core` |
1054+
| `thrift/util_logging` | `@io_bazel_rules_scala_util_logging` |
1055+
1056+
[`bind()`]: https://bazel.build/reference/be/workspace#bind
1057+
1058+
To access these repositories under Bzlmod, you'll need to add the following to
1059+
your `MODULE.bazel` file:
1060+
1061+
```py
1062+
scala_deps.toolchains(
1063+
twitter_scrooge = True,
1064+
)
1065+
use_repo(
1066+
scala_deps,
1067+
"io_bazel_rules_scala_guava",
1068+
"io_bazel_rules_scala_javax_annotation_api",
1069+
"io_bazel_rules_scala_mustache",
1070+
"io_bazel_rules_scala_scopt",
1071+
"io_bazel_rules_scala_scrooge_core",
1072+
"io_bazel_rules_scala_scrooge_generator",
1073+
"io_bazel_rules_scala_util_core",
1074+
"io_bazel_rules_scala_util_logging",
1075+
"libthrift",
1076+
)
1077+
```
1078+
10281079
### Bazel module compatibility levels
10291080

10301081
`rules_scala` 7.0.0 will set the

0 commit comments

Comments
 (0)