Skip to content

Commit 31517d4

Browse files
authoredSep 24, 2024··
Pin the dependencies of the Rust code gen tools (#502)
In the previous commit, only the version of `protoc-gen-prost/tonic` was pinned. However, Cargo would still ignore the lock file and use the latest version of dependencies for `protoc-gen-prost/tonic`. This meant that any new release of dependencies (such as `prost-build`) could result in differences in the generated code. This commit addresses the issue by adding `--locked` to the `cargo install` command, ensuring Cargo respects the lock file when installing code generation tools. The Rust code has been regenerated using this updated configuration. Signed-off-by: Campbell He <[email protected]>
1 parent f304ae3 commit 31517d4

File tree

5 files changed

+206
-56
lines changed

5 files changed

+206
-56
lines changed
 

‎codegen/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3
2828

2929
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.81.0 --profile minimal; \
3030
. $HOME/.cargo/env; \
31-
cargo install protoc-gen-prost@0.4.0 protoc-gen-prost-crate@0.4.1 protoc-gen-tonic@0.4.1
31+
cargo install --locked protoc-gen-prost@0.4.0 protoc-gen-prost-crate@0.4.1 protoc-gen-tonic@0.4.1
3232

3333
ENV PATH="${PATH}:/root/.cargo/bin"
3434

‎rust/src/google.rpc.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
///
88
/// You can find out more about this error model and how to work with it in the
99
/// [API Design Guide](<https://cloud.google.com/apis/design/errors>).
10+
#[allow(clippy::derive_partial_eq_without_eq)]
1011
#[derive(Clone, PartialEq, ::prost::Message)]
1112
pub struct Status {
1213
/// The status code, which should be an enum value of

0 commit comments

Comments
 (0)
Please sign in to comment.