Skip to content

rustbuild: Ensure that it's ready for distros #34687

Closed
@alexcrichton

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 or build.rustc in config.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

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions