Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite the build infrastructure (#394)
Our previous build layout was fairly custom and hard to maintain. Migrate to a more standards-conform layout that is compatible with good Cargo and Bazel practices and feels natural to develop in. This commit swaps the previous "one-crate-per-file" layout to a layout where we have a few medium sized crates that are just fine-grained enough to allow almost the same amount of parallelization as the previous layout. The new layout enables dependency auto-updaters, standard cargo tooling and doc autogeneration. This should improve DX quite a bit and gives us some much needed compatibility with nix/cargo interop and should make most standard cargo extensions compatible with the repository. Some notable changes to the file layout: - The previous `error` crate is no longer part of `utils`. It is now a standalone module. This was necessary to keep macro exports compatible with the Cargo build. - The old `scheduler.rs` file is now split into `action_scheduler.rs` and `worker_scheduler.rs` since we don't want imports like `native_link_scheduler::scheduler`. - Some tests now use a slightly different import mechanism for test-only dependencies. - The store traits are now in `native_link_utils`, as it was used virtually everywhere. Moving this up in the dependency graph allows for higher parallelization of the other crates. Added documentation targets for every crate (except the `cas` binary itself, as this will require a dedicated commit). These doc targets can be viewed by pointing a browser to `bazel-bin/thetarget.rustdoc/thetarget/index.html`. Added rustfmt configuration to standardize imports. We now use `crate::` syntax which plays well with rusfmts's import formatting. The new layout makes it easier to spot crate/directory interdependencies so that we can remove them in future commits.
- Loading branch information