Changelog¶
5.8.0¶
Notes¶
A number of dependencies are blocked on being updated to their latest versions at present due to two
pending issues on upstream repositories. For Protobuf, rules_java and grpc-gateway, there is a
conflicting issue when multiple repositories specify Maven dependencies with a lock-file on the
@maven name. For gRPC, no recent versions have been published to the Bazel Central Registry.
Changes¶
None
Version Updates¶
Updated Bazel
apple_supportto 1.24.1Updated Bazel
aspect_bazel_libto 2.21.2Updated Bazel
aspect_rules_jsto 2.7.0Updated Bazel
bazel_skylibto 1.8.2Updated Bazel
rules_ccto 0.2.11Updated Bazel
rules_dotnetto 0.20.5Updated Bazel
rules_javato 8.15.2Updated Bazel
rules_pythonto 1.6.3Updated Bazel
rules_rustto 0.66.0Updated Bazel
rules_scalato 7.1.3Updated Bazel
rules_shellto 0.6.1Updated Bazel
rules_swift_package_managerto 1.9.0Updated Buf to 1.59.0
Updated Go
google.golang.org/protobufto v1.36.10Updated JS
@grpc/grpc-jsto 1.14.0Updated JS
grpc-webto 2.0.2Updated Python
multidictto 6.7.0Updated Swift
apple/swift-protobufto 1.32.0Updated Swift
grpc/grpc-swift-protobufto 2.1.1
5.7.1¶
Changes¶
Removed
experimental_use_cc_common_linkfrom Rust internal tool targets. #532
Version Updates¶
None
5.7.0¶
Changes¶
Removed unused gRPC-Gateway plugins
Rewrote internal file manipulation tools from C++ to Rust, to avoid varying levels of C++ standard support across platforms
Version Updates¶
Updated Bazel
apple_supportto 1.23.1Updated Bazel
aspect_bazel_libto 2.21.1Updated Bazel
aspect_rules_jsto 2.5.0Updated Bazel
protobufto 32.0Updated Bazel
rules_ccto 0.2.2Updated Bazel
rules_goto 0.57.0Updated Bazel
rules_pythonto 1.5.4Updated Bazel
rules_scalato 7.1.1Updated Bazel
rules_shellto 0.6.0Updated Bazel
rules_swift_package_managerto 1.4.0Updated Bazel
toolchains_protocto 0.5.0Updated Buf to 1.57.0
Updated Go
google.golang.org/protobufto v1.36.8Updated JS
google-protobufto 4.0.0Updated Python
h2to 4.3.0Updated Scala
com.thesamet.scalapb:*to 0.11.20
5.6.0¶
Changes¶
Removed all uses of
ctx.actions.run_shell()from the core module, which improves compatibility with Windows and avoids path escaping issuesThe gRPC-Gateway
gateway_openapiv2_compilerule has been reverted to not use directory output due to issues with selecting single outputs from the directory. A newgateway_openapiv2_combined_compilerule has been added to create a single output file as{name}.swagger.jsonMigrated Swift from
grpc/grpc-swifttogrpc/grpc-swift-2Switched C# gRPC plugin to use deterministic outputs rather than a tree (dir) artifact output
Fixed bug where plugins with same name used on same compilation target could conflict. This was not possible with the builtin plugins in these rules, but could have been hit by users with custom plugins
Version Updates¶
Updated Bazel
aspect_rules_jsto 2.4.2Updated Bazel
gazelleto 0.45.0Updated Bazel
grpcto 1.74.1Updated Bazel
rules_ccto 0.2.0Updated Bazel
rules_goto 0.56.1Updated Bazel
rules_javato 8.15.1Updated Bazel
rules_pythonto 1.5.2Updated Bazel
rules_shellto 0.5.1Updated Bazel
rules_swiftto 3.1.2Updated Buf to 1.56.0
Updated Go
google.golang.org/grpcto v1.74.2Updated Go
google.golang.org/protobufto v1.36.7Updated Java
com.google.protobuf:*to 4.31.1Updated Java
io.grpc:grpc-*to 1.74.0Updated Python
multidictto 6.6.4Updated Swift
grpc/grpc-swifttogrpc/grpc-swift-22.1.0Updated Swift
grpc/grpc-swift-protobufto 2.0.0
5.5.0¶
Changes¶
Restored C# language support
Version Updates¶
Updated Bazel
rules_ccto 0.1.4Updated Bazel
rules_javato 8.14.0
5.4.0¶
Changes¶
Switched Maven dependencies for Java and Scala to share the common
mavenname formaven.install, rather than use a unique deconflicted name that can cause classpath issues with duplicate dependencies with differing versions. This means that the Protobuf and gRPC dependencies used internally byjava_proto_libraryetc will be resolved alongside any dependencies from the root module and the versions can be overridden there. Note that the Java protoc plugins are not sourced from Maven and thus care needs to be taken to ensure the runtime version guarantees are met. Scala version specific dependencies are still sourced from separate Maven repositories. See #449
Version Updates¶
Updated Bazel
apple_supportto 1.22.1Updated Bazel
aspect_rules_jsto 2.4.0Updated Bazel
bazel_skylibto 1.8.1Updated Bazel
rules_ccto 0.1.3Updated Bazel
rules_jvm_externalto 6.8Updated Bazel
rules_pythonto 1.5.1Updated Bazel
rules_swiftto 3.1.1Updated Scala
com.thesamet.scalapb:*to 0.11.19
5.3.1¶
Changes¶
Fixed download path for grpc-web protoc plugin on any arm64 platform
Version Updates¶
Updated Bazel
bazel_skylibto 1.8.0Updated Bazel
grpcto 1.73.1Updated Bazel
rules_javato 8.13.0Updated Bazel
rules_pythonto 1.5.0Updated Bazel
rules_swift_package_managerto 1.3.0Updated Bazel
toolchains_protocto 0.4.3Updated Go
google.golang.org/grpcto v1.73.0Updated Go
google.golang.org/protobufto v1.36.6Updated Java
io.grpc:grpc-*to 1.73.0
5.3.0¶
Changes¶
Restored JavaScript language support, thanks to @Lev1ty
Version Updates¶
None
5.2.1¶
Changes¶
No major changes, only version updates
Version Updates¶
Updated Bazel
buildifier_prebuiltto 8.2.0.2Updated Bazel
gazelleto 0.44.0Updated Bazel
rules_ccto 0.1.2Updated Bazel
rules_goto 0.55.1Updated Bazel
rules_shellto 0.5.0Updated Bazel
rules_swiftto 3.0.2Updated Bazel
rules_swift_package_managerto 1.0.0Updated Swift
grpc/grpc-swiftto 2.2.3Updated Swift
grpc/grpc-swift-protobufto 1.3.1
5.2.0¶
Changes¶
Restored Scala language support
Restored Swift langauge support
Fixed usage of
optionsattr on Bazel 8, where the Label canonicalisation has changedFixed loading of Buf protoc lint plugin
Fixed loading of Buf protoc breaking plugin on linux/arm64
Switched gRPC-Gateway to be loaded directly from Bazel bzlmod dependency rather than via Go/Gazelle
The
gateway_openapiv2_compile()rule now uses a directory as output, to allow creating a combined output file. #382Fixed
bzl_libraryreferencing incorrect dependency in@protobufSwitched from
@bazel_tool//platformsto@platformsThe Python dependencies for Protobuf and gRPC are now loaded from the
@protobufand@grpcbzlmod workspaces respectively, rather than from PyPI wheels. This is necessary to prevent version skew between the protoc version and the runtime version, but unfortunately may result in longer uncached build timesAdded CI testing on MacOS (x64 and arm)
Version Updates¶
Updated Bazel
protobufto 31.1Updated Bazel
rules_goto 0.55.0Updated Bazel
rules_javato 8.11.0Updated Bazel
toolchains_protocto 0.4.2Updated Java
com.google.protobuf:protobuf-javato 4.31.1
5.1.0¶
Changes¶
Added support for Bazel 8 and dropped Bazel 6 support
Replaced deprecated
rules_protowithprotobufAdded support for providing extra plugins to rules at runtime using the
extra_pluginsattributeFixed version skew between grpc-gateway protoc plugin and runtime
Added optional generation of
.pyifiles for PythonSwitched Objective-C sources to use
non_arc_srcsDropped C language support, as the μpb API is considered unstable and the C plugin is no longer publicly visible from the
protobufworkspaceRemoved usage of
ctx.resolve_toolsthat is deprecatedAdded Python 3.13 to supported list
Replaced custom grpclib plugin with
py_console_script_binary
Version Updates¶
Updated Bazel
apple_supportto 1.22.0Updated Bazel
buildifier_prebuiltto 8.0.3Updated Bazel
gazelleto 0.43.0Updated Bazel
grpcto 1.72.0Updated Bazel
protobufto 30.2Updated Bazel
rules_ccto 0.1.1Updated Bazel
rules_goto 0.54.0Updated Bazel
rules_javato 8.11.0Updated Bazel
rules_pythonto 1.4.1Updated Bazel
rules_shellto 0.4.1Updated Bazel
toolchains_protocto 0.4.1Updated Buf to 1.54.0
Updated Go
google.golang.org/protobufto v1.36.0Updated Go
google.golang.org/grpcto v1.72.1Updated
grpc-gatewayto 2.26.3Updated Java
com.google.protobuf:protobuf-javato 4.30.2Updated Java
io.grpc:grpc-apito 1.72.0Updated Python
grpcioto 1.71.0Updated Python
grpclibto 0.4.8Updated Python
protobufto 6.30.2
5.0.1¶
Fixed gRPC-Gateway OpenAPI plugin on Linux ARM64 #360
5.0.0¶
The 5.0.0 release introduces support for Bzlmod and drops support for WORKSPACE. This has required a large restructure of the repo, with the code being split into multiple modules. A ‘core’ module provides common types and compilation support, whilst per-language modules provide the integration with each language’s specific third-party modules and tools. Moving to Bzlmod provides a huge improvement in the stability and maintainability of these rules, as third-party transitive dependency management has been handed off to Bazel and new versions of gRPC and Protobuf should hopefully be able to be supported more rapidly.
At present, a limited number of languages have been migrated from the 4.x.x releases, with support for the remaining languages being tracked here. For these unsupported languages - or for WORKSPACE repos - it is recommended you continue using the 4.x.x releases.
The way you use these rules is largely unchanged, but unfortunately the paths used for load of
the rules will have changed due to the splitting into language-specific modules. For example, the
following load:
load("@rules_proto_grpc//go:defs.bzl", "go_proto_library")
Will become:
load("@rules_proto_grpc_go//:defs.bzl", "go_proto_library")
Details on the new rule loads can, as always, be found on each language’s page in the documentation. Examples for each language are also provided in the repo’s examples directory.
Some key other changes include:
The versions of gRPC and Protobuf are updated to the latest available in Bazel Central Registry
Python now pulls gRPC and Protobuf from pip wheels
Buf rules now work on Windows (requires the
--enable_runfilesflag to be set)
Should you have any issues with the new release, please open a new issue or discussion.
4.6.0¶
General¶
Fixed incompatibility with Bazel 7 for the C, C++ and Objective-C rules. #298
Rust¶
4.5.0¶
General¶
C++¶
Added support for
NO_PREFIXoutput mode. #276
C#/F#¶
Updated gRPC to 2.53.0
Go¶
Updated
rules_goto 0.39.1
Python¶
Added support for passing
dataattr to Python library rules. #257
Ruby¶
Updated
rules_rubyto latest
Rust¶
Major change: Replaced Rust protobuf and gRPC libraries with Prost and Tonic respectively. See the Rust rules documentation for examples of how this change can be adopted. #265
4.4.0¶
General¶
Increased minimum supported Bazel version from 5.0.0 to 5.3.0. #230
Added support for param file for excess arguments, which allows for longer commands lines without failure
Fixed Windows incompatibility due to test workspace containing quote character in path
The proto_compile function is now exported in the public defs.bzl for use in external rules
Added static release assets generation, which will change the format of the download URL to use in your WORKSPACE. See the sample installation docs for the new URL
Go¶
Updated
github.com/envoyproxy/protoc-gen-validateto 1.0.0
grpc-gateway¶
WORKSPACE update needed: Renamed
grpc-gatewayrepository name fromgrpc_ecosystem_grpc_gatewaytocom_github_grpc_ecosystem_grpc_gateway_v2, to match the naming used by Gazelle. You may need to update your WORKSPACE file to use the new name
Objective-C¶
Fixed expected naming of output files for proto files containing numbers in file name. #253
4.3.0¶
General¶
Updated protobuf to 21.10
Updated grpc to 1.51.0
Updated
rules_prototo 5.3.0-21.5Updated
bazel_skylibto 1.3.0Added support for paths to proto files that contain spaces or other special characters
Added forwarding of all standard Bazel rule attributes for library macros
Added support for providing plugin-specific environment variables
Buf¶
Updated Buf plugins to v1.9.0
C¶
WORKSPACE update needed: The upb version is now sourced from gRPC dependencies to prevent version skew in mixed C and C++ workspaces. See the example workspaces for the new template
C#/F#¶
Updated gRPC to 2.50.0
Go¶
Updated
google.golang.org/protobufto 1.28.1Updated
rules_goto 0.36.0Updated
github.com/envoyproxy/protoc-gen-validateto 0.9.0
grpc-gateway¶
Updated
grpc-gatewayto 2.14.0
gRPC-Web¶
Added support for M1 builds of grpc-web
Updated
grpc-webto 1.4.2
Java¶
Updated
rules_jvm_externalto 4.5
JavaScript¶
Updated
google-protobufto 3.21.2Updated
@grpc/grpc-jsto 1.7.3Updated
rules_nodejsto 5.7.1
Python¶
Updated
rules_pythonto 0.15.0Updated
grpclibto 0.4.3WORKSPACE update needed: The Python dependencies have moved from
pip_installtopip_parse, as advised byrules_pythonauthors. See the example workspaces for the new template, which is only necessary if you are using grpclibRemoved subpar dependency
Ruby¶
Updated
google-protobufto 3.21.9Updated
grpcto 1.50.0
Rust¶
Updated
rules_rustto 0.14.0
Scala¶
Update ScalaPB to 0.11.12
Updated
rules_scalato latest
Swift¶
Updated
rules_swiftto 1.4.0
4.2.0¶
General¶
Updated protobuf to 21.5
Updated grpc to 1.48.0
Updated zlib to 1.2.12
Switched default
use_built_in_shell_environmenttoTrue. #182Bumped minimum Bazel version to 5.0.0
Updated
bazel_skylibto 1.2.1Added section to the documentation on overriding dependencies
Fixed compilation failure when using a mix of plugins that output directories and files
Buf¶
Updated Buf plugins to v1.7.0
Added support for M1/arm64
C++¶
WORKSPACE update needed: You now need to load
grpc_extra_depsin your WORKSPACE file. See the example workspaces for the new template
C#/F#¶
Breaking change: The C# and F# rules have switched from using the deprecated
Grpc.Coreto the newGrpc.Net.ClientandGrpc.AspNetCoreUpdated gRPC to 2.47.0
Updated
rules_dotnetto latestUpdated
FSharp.Coreto 6.0.5Updated
Protobuf.FSharpto 0.2.0Updated
grpc-fsharpto 0.2.0
Docs¶
Updated
protoc-gen-docto 1.5.1
Go¶
Updated
rules_goto 0.34.0Updated
gazelleto 0.26.0Updated
protoc-gen-validateto 0.6.7
grpc-gateway¶
Updated
grpc-gatewayto 2.11.3
gRPC-Web¶
Updated
grpc-webto 1.3.1
JavaScript¶
Updated
rules_nodejsto 5.5.2Moved to
protocolbuffers/protobuf-javascriptUpdated
@grpc/grpc-jsto 1.6.7WORKSPACE update needed: The
build_bazel_rules_nodejs_dependenciesrule needs to be added to your WORKSPACETypeScript support is currently somewhat broken, see here. This is not a change from 4.1.0
Objective-C¶
Fixed expected naming of output files for proto files containing dash in file name. #177
WORKSPACE update needed: You now need to load
grpc_extra_depsin your WORKSPACE file. See the example workspaces for the new template
Python¶
Updated
rules_pythonto 0.10.2WORKSPACE update needed: You now need to load
grpc_extra_depsin your WORKSPACE file. See the example workspaces for the new template
Rust¶
Updated
rules_rustto 0.9.0
Scala¶
Updated
rules_scalato latestUpdated
ScalaPBto 0.11.10
Swift¶
Updated
rules_swiftto 1.1.0
4.1.1¶
Python¶
Ensured Python dependencies are correctly updated
4.1.0¶
The 4.1.0 is mostly an incremental update of dependencies. However, users of the Go and grpc-gateway rules should see the note below about a change in WORKSPACE order required to avoid resolving very old versions of dependencies via Gazelle.
General¶
Updated protobuf to 3.19.1
Updated grpc to 1.42.0
C#/F#¶
Updated gRPC to 2.42.0
Updated
rules_dotnetto latest
Go¶
Updated
rules_goto 0.29.0Updated
gazelleto 0.24.0. Note that Gazelle has added multiple dependencies in 0.24.0 that conflict with our dependencies and are at quite old versions. If you get an error aboutSupportPackageIsVersion7, you must swap the order you rungazelle_dependencies()in your WORKSPACE to be afterrules_proto_grpc_go_repos. See this issue for further detailsUpdated
com_github_envoyproxy_protoc_gen_validateto 0.6.2
grpc-gateway¶
See above note about Gazelle
gRPC-Web¶
Updated
grpc-webto 1.3.0
JavaScript¶
Updated
rules_nodejsto 4.4.6Updated
@grpc/grpc-jsto 1.4.4
Python¶
Updated
rules_pythonto 0.5.0
Ruby¶
Updated
rules_rubyto 0.6.0
Rust¶
Updated
rules_rustto latest. Note that newrules_rustcommits have moved their rules definitions from/rust/rust.bzlto/rust/defs.bzl, which is now required to be followed by these rules. No backwards compatibility is possible here as the original path has been removed
Scala¶
Updated
rules_scalato latestUpdated
ScalaPBto 0.11.6
Swift¶
Updated
rules_swiftto 0.24.0Updated
grpc-swiftto 1.6.0
4.0.1¶
General¶
Fixed plugin label specific values in
optionsattr being ignored
4.0.0¶
The 4.0.0 release brings a number of key improvements to tidy up rules_proto_grpc, along with updates to all of the main dependencies. For most users, 4.0.0 will be a drop-in replacement to the 3.x.x releases and the updates for each language are shown below. Should you have any issues with the new release, please open a new issue or discussion.
The following changes are considered ‘breaking’, requiring the step to the 4.x.x release cycle:
The transitive aspect-based compilation mode using the
depsattribute is now completely removed. This mode was deprecated in 3.0.0 and all use of the transitive mode will have shown a warning. If all of your uses of rules_proto_grpc use theprotosattribute, 4.0.0 will be no different from 3.x.x. See here for further details. If you have written your own rules for a custom plugin, please see the updated and simplified rule template at Custom Plugins.The
//nodejsaliases for the//jsrules have been removed. Again, these were deprecated in the 3.x.x cycle and printed a warning when used. If you are still using these aliases, you can simply change your imports to use the//jsprefixed rules.The Rust rules have switched gRPC implementation to grpc. In 3.x.x, we used grpc-rs/grpcio, which wraps the C/C++ implementation of gRPC directly. However, the wrapping process was extremely error prone, with updates of either Rust rules or gRPC causing linker failures and significant maintenance burden. Should you still need grpcio crate support, the 3.1.1 release continues to work but may have issues with newer gRPC versions. The replacement grpc crate is self-described as ‘not suitable for production use’ but is more readily supportable by these rules in the short term. In the longer term, support for prost and tonic is also on the roadmap, but is waiting for protoc plugins to be available.
When using JavaScript library rules, the require path for generated files no longer includes the
<target_name>_pbpath segment by default. For the previous behaviour, setlegacy_path = Trueon the library. #107
General¶
Updated protobuf to 3.18.0
Updated grpc to 1.40.0
Updated
rules_prototo 4.0.0Documentation has moved to rules-proto-grpc.com. Existing links to the old location will continue to work
Transitive aspect-based compilation has been removed
The
output_filesattribute ofProtoCompileInfohas changed from a dict of depsets to a single depset. This is generally an internal implementation detail, so is unlikely to affect any rule users.
C¶
Updated
upbto latest
C#/F#¶
Added F# support. #127
Updated gRPC to 2.40.0
D¶
Updated
rules_dto latest
Doc¶
Updated
protoc-gen-docto 1.5.0Added
doc_template_compileto generate output using a custom Go template file.
Go¶
Updated
rules_goto v0.28.0Added validator rules using protoc-gen-validate. #16
grpc-gateway¶
Updated
grpc-gatewayto 2.6.0
Java¶
Updated
grpc-javato 1.40.1
JavaScript¶
Breaking change: The require path for generated files no longer includes the
<target_name>_pbpath segment by default. For the previous behaviour, setlegacy_path = Trueon the library. #107Added
package_nameattribute to library rules, which allows customising the package name of the generated library. By default if unspecified, the target name will continue to be used as in previous versions.Updated
rules_nodejsto 4.2.0Updated
@grpc/grpc-jsto 1.3.7Updated
grpc-toolsto 1.11.2Updated
ts-protoc-gento 0.15.0
Python¶
Updated
rules_pythonto 0.4.0Updated
sixto 1.16.0
Ruby¶
Updated
rules_rubyto 0.5.2WORKSPACE update needed: The
ruby_bundlecall in your workspace needs an extraincludeattribute for grpc to work as expected. Please see the Ruby examples
Rust¶
Updated
rules_rustto latestBreaking change: Replaced
grpciowithgrpc. Please see above description for full details on whygrpciois no longer supportable and the long term aim to support prost and tonicUpdated
protobufandprotobuf-codegento 2.25.1
Scala¶
Updated
rules_scalato latestUpdated
ScalaPBto 0.11.5WORKSPACE update needed: Dependencies are now fetched with
maven_install. You will need to update your WORKSPACE to match the current example.
Swift¶
Updated
rules_swiftto 0.23.0Updated
grpc-swiftto 1.4.1Updated
swift-logto 1.4.2Updated
swift-nioto 2.32.3Updated
swift-nio-extrato 1.10.2Updated
swift-nio-http2to 1.18.3Updated
swift-nio-sslto 2.15.1Updated
swift-nio-transport-servicesto 1.11.3
TypeScript¶
The default mode for TypeScript gRPC compilation has changed to
grpc-js. This means imports should now use@grpc/grpc-jsinstead ofgrpc#134
3.1.1¶
Improved documentation is now available at https://rules-proto-grpc.aliddell.com
3.1.0¶
This update mostly brings fixes to the JavaScript rules, along with new rules for generating
Markdown, JSON, HTML or DocBook documentation from .proto files using
protoc-gen-doc. Additionally, new
buf_proto_lint and buf_proto_breaking rules have been added to support linting .proto files
and checking for breaking changes using Buf.
General¶
Updated protobuf to 3.15.3
Buf¶
Added linting and breaking change detection rules using Buf
Doc¶
Added documentation rules to generate Markdown, JSON, HTML or DocBook files using protoc-gen-doc
grpc-gateway¶
Updated grpc-gateway to 2.3.0
Fixed issue with mixing .proto files that do and do not contain services #72
JavaScript¶
Updated
rules_nodejsto 3.2.1WORKSPACE update needed: The dependencies for JavaScript rules must now be loaded into your local
package.json, which defaults to the name@npm. Theyarn_installwith namejs_modulesin your WORKSPACE can now also be removedUpdated
@grpc/grpc-jsto 1.2.8Fixed missing
DeclarationInfowhen using thejs_grpc_node_libraryorjs_grpc_web_libraryrules #113Added a TypeScript test workspace
Objective-C¶
Added the
objc_grpc_libraryexperimental rule
Rust¶
Updated
rules_rustto latestUpdated
grpcioto 0.8.0Updated
protobufto 2.22.0
3.0.0¶
This update brings some major improvements to rules_proto_grpc and solves many of the longstanding issues that have been present. However, in doing so there have been some changes that make a major version increment necessary and may require updates to your build files. The updates for each language are explained below and should you have any issues, please open a new issue or discussion.
The most substantial change is that compilation of .proto files into language specific files is no
longer transitive. This means that only the direct dependencies of a lang_proto_library will be
present within the generated library, rather than every transitive proto message. The justification
for this is below, but if you’re just interested in the changes, you can skip down to the next
heading.
In previous versions of rules_proto_grpc, the compilation aspect would compile and aggregate all dependent .proto files from any top level target. In hindsight, this was not the correct behaviour and led to many bugs, since you may end up creating a library that contains compiled proto files from a third party, where you should instead be depending on a proper library for that third party’s protos.
Even in a single repo, this may have meant multiple copies of a single compiled proto file being present in a target, if it is depended on via multiple routes. For some languages, such as C++, this breaks the ‘one definition rule’ and produces compilation failures or runtime bugs. For other languages, such as Python, this just meant unnecessary duplicate files in the output binaries.
Therefore, in this release of rules_proto_grpc, there is now a recommedned option to bundle only the
direct proto dependencies into the libraries, without including the compiled transitive proto
files. This is done by replacing the deps attr on lang_{proto|grpc}_{compile|library} with
the protos attr. Since this would be a substantial breaking change to drop at once on a large
project, the new behaviour is opt-in in 3.0.0 and the old method continues to work throughout the
3.x.x release cycle. Rules using the previous deps attr will have a warning written to console to
signify that your library may be bundling more than expect and should switch attr.
As an additional benefit of this change, we can now support passing arbitrary per-target rules to
protoc through the new options attr of the rules, which was a much sought after change that was
impossible in the aspect based compilation.
Switching to non-transitive compilation¶
In short, replace deps with protos on your targets:
# Old
python_grpc_library(
name = "routeguide",
deps = ["//example/proto:routeguide_proto"],
)
# New
python_grpc_library(
name = "routeguide",
protos = ["//example/proto:routeguide_proto"],
)
In applying the above change, you may discover that you were inheriting dependencies transitively
and that your builds now fail. In such cases, you should add a
lang_{proto|grpc}_{compile|library} target for those proto files and depend on it explicitly
from the relevant top level binaries/libraries.
General Changes¶
Updated protobuf to 3.15.1
Updated gRPC to 1.35.0
All rules have new per-target
optionsandextra_protoc_argsattributes to control options to protoc #54 #68 #105Updated
rules_prototo latest headaspect.bzlandplugin.bzlhave merged to a single top leveldefs.bzlThe minimum supported Bazel version is 3.0.0. Some language specific rules may require 4.0.0
Android¶
WORKSPACE update needed: The WORKSPACE imports necessary for Android rules have been updated due to upstream changes in
grpc-java. Please see the examples for the latest WORKSPACE template for the Android rules
C¶
Added experimental rules for C using upb #20
C++¶
Closure¶
Closure rules have been removed. In practice these have been superceded by the Javascript rules, but if you are an active user of these rules please open a discussion.
C#¶
Updated
rules_dotnetto 0.0.7. Note that the new versions ofrules_dotnetdrop support for .Net Framework and Mono and require use of alternate platforms. Please see the examples for the latest WORKSPACE template for the C# rulesUpdated
Grpcto 2.35.0
D¶
Updated
rules_dto latest
Go¶
Updated
rules_goto 0.25.1WORKSPACE update needed: It is now necessary to specify
versiontogo_register_toolchainsThe plugin used for compiling .proto files for Go has switched to the new google.golang.org/protobuf #85
Updated
gazelleto 0.22.3Updated
org_golang_x_netto v0.0.0-20210129194117-4acb7895a057Updated
org_golang_x_textto 0.3.5Well-known types are now depended on by default
Removed support for GoGo rules
grpc-gateway¶
Updated
grpc-gatewayto 2.2.0The
gateway_swagger_compilerule has been replaced withgateway_openapiv2_compile#93The grpc-gateway rules have move to repo top level, meaning they are no longer under the
github.com/...prefix. To update your use of these rules find and replace@rules_proto_grpc//github.com/grpc-ecosystem/grpc-gatewaywith@rules_proto_grpc//grpc-gateway
gRPC-Web¶
The gRPC-Web rules have moved into
//jsText mode generation is now supported #59
Java¶
WORKSPACE update needed: The WORKSPACE imports necessary for Java rules have been updated due to upstream changes in
grpc-java. Please see the examples for the latest WORKSPACE template for the Java rules
NodeJS/JavaScript¶
The JavaScript rules have moved from
@rules_proto_grpc//nodejsto@rules_proto_grpc//js, but the old rules are still aliased to ease transitionUpdated
rules_nodejsto 3.1.0Updated
@grpc/grpc-jsto 1.2.6Added typescript generation to JS rules
Objective-C¶
Added
coptargument pass-through for Obj-C library rules.Header and source files are now correctly passed to the underlying
cc_libraryrule #40
Python¶
Updated
rules_pythonto latestWORKSPACE update needed:
py_repositoriesfromrules_pythonis no longer required
Ruby¶
The Ruby rules have migrated from
yugui/rules_rubytobazelruby/rules_rubyChanged
rules_proto_grpc_gemstorules_proto_grpc_bundleWORKSPACE update needed: The above changes requiresupdates to your WORKSPACE, please see the examples for the latest WORKSPACE template for the Ruby rules
Open issue: The grpc gem may not be loadable in generated Ruby libraries, please see this issue
Rust¶
WORKSPACE update needed: The upstream repo
io_bazel_rules_rusthas been renamed torules_rust. Therust_workspacerule is also no longer requiredUpdated
rules_rustto latestUpdated
grpcioto 0.7.1Updated
protobufto 2.20.0
Scala¶
Update
rules_scalato latest #108WORKSPACE update needed: The
scala_configrule fromrules_scalais now required in your WORKSPACE
Swift¶
Updated
rules_swiftto 0.18.0Updated
grpc-swiftto 1.0.0Visibility of generated types is now configurable with
options#111
Thanks¶
Thanks to everyone who has contributed issues and patches for this release.
2.0.0¶
General¶
Updated
protobufto 3.13.0Updated
grpcto 1.32.0WORKSPACE update needed: These rules now depend on
rules_proto, which must be added to your WORKSPACE fileDropped support for the deprecated
transitivityattribute onproto_plugin. Theexclusionsattribute is the supported way of achieving thisThe
output_dirsattribute ofProtoCompileInfois now a depset, meaning directories will be deduplicatedRemoved the
deps.bzlfiles that have been deprecated since version 1.0.0Tags are now propagated correctly on library rules
Android¶
WORKSPACE update needed: The Guava dependency is no longer needed
C#¶
Updated
rules_dotnetto latest masterUpdated
Google.Protobufto 3.13.0Updated
Grpcto 2.32.0WORKSPACE update needed: There have been substantial changes to the required WORKSPACE rules for C#. Please see the C# language page
Closure¶
Updated
rules_closureto 0.11.0
D¶
Updated
rules_dto latest masterUpdated
protobuf-dto 0.6.2
grpc-gateway¶
Updated
grpc-gatewayto 1.15.0
gRPC Web¶
Updated gRPC Web to 1.2.1
Go¶
Updated
rules_goto 0.24.3Updated
bazel-gazelleto 0.21.1Updated
org_golang_x_netto v0.0.0-20200930145003-4acb6c075d10Updated
org_golang_x_textto 0.3.3
Java¶
WORKSPACE update needed: The Guava dependency is no longer needed
NodeJS¶
Updated
rules_nodejsto 2.2.0WORKSPACE update needed: The
defs.bzlfile inrules_nodejshas moved toindex.bzlWORKSPACE update needed: Running
yarn_install()is needed in more casesWORKSPACE update needed: Running
grpc_deps()is no longer necessary for just the NodeJS rulesMoved from
grpcto@grpc/grpc-jspackageLibrary rules have been enabled and now return
js_libraryrather thannpm_package
Python¶
Dropped Python 2 support
Updated
rules_pythonto latest masterUpdated
grpclibto 0.4.1Moved to using
grpciolibrary directly from the localgrpcrepository.Pinned dependency versions in requirements.txt using pip-compile
WORKSPACE update needed: The method for loading Pip dependencies has changed. Please see the Python language page.
WORKSPACE update needed: Using the Pip dependencies is now only necessary if you are using the
grpclibrules
Rust¶
Updated
rules_rustto latest masterUpdated
protobufcrate to 2.17.0Updated
grpciocrate to 0.6.0WORKSPACE update needed: The setup for
rules_rusthas changed in the newer version. Please see the Rust language page.WORKSPACE update needed: The
grpc_deps()rule is now needed for Rust
Scala¶
Updated
rules_scalato latest masterScalaPBis now pulled fromrules_scala, which uses 0.9.7WORKSPACE update needed: The
scala_proto_repositories()rule is now needed
Swift¶
Updated
rules_swiftto 0.15.0Updated
grpc-swiftto 0.11.0Moved the Swift library rules to be internal to this repo
1.0.2¶
Android / Closure / Java / Scala¶
Fixed loading of
com_google_errorprone_error_prone_annotationsReplaced Maven HTTP URLs with HTTPS URLs
Updated grpc-java, rules_closure and rules_scala to include Maven HTTPS fix
1.0.1¶
General¶
Fix support for plugins that use
output_directoryand produce no output files: #39Misc typo fixes and tidying
1.0.0¶
General¶
Bazel 1.0+ is now supported
The
rules_proto_grpc_repos()WORKSPACE rule has been added and is recommended to be usedProtobuf has been updated to 3.11.0
gRPC has been updated to 1.25.0
All other dependencies have been updated where available
The Bazel version is now checked for compatibility
Added more test workspaces
Removed tests that use
proto_source_rootAdded fix for duplicate proto files when using
import_prefix
Closure¶
The required WORKSPACE rules has been updated for all Closure-based rules, please check the documentation for the current recommended set
Go / GoGo / grpc-gateway¶
The required WORKSPACE rules has been updated for all Go-based rules, please check the documentation for the current recommended set
gRPC.js¶
Support for gRPC.js has been removed
Python¶
The way dependencies are pulled in has changed from using
rules_pipto the standardrules_python. Please check the documentation for the new WORKSPACE rules required and remove the old ones
Scala¶
Scala gRPC rules are currently not working fully. Due to delays in publishing support for Bazel 1.0, this support has been pushed back to 1.1.0
The required WORKSPACE rules has been updated for all Scala rules, please check the documentation for the current recommended set
0.2.0¶
General¶
Tests generated by the routeguide test matrix now correctly us the client/server executables
Ruby¶
Well-known proto files are excluded from generation in the Ruby plugins
The naming of the Ruby gems workspace has changed to remove the ‘routeguide’ prefix
Ruby client/server is now included in the non-manual test matrix
0.1.0¶
Initial release of rules_proto_grpc. For changes from predecessor rules_proto, please see
MIGRATION.md