The upgrade of rules_java also upgrades error prone and this resulted in some additional errors reported in Protobuf's tests. Set the flag to report those as warning, but they should be cleaned up eventually.
PiperOrigin-RevId: 687070204
It's somewhat tedious to explicitly set this option on all of our C++ targets,
so I think ideally we should rely primarily on bazelrc files for setting
compiler flags. I tried to completely remove `COPTS`, but unfortunately that
did not work out--we have so many `-Wsign-compare` warnings that I think we
need to keep suppressing them for now or else we will get a lot of complaints.
However, I was able to get to the point where `-Wno-sign-compare` is the only
flag we need in `COPTS` for non-Windows builds. I explicitly set `-DHAVE_ZLIB`
on just the two targets that need it, and removed `-Wno-nonnull` since we are
already compliant with that warning. I moved `-Woverloaded-virtual` to our
bazelrc files so that CI will enforce that we remain compliant with that.
PiperOrigin-RevId: 684863987
When the user adds `option deprecated = true` for an `enum` or `message`, we
should add the `[[deprecated]]` attribute to the generated C++ `enum` or
`class`.
PiperOrigin-RevId: 670583253
Putting it into BUILD files unintentionally forces it on all our downstream users. Instead, we just want to enable this during testing and let them choose for themselves in their builds.
Note, that this expands the scope of -Werror to our entire repo for CI, so a bunch of fixes and opt-outs had to be applied to get this change passing.
Closed#14714
PiperOrigin-RevId: 666903224
We're seeing a high flake rate due to remote cache-misses only on Bazel 7 builds. The key change here seems to be adding the remote_download_output flag, but this also upgrades us to 7.1.1 and adds some retry behavior to caching issues.
PiperOrigin-RevId: 625892332
This check enforces that each C++ build target has the correct dependencies for
all headers that it includes. We have many targets that were not correct with
respect to this check, so I fixed them up.
I also cleaned up the C++ targets related to the well-known types. I created a
cc_proto_library() target for each one and removed the :wkt_cc_protos target,
since this was necessary to satisfy the layering check. I deleted the
//src/google/protobuf:protobuf_nowkt target and deprecated :protobuf_nowkt,
because the distinction between the :protobuf and :protobuf_nowkt targets was
not really correct. Neither one exposed the headers for the well-known types in
a way that was valid with respect to the layering check, and the idea of
bundling all the well-known types together is not idiomatic in Bazel anyway.
This is a breaking change, because the //:protobuf target no longer bundles the
well-known types. From now on they should be accessed through the new
//:*_cc_proto aliases in our top-level package.
I renamed the :port_def target to :port, which simplifies things a bit by
matching our internal name.
The original motivation for this change was that to move utf8_range onto our CI
infrastructure, we needed to make its dependency rules_fuzzing compatible with
Bazel 6. The rules_fuzzing project builds with the layering check, and I found
that the process of upgrading it to Bazel 6 made it take a dependency on
protobuf, which caused it to break due to layering violations. I was able to
work around this, but it would still be nice to comply with the layering check
so that we don't have to worry about this kind of thing in the future.
PiperOrigin-RevId: 595516736
I was thinking it would be a good idea to proactively opt into all upcoming
breaking change flag flips in Bazel, so this change does that by adding all the
relevant flags to the common bazelrc file we use in our CI jobs. There are
several that we cannot enable yet without breaking something, so I left those
commented out for now.
PiperOrigin-RevId: 580538273
If a change is committed while we're regenerating stale files, we should just bail and let the next job handle the refresh.
PiperOrigin-RevId: 510453613
In order to flip the flag, all downstream projects should be adapted. However, it is hard to fix them all if there are constant regressions. Adding it to the CI will ensure that once the project can build with incompatible_disallow_empty_glob it can keep building like that.
See: bazelbuild/bazel#15327
PiperOrigin-RevId: 507927389
This uses ccache + github caching to substantially decrease the time it takes to run XCode builds. Due to Bazel caching, these are some of our slowest tests, causing one of the biggest presubmit bottlenecks
PiperOrigin-RevId: 507794241