maidsafe / safe_network

Autonomi combines the spare capacity of everyday devices to form a new, autonomous, data and communications layer of the Internet
http://autonomi.com
84 stars 51 forks source link

Build types are inconsistent during local testnet build #1456

Open loziniak opened 8 months ago

loziniak commented 8 months ago

When I'm running a local testnet using the command from README file:

cargo run --bin safenode-manager --features local-discovery -- run --build

The safenode-manager binary is built in debug mode, and then faucet is built in release mode. This takes twice as much time, and twice the storage space, because most libraries are shared among subprojects. I have both release and debug folders in safe_network/target.

jacderida commented 8 months ago

Thanks for the feedback.

However, I can't really tell whether you'd like it to build the binaries in release or debug mode, because you are referencing a problem with both space and time. You can't have both. Either we build in debug mode and we use more space, or we build in release mode and it takes longer. Which do you prefer for the local network?

loziniak commented 8 months ago

Perhaps I didn't make myself clear. By default, node_manager is built in dev mode, and the binaries it builds itself, like safenode or faucet, are built with release mode. It makes all dependencies be built two times - once for release and once for dev. I see two solutions:

  1. Add --release option to cargo commands in README
  2. Make node_manager build other binaries in dev mode.

I prefer solution no.1, because release saves much more space, and takes only a little longer.

jacderida commented 8 months ago

OK, thanks. I'll look into this.