Description
Update description
To be amenable to packaging in distros, the remaining tasks for rustbuild left to be implemented are:
- Leverage Cargo workspaces
- Vendor Cargo dependencies in source tarballs, and configure the tarballs to use these dependencies
Original description
When moving to rustbuild we're going to be using Cargo as part of the build system which has historically been difficult to work with the requirements that Linux distributions have. Let's be sure that the transition process from the makefiles to rustbuild is a smooth one though and get ahead of any concerns here!
My current plan is to do the following:
- Assume that distros arrange for us to have the correct stage0 rustc binary somewhere, configured via
--enable-local-rust
orbuild.rustc
inconfig.toml
. - Assume that distros arrange for us to have the correct stage0 cargo binary somewhere, configured similar to rustc above.
- Use the workspaces feature in Cargo to ensure that there's only one
Cargo.lock
for the entire rust repo, so there's one list of what we depend on as part of the build with Cargo. - Use a vendoring solution similar to what was proposed before where our source tarballs will contain all our crates.io dependencies (e.g. gcc-rs, cmake-rs, and eventually other crates from crates.io used to build rustc).
Given all that, we will be able to build deterministically without network access, but perhaps this is not enough! I'm curious what others think about the assumptions here about rustc/cargo, or if there are other gotchas we should take care of as well.
cc @cuviper, @anguslees, @lucab, @jauhien, @fabiand