Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proto: std feature is broken #1454

Closed
tony-iqlusion opened this issue Aug 7, 2024 · 1 comment · Fixed by #1455
Closed

proto: std feature is broken #1454

tony-iqlusion opened this issue Aug 7, 2024 · 1 comment · Fixed by #1455
Labels
bug Something isn't working

Comments

@tony-iqlusion
Copy link
Collaborator

What went wrong?

The std feature added in #1452 doesn't work. /cc @romac

Steps to reproduce

$ cd proto
$ cargo test --features std

This results in the following compile errors:

$ cargo test --features std                                                                                       130 ↵
   Compiling tendermint-proto v0.39.0 (/Users/tarcieri/src/tendermint-rs/proto)
error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> proto/src/google/protobuf/timestamp.rs:105:11
    |
105 | impl From<std::time::SystemTime> for Timestamp {
    |           ^^^ use of undeclared crate or module `std`

error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> proto/src/google/protobuf/timestamp.rs:106:26
    |
106 |     fn from(system_time: std::time::SystemTime) -> Timestamp {
    |                          ^^^ use of undeclared crate or module `std`

error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> proto/src/google/protobuf/timestamp.rs:107:65
    |
107 |         let (seconds, nanos) = match system_time.duration_since(std::time::UNIX_EPOCH) {
    |                                                                 ^^^ use of undeclared crate or module `std`

error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> proto/src/google/protobuf/timestamp.rs:155:29
    |
155 | impl TryFrom<Timestamp> for std::time::SystemTime {
    |                             ^^^ use of undeclared crate or module `std`

(truncated)

These errors don't occur when cargo test --all-features is used, hence why it wasn't caught by CI, ostensibly because when it's compiled with that some other crate is linking std.

It would be good in CI to explicitly test the std feature in isolation.

Definition of "done"

cargo test --features std compiles in isolation.

@romac
Copy link
Member

romac commented Aug 8, 2024

Thanks to cargo-hack I realized there are other features which cannot be used in isolation, I've pushed fixes for all them in #1455.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants