Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup(bazel): convert googleapis system includes to normal ones #14804

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 0 additions & 26 deletions bazel/googleapis.modules.patch
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
diff --git a/BUILD.bazel b/BUILD.bazel
index 95e4c12e5..a901fd573 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,3 +1,7 @@
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"]) # Apache 2.0
+
genrule(
name = "build_gen",
outs = ["build_gen.sh"],
@@ -16,3 +20,15 @@ EOD
fi
""",
)
+
+# This build file overlays on top of the BUILD files for the googleapis repo,
+# and it adds a target that lets us include their header files using
+# angle-brackets, thus treating their headers as system includes. This allows
+# us to dial-up the warnings in our own code, without seeing compiler warnings
+# from their headers, which we do not own.
+cc_library(
+ name = "googleapis_system_includes",
+ includes = [
+ ".",
+ ],
+)
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 000000000..169133e43
Expand Down
4 changes: 2 additions & 2 deletions ci/cloudbuild/notifiers/alerts/function/function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <google/cloud/functions/cloud_event.h>
#include <google/cloud/functions/function.h>
#include "google/cloud/functions/function.h"
#include "google/cloud/functions/cloud_event.h"
#include <cppcodec/base64_rfc4648.hpp>
#include <curl/curl.h>
#include <fmt/core.h>
Expand Down
4 changes: 2 additions & 2 deletions ci/cloudbuild/notifiers/logs/function/function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "google/cloud/functions/cloud_event.h"
#include "google/cloud/storage/client.h"
#include "generate_svg_badge.h"
#include <google/cloud/functions/cloud_event.h>
#include <google/cloud/storage/client.h>
#include <cppcodec/base64_rfc4648.hpp>
#include <fmt/core.h>
#include <nlohmann/json.hpp>
Expand Down
2 changes: 1 addition & 1 deletion doc/cpp-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ example:
#include "google/cloud/x/bar.h"
#include "google/cloud/y/baz.h"
#include <grpcpp/blorg.h>
#include <google/bigtable/blah.h>
#include "google/bigtable/blah.h"
#include <map>
#include <vector>
#include <unistd.h>
Expand Down
12 changes: 6 additions & 6 deletions docfx/doxygen2syntax_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ TEST(Doxygen2SyntaxContent, Constructor) {

TEST(Doxygen2SyntaxContent, Struct) {
auto constexpr kExpected =
R"""(// Found in #include <google/cloud/async_operation.h>
R"""(// Found in #include "google/cloud/async_operation.h"
struct google::cloud::AsyncTimerResult { ... };)""";
pugi::xml_document doc;
doc.load_string(kStructXml);
Expand All @@ -427,7 +427,7 @@ struct google::cloud::AsyncTimerResult { ... };)""";

TEST(Doxygen2SyntaxContent, Class) {
auto constexpr kExpected =
R"""(// Found in #include <google/cloud/status.h>
R"""(// Found in #include "google/cloud/status.h"
class google::cloud::RuntimeStatusError { ... };)""";
pugi::xml_document doc;
doc.load_string(kClassXml);
Expand Down Expand Up @@ -455,7 +455,7 @@ TEST(Doxygen2SyntaxContent, TemplateClass) {
</compounddef>)xml";

auto constexpr kExpected =
R"""(// Found in #include <google/cloud/status_or.h>
R"""(// Found in #include "google/cloud/status_or.h"
template <
typename T>
class google::cloud::StatusOr { ... };)""";
Expand Down Expand Up @@ -485,7 +485,7 @@ TEST(Doxygen2SyntaxContent, TemplateStruct) {
</compounddef>)xml";

auto constexpr kExpected =
R"""(// Found in #include <google/cloud/status_or.h>
R"""(// Found in #include "google/cloud/status_or.h"
template <
typename T>
struct google::cloud::StatusOr { ... };)""";
Expand Down Expand Up @@ -826,7 +826,7 @@ TEST(Doxygen2SyntaxContent, FunctionException) {
TEST(Doxygen2Syntax, Class) {
auto constexpr kExpected = R"yml(syntax:
contents: |
// Found in #include <google/cloud/status.h>
// Found in #include "google/cloud/status.h"
class google::cloud::RuntimeStatusError { ... };
source:
id: google::cloud::RuntimeStatusError
Expand Down Expand Up @@ -854,7 +854,7 @@ TEST(Doxygen2Syntax, Class) {
TEST(Doxygen2Syntax, Struct) {
auto constexpr kExpected = R"yml(syntax:
contents: |
// Found in #include <google/cloud/async_operation.h>
// Found in #include "google/cloud/async_operation.h"
struct google::cloud::AsyncTimerResult { ... };
source:
id: google::cloud::AsyncTimerResult
Expand Down
6 changes: 3 additions & 3 deletions docfx/doxygen2yaml_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ TEST(Doxygen2Yaml, InheritSectionDefSummary) {
- cpp
syntax:
contents: |
// Found in #include <google/cloud/status_or.h>
// Found in #include "google/cloud/status_or.h"
template <
typename T>
class google::cloud::StatusOr { ... };
Expand Down Expand Up @@ -1130,7 +1130,7 @@ TEST(Doxygen2Yaml, Class) {
- cpp
syntax:
contents: |
// Found in #include <google/cloud/status.h>
// Found in #include "google/cloud/status.h"
class google::cloud::RuntimeStatusError { ... };
source:
id: google::cloud::RuntimeStatusError
Expand Down Expand Up @@ -1223,7 +1223,7 @@ TEST(Doxygen2Yaml, Struct) {
- cpp
syntax:
contents: |
// Found in #include <google/cloud/log.h>
// Found in #include "google/cloud/log.h"
struct google::cloud::LogRecord { ... };
source:
id: google::cloud::LogRecord
Expand Down
2 changes: 1 addition & 1 deletion examples/batch_logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "google/cloud/internal/time_utils.h"
#include "google/cloud/testing_util/example_driver.h"
#include "absl/strings/match.h"
#include <google/protobuf/text_format.h>
#include "google/protobuf/text_format.h"
#include <fstream>
#include <iostream>
#include <random>
Expand Down
4 changes: 2 additions & 2 deletions examples/hello_world_http/hello_world_http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <google/cloud/functions/http_request.h>
#include <google/cloud/functions/http_response.h>
#include "google/cloud/functions/http_request.h"
#include "google/cloud/functions/http_response.h"

namespace gcf = ::google::cloud::functions;

Expand Down
1 change: 0 additions & 1 deletion generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ cc_library(
"@com_github_nlohmann_json//:json",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
"@com_google_googleapis//:googleapis_system_includes",
"@com_google_googleapis//google/api:client_cc_proto",
"@com_google_googleapis//google/api:field_info_cc_proto",
"@com_google_googleapis//google/api:routing_cc_proto",
Expand Down
2 changes: 1 addition & 1 deletion generator/generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "google/cloud/internal/filesystem.h"
#include "google/cloud/status_or.h"
#include "absl/strings/str_split.h"
#include <google/api/client.pb.h>
#include "google/api/client.pb.h"
#include <future>
#include <string>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions generator/generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef GOOGLE_CLOUD_CPP_GENERATOR_GENERATOR_H
#define GOOGLE_CLOUD_CPP_GENERATOR_GENERATOR_H

#include <google/protobuf/compiler/code_generator.h>
#include <google/protobuf/descriptor.h>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h"
#include <string>

namespace google {
Expand Down
8 changes: 4 additions & 4 deletions generator/generator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include "generator/testing/error_collectors.h"
#include "generator/testing/fake_source_tree.h"
#include "generator/testing/printer_mocks.h"
#include <google/protobuf/compiler/importer.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include "google/protobuf/compiler/importer.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/io/zero_copy_stream.h"
#include <gmock/gmock.h>

namespace google {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "google/cloud/polling_policy.h"
#include "google/cloud/status_or.h"
#include "google/cloud/version.h"
#include <google/protobuf/duration.pb.h>
#include "google/protobuf/duration.pb.h"
#include <map>
#include <memory>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "google/cloud/status_or.h"
#include "google/cloud/version.h"
#include "google/cloud/iam_updater.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "google/cloud/version.h"
#include <generator/integration_tests/backup.pb.h>
#include <generator/integration_tests/test.pb.h>
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>

namespace google {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h"
#include "google/cloud/internal/unified_grpc_credentials.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <set>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "google/cloud/status_or.h"
#include "google/cloud/stream_range.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>

namespace google {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h"
#include "google/cloud/tracing_options.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <set>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "generator/integration_tests/golden/v1/internal/golden_thing_admin_stub.h"
#include "google/cloud/options.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <map>
#include <memory>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "google/cloud/status_or.h"
#include "google/cloud/stream_range.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.pb.h>
#include "google/longrunning/operations.pb.h"
#include <memory>

namespace google {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "google/cloud/tracing_options.h"
#include "google/cloud/version.h"
#include <generator/integration_tests/test.pb.h>
#include <google/longrunning/operations.pb.h>
#include "google/longrunning/operations.pb.h"
#include <memory>
#include <set>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "google/cloud/rest_options.h"
#include "google/cloud/version.h"
#include <generator/integration_tests/test.pb.h>
#include <google/longrunning/operations.pb.h>
#include "google/longrunning/operations.pb.h"
#include <memory>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "google/cloud/internal/rest_stub_helpers.h"
#include "google/cloud/status_or.h"
#include <generator/integration_tests/test.pb.h>
#include <google/longrunning/operations.pb.h>
#include "google/longrunning/operations.pb.h"
#include <memory>
#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "google/cloud/version.h"
#include <generator/integration_tests/backup.pb.h>
#include <generator/integration_tests/test.pb.h>
#include <google/longrunning/operations.pb.h>
#include "google/longrunning/operations.pb.h"
#include <memory>

namespace google {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "google/cloud/grpc_error_delegate.h"
#include "google/cloud/status_or.h"
#include <generator/integration_tests/test.grpc.pb.h>
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "google/cloud/version.h"
#include <generator/integration_tests/backup.pb.h>
#include <generator/integration_tests/test.grpc.pb.h>
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "generator/integration_tests/golden/v1/internal/request_id_stub.h"
#include "google/cloud/internal/unified_grpc_credentials.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <set>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "google/cloud/status_or.h"
#include "google/cloud/stream_range.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>

namespace google {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "generator/integration_tests/golden/v1/internal/request_id_stub.h"
#include "google/cloud/tracing_options.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <set>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "generator/integration_tests/golden/v1/internal/request_id_stub.h"
#include "google/cloud/options.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <map>
#include <memory>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "google/cloud/grpc_error_delegate.h"
#include "google/cloud/status_or.h"
#include <generator/integration_tests/test_request_id.grpc.pb.h>
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "google/cloud/status_or.h"
#include "google/cloud/version.h"
#include <generator/integration_tests/test_request_id.grpc.pb.h>
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "google/cloud/polling_policy.h"
#include "google/cloud/status_or.h"
#include "google/cloud/version.h"
#include <google/longrunning/operations.grpc.pb.h>
#include "google/longrunning/operations.grpc.pb.h"
#include <memory>
#include <string>

Expand Down
Loading
Loading