A proposal to reduce build prerequsits


Right now building rust from source code requires a few third party tools to be installed:

  • Python to run the initial steps of the build script
  • CMake for some third party submodules like LLVM
  • Others that I didn’t know yet

But I think if we otherwise only require rustup to be installed it will make it much easier for new compiler developers.

  • the functionality of Python can be done by use the rustup installed pre-compiled rust compiler to compile a small piece of code in Rust
  • CMake is still needed, but it can be installed automatically by a piece of rust code as well
  • Any other tools can be done in this way as well.

After this, the build system of the source code will be much easier to use and easier to test, as in the test machine we have less assumptions.



the problem in requiring rustup for building rustc is that not all platform are supported by rustup: it requires a full crossbuild environment.

it could also make really big step for integrating a new platform (the initial bootstrapping).

it makes a network connection required for building rustc, so rustc packaging for distributions (fedora, debian, …) will be more complex.


  1. Integrating a new platform is never easy. depends on Python or anything else is just passing the hard work to someone else. If Rust have the exhibition to be in the position C currently have, it should be ready to bootstrap itself without anything else (well, this is not true in all sense. To build gcc toolchain you need build-essentials including Make, awk etc, but all those was written in C itself), because this is what C currently can do.

  2. It is not necessary to have network connection for building rustc. What we have to do is

  • limiting the referencing crates that the rustc source code can refer to
  • allowing rustup to be embedded in distributions with selected crates then we can build rustc without require anything else. This is similar to build-essentials in Debian. we could have rust-essentials!


Already doable with sudo apt-get build-dep rustc.



Making rustc easier to port/build is an important goal, but the dependencies highlighted here (Python and CMake) don’t seem like the best aspects to focus on.

The Python dependency neither makes it significantly harder for people to build rustc on supported platforms, nor does it pose a particular porting challenge:

  1. Python is ubiquitous. It is almost certainly already be present on any Unix-ish computer. It’s not not quite so ubiquitous on Windows (at least outside of mingw environments), but it’s still quite a standard tool, and there are high quality binary distributions for Windows.
  2. Python is required for LLVM’s test suite anyway. Rust doesn’t run the tests, but it does mean that porting Python is already practically required for porting LLVM to another platform, and porting LLVM is a prerequisite for porting rustc.

I’ve never heard of any C++ project vendoring CMake. Why is Rust different? Why is it okay to require the user to have a modern C++ compiler needed by LLVM, but requiring them to have CMake (a prerequisite for many C++ projects) is too much?

I also have questions about this proposed automatic installation: Which version do we install, and how do we make sure we’re not missing important distro-specific patches? If there’s no official binary distribution for the host platform, do we fetch the source and built it ourselves? How do we handle dependencies CMake itself may have? And finally, how do we justify the implementation and maintenance effort? (Besides the initial implementation, there’s bound to be a long tail of bugs where this convenience functionality doesn’t work as expected on odd systems.)

There the run-make test suite. There’s plans to remove the Make dependency there, which would make it easier to run the full test suite on Windows. (Make is far harder to get than Python, short of installing a full mingw environment, and last time I did that building Rust in it had other draw backs.)

1 Like

closed #6

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.