hashgraph / hedera-sdk-rust

The Hedera™ Rust SDK
Apache License 2.0
42 stars 14 forks source link

fix incremental build of protobufs #864

Closed iamjpotts closed 1 week ago

iamjpotts commented 1 week ago

Description:

The ./protobufs/build.rs script has a defect that forces this crate, the hedera crate, and all downstream dependent crates to rebuild when they otherwise could perform an incremental build or not need a build at all.

While this only causes about one second of wasted time for the hedera crate by itself, this problem has a high negative impact on larger crates that transitively depend on the hedera-proto crate through the hedera crate.

Fixing this drops compile times for changes to a dependent app by over 50% and for changes to tests 60-80%.

Related issue(s):

n/a

Notes for reviewer:

How to test:

  1. cargo clean
  2. cargo build - observe successful compile
  3. cargo build - observe that the outcome is again successful, but takes less than 100 milliseconds
  4. Modify a file in ./protobufs/services
  5. cargo build - observe compile takes more than 100ms and reflects the change

Negative outcomes:

Step 3 takes more than 1/4 of a second OR Compile is not successful

Checklist