Skip to content

Commit

Permalink
fix: patch proto to latest + update script (#953)
Browse files Browse the repository at this point in the history
Update protobuf-codegen and protobuff to latest (3.7.1)

#### Migration notes

---

- [ ] The change comes with new or modified tests
- [ ] Hard-to-understand functions have explanatory comments
- [ ] End-user documentation is updated to reflect the change


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

- **Dependency Updates**
  - Updated `protobuf` library from version 3.5.1 to 3.7.1
  - Updated `protobuf-codegen` crate to version 3.7.1

- **Build Configuration**
- Modified protobuf compiler output option from `--rust_out` to
`--rs_out`
  - Simplified protobuf code generation command

- **Compatibility**
  - Ensured compatibility with latest protobuf runtime version

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
michael-0acf4 authored Jan 8, 2025
1 parent 8c0022e commit c60f4ee
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 21 deletions.
41 changes: 38 additions & 3 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,41 @@
"buildDepConfigs": {},
"portRef": "[email protected]",
"specifiedVersion": true
},
"bciqn2ct4mwrwyise3qlnabpine33dzt3lvnrhrbnkw4pnyryfe5is5a": {
"version": "3.7.1",
"buildDepConfigs": {
"cargo_binstall_ghrel": {
"version": "v1.10.9",
"buildDepConfigs": {},
"portRef": "[email protected]",
"specifiedVersion": false
},
"rust_rustup": {
"version": "1.80.1",
"buildDepConfigs": {
"rustup_rustlang": {
"version": "1.27.1",
"buildDepConfigs": {
"git_aa": {
"version": "2.34.1",
"buildDepConfigs": {},
"portRef": "[email protected]",
"specifiedVersion": false
}
},
"portRef": "[email protected]",
"specifiedVersion": false
}
},
"portRef": "[email protected]",
"profile": "minimal",
"specifiedVersion": true
}
},
"portRef": "[email protected]",
"crateName": "protobuf-codegen",
"specifiedVersion": true
}
}
},
Expand Down Expand Up @@ -853,7 +888,7 @@
},
"ghjkEnvProvInstSet_______task_env_gen-subs-protoc": {
"installs": [
"bciqm2rvnfe77sj6jekrm65oayuywt5lbrw33qezqjcg5rzaioc6uszy",
"bciqifvrtbr5a6nomogpnbn7jxwscqpepdgh67lrsjpkh6t2odnjrnma",
"bciqfjvqemdy7d6axvwkywcm6v66wogddvk7k6e6rps4e6zidkjvm4fy",
"bciqlubbahrp4pxohyffmn5yj52atjgmn5nxepmkdev6wtmvpbx7kr7y",
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a"
Expand Down Expand Up @@ -3049,8 +3084,8 @@
},
"packageName": "@bytecodealliance/jco"
},
"bciqm2rvnfe77sj6jekrm65oayuywt5lbrw33qezqjcg5rzaioc6uszy": {
"version": "3.5.1",
"bciqifvrtbr5a6nomogpnbn7jxwscqpepdgh67lrsjpkh6t2odnjrnma": {
"version": "3.7.1",
"port": {
"ty": "denoWorker@v1",
"name": "cargobi_cratesio",
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/substantial/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ serde.workspace = true
serde_json.workspace = true
uuid.workspace = true

protobuf = "3.6.0"
protobuf = "3.7.1"
# pinned due to url
redis = "=0.25.4"
6 changes: 3 additions & 3 deletions src/substantial/src/protocol/events.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.5.1. Do not edit
// .proto file is parsed by protoc --rust_out=...
// This file is generated by rust-protobuf 3.7.1. Do not edit
// .proto file is parsed by protoc --rs_out=...
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -22,7 +22,7 @@
/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_6_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1;

// @@protoc_insertion_point(message:substantial.protos.events.Start)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
6 changes: 3 additions & 3 deletions src/substantial/src/protocol/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is generated by rust-protobuf 3.5.1. Do not edit
// .proto file is parsed by protoc --rust_out=...
// This file is generated by rust-protobuf 3.7.1. Do not edit
// .proto file is parsed by protoc --rs_out=...
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -22,7 +22,7 @@
/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_6_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_7_1;

// @@protoc_insertion_point(message:substantial.protos.metadata.Info)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
5 changes: 3 additions & 2 deletions tools/tasks/gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ export default {
workingDir: "src/substantial",
inherit: "_rust",
installs: [
ports.cargobi({ crateName: "protobuf-codegen", version: "3.5.1" }),
ports.cargobi({ crateName: "protobuf-codegen", version: "3.7.1" }),
],
fn: ($) => {
// https://github.com/protocolbuffers/protobuf/issues/13346
const protoFiles = [
"protocol/events.proto",
"protocol/metadata.proto",
];
return $`protoc --proto_path=. ${protoFiles} --rust_out=src/protocol --rust_opt=experimental-codegen=enabled,kernel=cpp`;

return $`protoc --proto_path=. ${protoFiles} --rs_out=src/protocol`;
},
},
} satisfies Record<string, DenoTaskDefArgs>;

0 comments on commit c60f4ee

Please sign in to comment.