Skip to main content
This guide covers all the dependencies you need to install before building the Dart SDK from source.

Python

Dart SDK requires Python 3 to build.
On Windows, ensure that python.bat wrapper from depot_tools comes ahead of any other Python binaries in your PATH. Some steps still require Python 2 on Windows, but Python 3 must also be available.

Platform-Specific Dependencies

Install Build Tools

Install the essential build tools:
sudo apt-get install git python3 curl xz-utils

Install Depot Tools

Chromium’s depot_tools are required for managing the Dart source tree:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH:$PWD/depot_tools"
Add the export command to your shell’s rc file (.bashrc, .zshrc, etc.) to make it permanent.

Cross-Compilation Dependencies

Linux Cross-Compilers

For cross-compiling to different architectures on Debian/Ubuntu:
# To target x64
sudo apt-get install g++-x86-64-linux-gnu

# To target arm
sudo apt-get install g++-arm-linux-gnueabihf

# To target arm64
sudo apt-get install g++-aarch64-linux-gnu

# To target riscv64
sudo apt-get install g++-riscv64-linux-gnu
The build scripts download a Clang toolchain that can target X64, ARM, ARM64, or RISCV64 from an X64 or ARM64 host. You only need to install cross-compilers manually for other cases, like building on a RISC-V host or targeting RISCV32.

Android Dependencies

To build for Android, update your .gclient file:
"custom_vars": {
  "download_android_deps": True,
},
Then run:
gclient sync
This downloads the Android NDK and SDK (may take 10+ minutes).

Fuchsia Dependencies

To build for Fuchsia, update your .gclient file:
"custom_vars": {
  "download_fuchsia_deps": True,
},
Then run:
gclient sync

Optional Dependencies

Emscripten

If you don’t have Emscripten but need it, update your .gclient file:
"custom_vars": {
  "download_emscripten": True,
},
Then run gclient sync.

Verifying Your Setup

After installing dependencies, verify your setup:
# Check Python version
python3 --version

# Check depot_tools is in PATH
which gclient  # Linux/macOS
where gclient  # Windows

# Check git is available
git --version

Managing Third-Party Dependencies

The Dart SDK uses gclient to manage dependencies described in the DEPS file.
When you switch branches or update your SDK checkout, run gclient sync to bring dependencies in sync with the SDK version.

Adding New Dependencies

New dependencies require explicit approval from Dart leadership before being added to the DEPS file, unless they are Dart core packages.
When adding dependencies:
  1. File an issue in the Dart SDK repo for approval
  2. Ensure the license is compatible with Dart’s license
  3. Add a README.google file describing the dependency
  4. Include a LICENSE file with the actual license
  5. CC [email protected] on the change

Updating Dependencies

To roll a specific dependency:
dart tools/manage_deps.dart bump third_party/pkg/package_config
To roll all package dependencies:
dart tools/rev_sdk_deps.dart

Next Steps

Build from Source

Now that you have the dependencies installed, proceed to build the SDK from source.

Build docs developers (and LLMs) love