Skip to content

Commit

Permalink
Pin the version of the rust code generation tool
Browse files Browse the repository at this point in the history
In the previous commit, the version of rust, protoc-gen-prost and so on
are not pinned. That is, the latest version is used.
This will cause unexpected CI failure for commits unrelated to rust gen.

This commit pins the version in the Dockerfile:

rust: 1.81.0
protoc-gen-prost: 0.4.0
protoc-gen-prost-crate: 0.4.1
protoc-gen-tonic: 0.4.1

The dependencies are also updated:

prost: 0.13.1 -> 0.13.2
tonic: 0.12.0 -> 0.12.1

The rust code is regenerated and the version is bumped to 1.4.0

Signed-off-by: Campbell He <[email protected]>
  • Loading branch information
duskmoon314 committed Sep 14, 2024
1 parent f50fef9 commit 1d91bc1
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 259 deletions.
4 changes: 2 additions & 2 deletions codegen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ ENV PATH="${PATH}:/usr/local/go/bin:/root/go/bin"
RUN go install google.golang.org/protobuf/cmd/[email protected]
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 stable --profile minimal; \
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 protoc-gen-prost protoc-gen-prost-crate protoc-gen-prost-serde protoc-gen-tonic
cargo install protoc-gen-prost@0.4.0 protoc-gen-prost-crate@0.4.1 protoc-gen-tonic@0.4.1

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

Expand Down
14 changes: 7 additions & 7 deletions rust/Cargo.lock

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

6 changes: 3 additions & 3 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "p4runtime"
version = "1.4.0-rc.5"
version = "1.4.0"
edition = "2021"
authors = ["P4 API Working Group <[email protected]>"]
description = "P4Runtime Specification"
Expand All @@ -12,8 +12,8 @@ repository = "https://github.com/p4lang/p4runtime"
[dependencies]
pbjson = "0.7.0"
pbjson-types = "0.7.0"
prost = "0.13.1"
tonic = "0.12.0"
prost = "0.13.2"
tonic = "0.12.2"

[features]
default = ["proto_full"]
Expand Down
1 change: 0 additions & 1 deletion rust/src/google.rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
///
/// 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 1d91bc1

Please sign in to comment.