akka / akka-edge-rs

Akka Edge support in Rust
https://doc.akka.io/docs/akka-edge/current/
Other
9 stars 1 forks source link

Building project locally failing with protoc problems #32

Closed johanandren closed 1 year ago

johanandren commented 1 year ago

Pretty sure I used to be able to build, but current main as of 29 sep fails with:

Caused by:
  process didn't exit successfully: `/Users/johan/Code/Lightbend/Akka/akka-edge-rs/target/debug/build/akka-projection-rs-grpc-0b55aa6ca26e950f/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-changed=akka/projection/grpc/event_consumer.proto
  cargo:rerun-if-changed=proto

  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: google/protobuf/any.proto: File not found.\ngoogle/protobuf/timestamp.proto: File not found.\ngoogle/protobuf/empty.proto: File not found.\nakka/projection/grpc/event_producer.proto:7:1: Import \"google/protobuf/any.proto\" was not found or had errors.\nakka/projection/grpc/event_producer.proto:8:1: Import \"google/protobuf/timestamp.proto\" was not found or had errors.\nakka/projection/grpc/event_producer.proto:9:1: Import \"google/protobuf/empty.proto\" was not found or had errors.\nakka/projection/grpc/event_producer.proto:193:3: \"google.protobuf.Timestamp\" is not defined.\nakka/projection/grpc/event_producer.proto:222:3: \"google.protobuf.Any\" is not defined.\nakka/projection/grpc/event_producer.proto:227:3: \"google.protobuf.Any\" is not defined.\nakka/projection/grpc/event_producer.proto:251:3: \"google.protobuf.Timestamp\" is not defined.\nakka/projection/grpc/event_consumer.proto:7:1: Import \"google/protobuf/any.proto\" was not found or had errors.\nakka/projection/grpc/event_consumer.proto:8:1: Import \"google/protobuf/timestamp.proto\" was not found or had errors.\nakka/projection/grpc/event_consumer.proto:9:1: Import \"google/protobuf/empty.proto\" was not found or had errors.\nakka/projection/grpc/event_consumer.proto:10:1: Import \"akka/projection/grpc/event_producer.proto\" was not found or had errors.\nakka/projection/grpc/event_consumer.proto:42:5: \"Event\" is not defined.\nakka/projection/grpc/event_consumer.proto:43:5: \"FilteredEvent\" is not defined.\nakka/projection/grpc/event_consumer.proto:59:12: \"FilterCriteria\" is not defined.\n" }
warning: build failed, waiting for other jobs to finish...
huntc commented 1 year ago

That’s odd. Can you please try “cargo clean” and try again?

huntc commented 1 year ago

Also of interest, the CI is building ok…

huntc commented 1 year ago

I'm increasingly convinced that by running cargo clean this problem should disappear. It could be the result of some build cache that now fails given that we're relocated the backend into a backend folder.

I ran cargo clean from the root and then followed the README again, and all appears well.

johanandren commented 1 year ago

Yeah, I suspect it is something with the environment on my machine, but I don't quite understand what it could be. Protoc version perhaps. I get this error after a cargo clean; cargo build on the root project from current main and in the ui PR branch root and/or in the backend example project.

huntc commented 1 year ago

What version of protoc for you? Mine is libprotoc 23.4

johanandren commented 1 year ago

Ah, that's probably it protoc --version shows libprotoc 3.11.4, I have 23.4 installed but put the old one on PATH at some point since we need it for building Akka.

Switching to 23.4 and doing a clean and then a build I get a new problem though:

error[E0599]: no method named `timestamp_nanos_opt` found for struct `DateTime` in the current scope
   --> akka-projection-rs-grpc/src/producer.rs:199:58
    |
199 |                         nanos: envelope.offset.timestamp.timestamp_nanos_opt().unwrap_or_default() as i32
    |
huntc commented 1 year ago

I think you need a cargo update there. That shouldn't be required generally, but sometimes dependencies can go out of date.

huntc commented 1 year ago

Actually, that's a problem in our build file... Lemme get your a PR