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

Bump protobuf to 3.7.1 and regenerate code from .proto files #37

Merged
merged 2 commits into from
Feb 2, 2025
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Updated protobuf to 3.7.1 and regenerated code from .proto files

## v3.1.0 - 2024-06-23

- Added specific errors for missing minor or patch versions.
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ regex = "1.3"
# Byte collections
bytes = "1"
# Protobuf runtime
protobuf = "3.4"
protobuf = "=3.7.1"
Copy link
Contributor Author

@diemogebhardt diemogebhardt Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to pin protobuf and protobuf-codegen to a specific version (=) or not?

In case we don't want to pin it, we should uncomment the code in build.rs that is responsible for regenerating code from .proto files.

# gzip (de)compression
flate2 = "1.0"
# RSA signature and SHA256 checksum verification
Expand All @@ -53,4 +53,4 @@ toml = "0.8"

[build-dependencies]
# Protobuf code generation
protobuf-codegen = "3.4"
protobuf-codegen = "=3.7.1"
Copy link
Contributor Author

@diemogebhardt diemogebhardt Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to pin protobuf and protobuf-codegen to a specific version (=) or not?

In case we don't want to pin it, we should uncomment the code in build.rs that is responsible for regenerating code from .proto files.

14 changes: 6 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
fn main() {
// protobuf_codegen::Codegen::new()
// .out_dir("src/proto")
// .inputs(&[
// // "proto/names.proto",
// "proto/signed.proto",
// "proto/package.proto",
// "proto/versions.proto",
// ])
// .protoc()
// .include("proto")
// .input("proto/signed.proto")
// .input("proto/package.proto")
// .input("proto/versions.proto")
// .out_dir("src/proto")
// .run()
// .expect("Protobuf codegen failed.");
// .expect("Failed to generate protobuf code from .proto files.");
}
7 changes: 3 additions & 4 deletions src/proto/package.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.4.0. Do not edit
// .proto file is parsed by protoc 25.3
// This file is generated by rust-protobuf 3.7.1. Do not edit
// .proto file is parsed by protoc 29.3
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -9,7 +9,6 @@
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
Expand All @@ -23,7 +22,7 @@

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1;

// @@protoc_insertion_point(message:Package)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
7 changes: 3 additions & 4 deletions src/proto/signed.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.4.0. Do not edit
// .proto file is parsed by protoc 25.3
// This file is generated by rust-protobuf 3.7.1. Do not edit
// .proto file is parsed by protoc 29.3
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -9,7 +9,6 @@
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
Expand All @@ -23,7 +22,7 @@

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1;

// @@protoc_insertion_point(message:Signed)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
7 changes: 3 additions & 4 deletions src/proto/versions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.4.0. Do not edit
// .proto file is parsed by protoc 25.3
// This file is generated by rust-protobuf 3.7.1. Do not edit
// .proto file is parsed by protoc 29.3
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -9,7 +9,6 @@
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
Expand All @@ -23,7 +22,7 @@

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1;

// @@protoc_insertion_point(message:Versions)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down