diff --git a/dependency_support/load_external.bzl b/dependency_support/load_external.bzl index 42fb946803..eb692fcfcd 100644 --- a/dependency_support/load_external.bzl +++ b/dependency_support/load_external.bzl @@ -228,7 +228,6 @@ def load_external_repositories(): ) # Released 2024-06-07, current as of 2024-06-26. - # TODO(google/xls#1408) Once updated, fix related TODOs. http_archive( name = "com_github_grpc_grpc", urls = ["https://github.com/grpc/grpc/archive/v1.64.2.tar.gz"], diff --git a/xls/common/file/filesystem.cc b/xls/common/file/filesystem.cc index 750123d54e..204be8ae89 100644 --- a/xls/common/file/filesystem.cc +++ b/xls/common/file/filesystem.cc @@ -62,15 +62,8 @@ class ParseTextProtoFileErrorCollector : public google::protobuf::io::ErrorColle const std::filesystem::path& file_name, const google::protobuf::Message& proto) : file_name_(file_name), proto_(proto) {} - // The Interface changed up-stream so this is an attempt to be - // compatible with older and newer versions. We can't add 'override' on any - // of the next two functions as it depends on the proto version we're using. - - // New interface. - // TODO(google/xls#1408) Once grpc/protobuf is updated, add 'override'. - // NOLINTNEXTLINE(modernize-use-override) void RecordError(int line, google::protobuf::io::ColumnNumber column, - std::string_view message) /* override */ { + std::string_view message) final { status_.Update(absl::Status( absl::StatusCode::kFailedPrecondition, absl::StrCat("Failed to parse ", proto_.GetDescriptor()->name(), @@ -79,14 +72,6 @@ class ParseTextProtoFileErrorCollector : public google::protobuf::io::ErrorColle "'. Proto parser error:\n", message))); } - // Deprecated interface, compatible with older proto. - // TODO(google/xls#1408) Once grpc/protobuf is updated, remove this method. - // NOLINTNEXTLINE(modernize-use-override) - void AddError(int line, int column, - const std::string& message) /* override */ { - RecordError(line, column, message); - } - absl::Status status() const { return status_; } private: diff --git a/xls/tools/proto_to_dslx.cc b/xls/tools/proto_to_dslx.cc index 4bf8a4e948..779035e39b 100644 --- a/xls/tools/proto_to_dslx.cc +++ b/xls/tools/proto_to_dslx.cc @@ -241,39 +241,13 @@ std::string GetParentPrefixedName(const std::string& top_package, // SourceTreeDescriptorDatabase. class DbErrorCollector : public google::protobuf::compiler::MultiFileErrorCollector { public: - // Compatiblity: new interface is Record*(), old interface is Add*(). - // For a transition period, be compatible with both, but note, we can't - // put 'override' on any of these depending on what version we're on. - - // New interface. - // TODO(google/xls#1408) Once grpc/protobuf is updated, add 'override'. - // NOLINTNEXTLINE(modernize-use-override) void RecordError(std::string_view filename, int line, int column, - std::string_view message) /* override */ { + std::string_view message) final { LOG(ERROR) << message; } - // TODO(google/xls#1408) Once grpc/protobuf is updated, add 'override'. - // NOLINTNEXTLINE(modernize-use-override) void RecordWarning(std::string_view filename, int line, int column, - std::string_view message) /* override */ { - LOG(WARNING) << message; - } - - // Deprecated interface, compatible with older proto. - // Remove, once we're solidly on latest protobuf. - - // TODO(google/xls#1408) Once grpc/protobuf is updated, remove this method. - // NOLINTNEXTLINE(modernize-use-override) - void AddError(const std::string& filename, int line, int column, - const std::string& message) /* override */ { - LOG(ERROR) << message; - } - - // TODO(google/xls#1408) Once grpc/protobuf is updated, remove this method. - // NOLINTNEXTLINE(modernize-use-override) - void AddWarning(const std::string& filename, int line, int column, - const std::string& message) /* override */ { + std::string_view message) final { LOG(WARNING) << message; } }; @@ -281,41 +255,15 @@ class DbErrorCollector : public google::protobuf::compiler::MultiFileErrorCollec // Simple output logger for any errors coming from a DescriptorPool. class PoolErrorCollector : public DescriptorPool::ErrorCollector { public: - // Compatiblity: new interface is Record*(), old interface is Add*(). - // For a transition period, be compatible with both, but note, we can't - // put 'override' on any of these depending on what version we're on. - - // New interface. - // TODO(google/xls#1408) Once grpc/protobuf is updated, add 'override'. - // NOLINTNEXTLINE(modernize-use-override) void RecordError(std::string_view filename, std::string_view element_name, const Message* descriptor, ErrorLocation location, - std::string_view message) /* override */ { + std::string_view message) final { LOG(ERROR) << message; } - // TODO(google/xls#1408) Once grpc/protobuf is updated, add 'override'. - // NOLINTNEXTLINE(modernize-use-override) void RecordWarning(std::string_view filename, std::string_view element_name, const Message* descriptor, ErrorLocation location, - std::string_view message) /* override */ { - LOG(WARNING) << message; - } - - // Deprecated interface, compatible with older proto. - // TODO(google/xls#1408) Once grpc/protobuf is updated, remove this method. - // NOLINTNEXTLINE(modernize-use-override) - void AddError(const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) /* override */ { - LOG(ERROR) << message; - } - - // TODO(google/xls#1408) Once grpc/protobuf is updated, remove this method. - // NOLINTNEXTLINE(modernize-use-override) - void AddWarning(const std::string& filename, const std::string& element_name, - const Message* descriptor, ErrorLocation location, - const std::string& message) /* override */ { + std::string_view message) final { LOG(WARNING) << message; } };