0

I've inherited the building of a backend that integrates with the Sui blockchain.

The only Sui-related crate declaration I found is this:

sui-sdk = { git = "https://github.com/MystenLabs/sui", rev = "09b2081" }

I can see it corresponds to the revision 09b2081 that is being mentioned in all the Sui crates being compiled (https://github.com/MystenLabs/sui?rev=09b2081), so that must be the only entry-point to all the sui-related crates.

Now, my problem is that at every cargo build all the Sui crates are being re-compiled. And I don't understand why, since this happens even when there are no code changes.

I've added rust-toolchain file, to make sure I enforce the same toolchain for the builder.

It is a bit frustrating, since every time I want to compile and run the app, I have to wait for more than a minute. Any ideas how to mitigate or overcome this?

➜  backend git:(use-env-file-for-env-vars) ✗ cargo run
   Compiling rustix v0.36.13
   Compiling workspace-hack v0.1.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling shared-crypto v0.0.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling mysten-network v0.2.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling sui-cost-tables v0.1.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling mysten-common v0.1.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   ... a bunch of other sui crates ...
   Compiling sui-config v0.0.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling sui-network v0.0.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling sui-core v1.0.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling sui-json-rpc v0.0.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   Compiling sui-sdk v1.0.0 (https://github.com/MystenLabs/sui?rev=09b2081#09b20814)
   ...
   Finished dev [unoptimized + debuginfo] target(s) in 1m 20s
Milkncookiez
  • 6,817
  • 10
  • 57
  • 96

0 Answers0