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
Copy file name to clipboardExpand all lines: README.md
+87-30Lines changed: 87 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,26 +8,12 @@ Using Protocol Buffers with Bazel has always been difficult.
8
8
Also, Bazel does not ship with a hermetic toolchain, so you may have a handful of developers whose Bazel build is broken.
9
9
- Nearly every Bazel user has waited for `protoc` to compile from sources many, MANY times.
10
10
This universally slows down builds, especially due to issues like https://github.com/bazelbuild/bazel/issues/7095 where it is observed to be easily cache-busted.
11
-
- The versioning of the protobuf module on Bazel Central Registry has fallen behind and contains many patches.
12
-
As of mid-March 2024 there are [7 patches](https://github.com/bazelbuild/bazel-central-registry/tree/main/modules/protobuf/23.1/patches)
13
-
which essentially constitute a fork of the protobuf repo specifically for publishing to BCR.
11
+
- The protobuf Bazel module is quite complex and maintenance and support from the protobuf team has been inconsistent.
12
+
By using pre-built artifacts, Bazel users can follow the same well-tested as users of other build systems.
14
13
- Relying on the protobuf runtime for each language from the `@com_google_protobuf` repo forces you to use
15
14
the same version of the runtime for all languages in a monorepo, and matching protoc.
16
-
This makes it difficult to migrate to a monorepo, allowing some applications to move from their separate repo without changing their
17
-
dependency versions.
18
-
19
-
The key observations:
20
-
21
-
-`protoc` has always been distributed as pre-built binaries on https://github.com/protocolbuffers/protobuf/releases
22
-
- That distribution includes the "well known types" such as `timestamp.proto`
23
-
- The protobuf runtimes for each language are distributed to the appropriate package manager such as npm or PyPI.
24
-
25
-
Bazel 7 introduced `--incompatible_enable_proto_toolchain_resolution` to allow us fetch `protoc` rather than re-build it!
26
-
That flag ALSO decouples how each language rule locates the runtime.
27
-
Thanks to that flag, this repo simply contains a toolchain that resolves those pre-built binaries.
28
-
29
-
See `examples` for several language rules like `py_proto_library` and `java_proto_library`.
30
-
There is NO dependency on `@com_google_protobuf` anywhere.
15
+
This makes it difficult to migrate to a monorepo, allowing some applications to move from their separate repo without
16
+
changing their dependency versions.
31
17
32
18
## Support matrix
33
19
@@ -38,8 +24,91 @@ There is NO dependency on `@com_google_protobuf` anywhere.
0 commit comments