|
1 | 1 | # Changelog
|
2 | 2 |
|
3 |
| -## Unreleased |
| 3 | +## 3.0.0 |
| 4 | + |
| 5 | +This update brings some major improvements to rules_proto_grpc and solves many of the longstanding issues that have been |
| 6 | +present. However, in doing so there have been some changes that make a major version increment necessary and may require |
| 7 | +updates to your build files. The updates for each language are explained below and should you have any issues, please |
| 8 | +open a new [issue](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/new) or |
| 9 | +[discussion](https://github.com/rules-proto-grpc/rules_proto_grpc/discussions/new). |
| 10 | + |
| 11 | +The most substantial change is that compilation of .proto files into language specific files is no longer transitive. |
| 12 | +This means that only the direct dependencies of a `lang_proto_library` will be present within the generated library, |
| 13 | +rather than every transitive proto message. The justification for this is below, but if you're just interested in the |
| 14 | +changes, you can skip down to the next heading. |
| 15 | + |
| 16 | +In previous versions of rules_proto_grpc, the compilation aspect would compile and aggregate all dependent .proto files |
| 17 | +from any top level target. In hindsight, this was not the correct behaviour and led to many bugs, since you may end up |
| 18 | +creating a library that contains compiled proto files from a third party, where you should instead be depending on a |
| 19 | +proper library for that third party's protos. |
| 20 | + |
| 21 | +Even in a single repo, this may have meant multiple copies of a single compiled proto file being present in a target, if |
| 22 | +it is depended on via multiple routes. For some languages, such as C++, this breaks the 'one definition rule' and |
| 23 | +produces compilation failures or runtime bugs. For other languages, such as Python, this just meant unnecessary |
| 24 | +duplicate files in the output binaries. |
| 25 | + |
| 26 | +Therefore, in this release of rules_proto_grpc, there is now a recommedned option to bundle only the direct proto |
| 27 | +dependencies into the libraries, without including the compiled transitive proto files. This is done by replacing the |
| 28 | +`deps` attr on `lang_{proto|grpc}_{compile|library}` with the `protos` attr. Since this would be a substantial breaking |
| 29 | +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 |
| 30 | +throughout the 3.x.x release cycle. Rules using the previous deps attr will have a warning written to console to signify |
| 31 | +that your library may be bundling more than expect and should switch attr. |
| 32 | + |
| 33 | +As an additional benefit of this change, we can now support passing arbitrary per-target rules to protoc through the new |
| 34 | +`options` attr of the rules, which was a much sought after change that was impossible in the aspect based compilation. |
| 35 | + |
| 36 | +### Switching to non-transitive compilation |
| 37 | + |
| 38 | +In short, replace `deps` with `protos` on your targets: |
| 39 | + |
| 40 | +```starlark |
| 41 | +# Old |
| 42 | +python_grpc_library( |
| 43 | + name = "routeguide", |
| 44 | + deps = ["//example/proto:routeguide_proto"], |
| 45 | +) |
| 46 | + |
| 47 | +# New |
| 48 | +python_grpc_library( |
| 49 | + name = "routeguide", |
| 50 | + protos = ["//example/proto:routeguide_proto"], |
| 51 | +) |
| 52 | +``` |
| 53 | + |
| 54 | +In applying the above change, you may discover that you were inheriting dependencies transitively and that your builds |
| 55 | +now fail. In such cases, you should add a `lang_{proto|grpc}_{compile|library}` target for those proto files and |
| 56 | +depend on it explicitly from the relevant top level binaries/libraries. |
| 57 | + |
| 58 | +### General Changes |
| 59 | +- Updated protobuf to 3.15.1 |
| 60 | +- Updated gRPC to 1.35.0 |
| 61 | +- All rules have new per-target `options` and `extra_protoc_args` attributes to control options to protoc |
| 62 | + [#54](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/54) |
| 63 | + [#68](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/68) |
| 64 | + [#105](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/105) |
| 65 | +- Updated `rules_proto` to latest head |
| 66 | +- `aspect.bzl` and `plugin.bzl` have merged to a single top level `defs.bzl` |
| 67 | +- The minimum supported Bazel version is 3.0.0. Some language specific rules may require 4.0.0 |
4 | 68 |
|
| 69 | +### Android |
| 70 | +- **WORKSPACE update needed**: The WORKSPACE imports necessary for Android rules have been updated due to upstream |
| 71 | + changes in `grpc-java`. Please see the examples for the latest WORKSPACE template for the Android rules |
| 72 | + |
| 73 | +### C |
| 74 | +- Added experimental rules for C using upb [#20](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/20) |
| 75 | + |
| 76 | +### C++ |
| 77 | +- Non-transitive mode resolves issue where the same proto may be defined more than once |
| 78 | + [#25](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/25) |
| 79 | +- Header and source files are now correctly passed to the underlying `cc_library` rule |
| 80 | + [#40](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/40) |
| 81 | + |
| 82 | +### Closure |
| 83 | +- Closure rules have been removed. In practice these have been superceded by the Javascript rules, but if you are an |
| 84 | + active user of these rules please open a discussion. |
| 85 | + |
| 86 | +### C# |
| 87 | +- Updated `rules_dotnet` to 0.0.7. Note that the new versions of `rules_dotnet` drop support for .Net Framework and |
| 88 | + Mono and require use of alternate platforms. Please see the examples for the latest WORKSPACE template for the |
| 89 | + C# rules |
| 90 | +- Updated `Grpc` to 2.35.0 |
| 91 | + |
| 92 | +### D |
| 93 | +- Updated `rules_d` to latest |
| 94 | + |
| 95 | +### Go |
| 96 | +- Updated `rules_go` to 0.25.1 |
| 97 | +- **WORKSPACE update needed**: It is now necessary to specify `version` to `go_register_toolchains` |
| 98 | +- The plugin used for compiling .proto files for Go has switched to the new google.golang.org/protobuf |
| 99 | + [#85](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/85) |
| 100 | +- Updated `gazelle` to 0.22.3 |
| 101 | +- Updated `org_golang_x_net` to v0.0.0-20210129194117-4acb7895a057 |
| 102 | +- Updated `org_golang_x_text` to 0.3.5 |
| 103 | +- Well-known types are now depended on by default |
| 104 | +- Removed support for GoGo rules |
| 105 | + |
| 106 | +### grpc-gateway |
| 107 | +- Updated `grpc-gateway` to 2.2.0 |
| 108 | +- The `gateway_swagger_compile` rule has been replaced with `gateway_openapiv2_compile` |
| 109 | + [#93](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/93) |
| 110 | +- The grpc-gateway rules have move to repo top level, meaning they are no longer under the `github.com/...` prefix. To |
| 111 | + Update your use of these rules find and replace `@rules_proto_grpc//github.com/grpc-ecosystem/grpc-gateway` with |
| 112 | + `@rules_proto_grpc//grpc-gateway` |
| 113 | + |
| 114 | +### gRPC-Web |
| 115 | +- The gRPC-Web rules have moved into `//js` |
| 116 | +- Text mode generation is now supported [#59](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/59) |
| 117 | + |
| 118 | +### Java |
| 119 | +- **WORKSPACE update needed**: The WORKSPACE imports necessary for Java rules have been updated due to upstream |
| 120 | + changes in `grpc-java`. Please see the examples for the latest WORKSPACE template for the Java rules |
| 121 | + |
| 122 | +### NodeJS/JavaScript |
| 123 | +- The JavaScript rules have moved from `@rules_proto_grpc//nodejs` to `@rules_proto_grpc//js`, but the old rules are |
| 124 | + still aliased to ease transition |
| 125 | +- Updated `rules_nodejs` to 3.1.0 |
| 126 | +- Updated `@grpc/grpc-js` to 1.2.6 |
| 127 | +- Added typescript generation to JS rules |
| 128 | + |
| 129 | +### Objective-C |
5 | 130 | - Added `copt` argument pass-through for Obj-C library rules.
|
6 |
| -- Added `CHANGELOG.md` |
| 131 | +- Header and source files are now correctly passed to the underlying `cc_library` rule |
| 132 | + [#40](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/40) |
| 133 | + |
| 134 | +### Python |
| 135 | +- Updated `rules_python` to latest |
| 136 | +- **WORKSPACE update needed**: `py_repositories` from `rules_python` is no longer required |
| 137 | + |
| 138 | +### Ruby |
| 139 | +- The Ruby rules have migrated from `yugui/rules_ruby` to `bazelruby/rules_ruby` |
| 140 | +- Changes `rules_proto_grpc_gems` to `rules_proto_grpc_bundle` |
| 141 | +- **WORKSPACE update needed**: The above changes requiresupdates to your WORKSPACE, please see the examples for the |
| 142 | + latest WORKSPACE template for the Ruby rules |
| 143 | +- **Open issue**: The `grpc` gem may not be loadable in generated Ruby libraries, please see |
| 144 | + [this issue](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/65). |
| 145 | + |
| 146 | +### Rust |
| 147 | +- **WORKSPACE update needed**: The upstream repo `io_bazel_rules_rust` has been renamed to `rules_rust`. The |
| 148 | + `rust_workspace` rule is also no longer required |
| 149 | +- Updated `rules_rust` to latest |
| 150 | +- Updated `grpcio` to 0.7.1 |
| 151 | +- Updated `protobuf` to 2.20.0 |
| 152 | + |
| 153 | +### Scala |
| 154 | +- Update `rules_scala` to latest [#108](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/108) |
| 155 | +- **WORKSPACE update needed**: The `scala_config` rule from `rules_scala` is now required in your WORKSPACE |
| 156 | + |
| 157 | +### Swift |
| 158 | +- Updated `rules_swift` to 0.18.0 |
| 159 | +- Updated `grpc-swift` to 1.0.0 |
| 160 | +- Visibility of generated types is now configurable with `options` |
| 161 | + [#111](https://github.com/rules-proto-grpc/rules_proto_grpc/issues/111) |
| 162 | + |
| 163 | +### Thanks |
| 164 | +Thanks to everyone who has contributed issues and patches for this release. |
7 | 165 |
|
| 166 | +--- |
8 | 167 |
|
9 | 168 | ## 2.0.0
|
10 | 169 |
|
|
82 | 241 | - Updated `grpc-swift` to 0.11.0
|
83 | 242 | - Moved the Swift library rules to be internal to this repo
|
84 | 243 |
|
| 244 | +--- |
85 | 245 |
|
86 | 246 | ## 1.0.2
|
87 | 247 |
|
|
91 | 251 | - Replaced Maven HTTP URLs with HTTPS URLs
|
92 | 252 | - Updated grpc-java, rules_closure and rules_scala to include Maven HTTPS fix
|
93 | 253 |
|
| 254 | +--- |
94 | 255 |
|
95 | 256 | ## 1.0.1
|
96 | 257 |
|
|
99 | 260 | - Fix support for plugins that use `output_directory` and produce no output files: #39
|
100 | 261 | - Misc typo fixes and tidying
|
101 | 262 |
|
| 263 | +--- |
102 | 264 |
|
103 | 265 | ## 1.0.0
|
104 | 266 |
|
|
135 | 297 | - 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
|
136 | 298 | - The required WORKSPACE rules has been updated for all Scala rules, please check the documentation for the current recommended set
|
137 | 299 |
|
| 300 | +--- |
138 | 301 |
|
139 | 302 | ## 0.2.0
|
140 | 303 |
|
|
146 | 309 | - The naming of the Ruby gems workspace has changed to remove the 'routeguide' prefix
|
147 | 310 | - Ruby client/server is now included in the non-manual test matrix
|
148 | 311 |
|
| 312 | +--- |
149 | 313 |
|
150 |
| -# 0.1.0 |
| 314 | +## 0.1.0 |
151 | 315 |
|
152 | 316 | Initial release of `rules_proto_grpc`. For changes from predecessor `rules_proto`, please see [MIGRATION.md](https://github.com/rules-proto-grpc/rules_proto_grpc/blob/master/docs/MIGRATION.md)
|
0 commit comments