Skip to content

Commit

Permalink
Pin the dependencies of the Rust code gen tools (#502)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
duskmoon314 authored Sep 24, 2024
1 parent f304ae3 commit 31517d4
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 56 deletions.
2 changes: 1 addition & 1 deletion codegen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN go install google.golang.org/grpc/cmd/[email protected]

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.81.0 --profile minimal; \
. $HOME/.cargo/env; \
cargo install [email protected] [email protected] [email protected]
cargo install --locked [email protected] [email protected] [email protected]

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

Expand Down
1 change: 1 addition & 0 deletions rust/src/google.rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
///
/// You can find out more about this error model and how to work with it in the
/// [API Design Guide](<https://cloud.google.com/apis/design/errors>).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Status {
/// The status code, which should be an enum value of
Expand Down
Loading

0 comments on commit 31517d4

Please sign in to comment.