Skip to content

Commit

Permalink
Bump protobuf to v26.1, update to use new interfaces. (#1317)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlw committed Apr 11, 2024
1 parent d5a7c5f commit 45e36fa
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Source/santactl/Commands/SNTCommandPrintLog.mm
Expand Up @@ -67,7 +67,7 @@ + (NSString *)longHelpText {
- (void)runWithArguments:(NSArray *)arguments {
JsonPrintOptions options;
options.always_print_enums_as_ints = false;
options.always_print_primitive_fields = true;
options.always_print_fields_with_no_presence = true;
options.preserve_proto_field_names = true;
options.add_whitespace = true;

Expand Down
4 changes: 2 additions & 2 deletions Source/santad/Logs/EndpointSecurity/Serializers/Protobuf.mm
Expand Up @@ -381,7 +381,7 @@ static inline void EncodeCertificateInfo(::pbv1::CertificateInfo *pb_cert_info,

::pbv1::SantaMessage *Protobuf::CreateDefaultProto(Arena *arena, struct timespec event_time,
struct timespec processed_time) {
::pbv1::SantaMessage *santa_msg = Arena::CreateMessage<::pbv1::SantaMessage>(arena);
::pbv1::SantaMessage *santa_msg = Arena::Create<::pbv1::SantaMessage>(arena);

if (EnabledMachineID()) {
EncodeString([santa_msg] { return santa_msg->mutable_machine_id(); }, MachineID());
Expand Down Expand Up @@ -415,7 +415,7 @@ static inline void EncodeCertificateInfo(::pbv1::CertificateInfo *pb_cert_info,
// TODO: Profile this. It's probably not the most efficient way to do this.
JsonPrintOptions options;
options.always_print_enums_as_ints = false;
options.always_print_primitive_fields = true;
options.always_print_fields_with_no_presence = true;
options.preserve_proto_field_names = true;
std::string json;

Expand Down
Expand Up @@ -81,7 +81,7 @@
JsonPrintOptions DefaultJsonPrintOptions() {
JsonPrintOptions options;
options.always_print_enums_as_ints = false;
options.always_print_primitive_fields = false;
options.always_print_fields_with_no_presence = false;
options.preserve_proto_field_names = true;
options.add_whitespace = true;
return options;
Expand Down
8 changes: 3 additions & 5 deletions WORKSPACE
Expand Up @@ -17,11 +17,9 @@ http_archive(

http_archive(
name = "com_google_protobuf",
patch_args = ["-p1"],
patches = ["//external_patches/com_google_protobuf:13636.patch"],
sha256 = "07d69502e58248927b58c7d7e7424135272ba5b2852a753ab6b67e62d2d29355",
strip_prefix = "protobuf-24.3",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v24.3.tar.gz"],
sha256 = "4fc5ff1b2c339fb86cd3a25f0b5311478ab081e65ad258c6789359cd84d421f8",
strip_prefix = "protobuf-26.1",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v26.1.tar.gz"],
)

# We don't directly use rules_python but several dependencies do and they disagree
Expand Down
15 changes: 0 additions & 15 deletions external_patches/com_google_protobuf/13636.patch

This file was deleted.

5 changes: 0 additions & 5 deletions external_patches/com_google_protobuf/BUILD

This file was deleted.

0 comments on commit 45e36fa

Please sign in to comment.