Core Dependencies
These dependencies are required for all platforms:Python (3 or 2.7)
Python (3 or 2.7)
The build system requires Python to run
x.py.Verify Python Installation
The version of Python used to execute
x.py will be used throughout the build process.Git
Git
Required for cloning the repository and managing submodules.The build system can automatically manage git submodules by setting
Clone Rust Repository
build.submodules = true in bootstrap.toml (this is the default).C Compiler
C Compiler
A C compiler is needed for building native dependencies and LLVM.
- Unix/Linux:
ccorgcc - macOS: Xcode Command Line Tools
- Windows: MSVC or MinGW GCC
curl (Unix only)
curl (Unix only)
Used for downloading dependencies. Not required on Windows.
Install on Debian/Ubuntu
Install on macOS
Linux-Specific Dependencies
When compiling on Linux and targeting Linux:Package Details
| Package | Purpose |
|---|---|
pkg-config | Required when compiling on and targeting Linux |
libiconv | Already included with glibc on most distributions |
libssl-dev / openssl-devel | Required for building Cargo |
LLVM Build Dependencies
If building LLVM from source, you’ll need:- Compiler
- Build System
- CMake
- Static Libraries
A modern C++ compiler:
g++(GCC)clang++(Clang/LLVM)- MSVC with version listed on LLVM’s documentation
Check LLVM’s documentation for specific version requirements, as they change with each LLVM release.
Downloading LLVM (Recommended)
For tier 1 and tier 2 platforms with host tools, you can download pre-built LLVM instead of building from source:bootstrap.toml
- Much faster builds - Skip hours of LLVM compilation
- Less disk space - No need for LLVM source tree
- Fewer dependencies - Don’t need C++ compiler for LLVM
Using System LLVM
Alternatively, you can use LLVM installed on your system:bootstrap.toml
See the rustc-dev-guide for more information about using pre-built LLVM.
Optional Dependencies
ccache - Build Caching
ccache - Build Caching
Speed up rebuilds by caching compiler outputs:Enable in
Install ccache
bootstrap.toml:GDB/LLDB - Debuginfo Tests
GDB/LLDB - Debuginfo Tests
Required only for running the debuginfo test suite:
bootstrap.toml
Node.js - Emscripten Tests
Node.js - Emscripten Tests
Only needed when running tests for the emscripten target:
bootstrap.toml
Yarn - Rustdoc GUI Tests
Yarn - Rustdoc GUI Tests
Required for rustdoc-gui tests and tidy js extra-checks:
bootstrap.toml
Verifying Dependencies
Before starting the build, verify all dependencies are available:Dependency Check
Platform-Specific Guides
Unix/Linux
Complete setup for Unix-like systems
Windows
Complete setup for Windows (MSVC and MinGW)