The same reason Bazel builds avoid using Cargo when building Rust software, so I'll describe why Bazel would do this:
- Bazel wants to cache remote resources, like each respective crate's source files.
- Bazel then wants to build each crate in a sandbox, and cache the build artifacts. Because bazel owns this process, instead of Cargo, it can trivially distribute those build artifacts to other developers, or in CI, etc -- instead of everyone having to build everything from scratch.
This is an established practice, and Nix wants to drive the build for the same reasons.
- Bazel wants to cache remote resources, like each respective crate's source files.
- Bazel then wants to build each crate in a sandbox, and cache the build artifacts. Because bazel owns this process, instead of Cargo, it can trivially distribute those build artifacts to other developers, or in CI, etc -- instead of everyone having to build everything from scratch.
This is an established practice, and Nix wants to drive the build for the same reasons.
See:
- https://github.com/bazelbuild/rules_rust
- https://github.com/google/cargo-raze