fdeantoni / prost-wkt

Prost Well-Known-Types serialization and deserialization.
Apache License 2.0
76 stars 35 forks source link

build failure: no method named `normalize` found for struct `pbtime::Timestamp` in the current scope #20

Closed tarcieri closed 2 years ago

tarcieri commented 2 years ago

I'm getting the following error trying to include prost-wkt-types as a dependency:

error[E0599]: no method named `normalize` found for struct `pbtime::Timestamp` in the current scope
   --> .cargo/registry/src/github.com-1ecc6299db9ec823/prost-wkt-types-0.3.2/src/pbtime.rs:51:12
    |
51  |         ts.normalize();
    |            ^^^^^^^^^ method not found in `pbtime::Timestamp`
    |
   ::: target/debug/build/prost-wkt-types-7f1604c475b47791/out/pbtime/google.protobuf.rs:172:1
    |
172 | pub struct Timestamp {
    | -------------------- method `normalize` not found for this
fdeantoni commented 2 years ago

Can you include your Cargo.toml and build.rs so I can try to replicate the problem?

tarcieri commented 2 years ago

I pushed up a branch where I'm experiencing this problem:

https://github.com/informalsystems/tendermint-rs/tree/tarcieri/prost-wkt-types

It can be reproduced with:

$ cd proto
$ cargo build
fdeantoni commented 2 years ago

In the Cargo.toml I see that default-features is set to false. This means std is not used, which means the normalize function is not available. Unfortunately this implementation comes straight from Prost, so its not in Prost-wkt-types. Luckily, though, the master branch of Prost seems to have already addressed this (see commit 1674ef9). I'll see if I can update Prost to the latest version of Prost for the next release of prost-wkt.