Prepare `google-cloud-cpp` for addition to BCR
In order to add our repository to the Bazel Central Registry, we cannot have any patches. So says smart Bazel person, @mering.
The one offending patch is for googleapis: https://github.com/googleapis/google-cloud-cpp/blob/main/bazel/googleapis.modules.patch
#14771 removed half of the patch. We balked at accepting the PR though because we did not love that we would have less control over the googleapis SHA update.
However, when we frame the trade-off like this, it seems like the PR is a net positive: Con:
- updating
googleapisSHA takes up to a day and is out of our control Pro: -
google-cloud-cppcan be added to BCR
Note that we should still be able to pin googleapis to any commit in our repo. We would just have to make sure that commit is on BCR first.
The other half of the patch is the system_includes bit. I don't know exactly what changes. If it is only about suppressing warnings, we were given the following tip:
We are using the following setting in our .bazelrc to hide warnings from external dependencies:
# Avoid warnings from third-party deps that we don't control. build --per_file_copt=external/.*@-Wno-everything
Quoting the documentation:
Only the root module's overrides take effect — if a module is used as a dependency, its overrides are ignored.
So it is important that google-cloud-cpp builds without the patch (which is specified in an override).
Edit: It is important that google-cloud-cpp builds with the same patches as on BCR when using overrides (specifically removing the system includes part).
I noticed you are already ignoring warnings from external dependencies: https://github.com/googleapis/google-cloud-cpp/blob/bf3bf1c976ba9c71d4a4a99e839b28ae809fc5f0/.bazelrc#L56-L58
I tried adding my suggestion to .bazelrc as well and couldn't notice a difference in the shown warnings.
The system includes part could be fixed by #14804.
The system includes part was fixed by #15229.
Fix for newer versions of googleapis on BCR: #15251
Looks like the merge of this should've resolved this:
- https://github.com/googleapis/google-cloud-cpp/pull/15263
Can we confirm?
GHA for Windows + Bazel is failing. This task is tracked separately in https://github.com/googleapis/google-cloud-cpp/issues/15293.
Closing this issue, as googleapis.modules.patch is no longer used in prepare-for-v3.0.0.