* Don't drop parser warnings on the floor
Fix#9343.
* Convert "missing syntax" warning to an actual warning
For some reason this warning was emitted as a log message rather than a
structured warning. Convert it to use the AddWarning API so that it gets
emitted with a file and line number by protoc, and is visible via the
error collection interface during programmatic use.
* Remove CaptureTestStderr() call
CaptureTestStderr() and GetCapturedTestStderr() have to be paired with each other.
* Adjust tests for new warnings
A few tests now produce warnings that they didn't before, but were
expecting not to see any stderr output. Adjust the tests accordingly.
Co-authored-by: Adam Cozzette <acozzette@google.com>
We already have the TypeRegistry abstraction for JSON parsing, so it lends itself well to this.
Note that this is much more useful than it would have been before C# gained pattern matching support: it's easy to imagine a switch statement/expression using pattern matching with the result of this, with cases for a set of known message types, for example.
* Switch to new provider syntax instead of structs.
* Expose files via `DefaultInfo`, and use that for `py_proto_library`.
* Several changes from buildifier.
The cmake tests are expected to fail for now due to Abseil sources missing from the distribution artifact. The tests are structured as expected failures.
These are all "toolchain-y" things, like copts, link_opts, and config_settings. These are very different from what is in //toolchain, though, so I chose the somewhat common name build_defs for the package. For now, I am only using this package for purely internal things. (Most public "defs"-type things should come from rules_proto/rules_cc, anyhow.)
This unrolls several lists based on WELL_KNOWN_PROTO maps, and move internal java codegen rules next to the corresponding java_library targets that expose them.
This adds logic to generate files with lists of files in cmake and automake syntax. This will allow Bazel to serve as the single Source of Truth for library sources, with cmake and automake using Bazel-derived definitions.
The definition files are not yet generated or checked in, but that will be a fairly straightforward set of follow-up changes.
When generating, it isn't uncommon to have generate >1 file at a time, and it is
likely that one file will include another. So cache the results as the
calculation is done so the work isn't repeated.
The previous pruning method didn't have any concept of tracking already done
work, this changes the algorithm to avoid the repeated work to make things more
minimal on the way up.
Some extremely deep proto graphs, this takes the generation time from around 15
min to under 45 seconds.