LogoLogo
  • About Thunderbird
  • Contributing to Thunderbird
    • Getting Started Contributing
    • Setting Up A Build Environment
    • Building Thunderbird
      • Windows Build Prerequisites
      • Linux Build Prerequisites
      • macOS Build Prerequisites
      • Artifact Builds
    • Codebase Overview
      • Account Configuration
      • Address Book
      • Chat Core
        • Notifications
        • Message Styles
        • Keyboard shortcuts
        • Chat Core Protocols
        • Contacts
      • Mail Front-End
    • Tutorials and Examples
      • Hello World Example
      • Thunderbird Live Development Videos
    • Fixing a Bug
      • Bug Triaging 101
        • Bug Status Classicification
        • Bug Types
        • Garbage Collection
        • Narrow the Scope
      • Using Mercurial Bookmarks
      • Using Mercurial Queues
      • Lint and Format Code
      • Using ESLint to Format Javascript Code
      • Try Server
      • Landing a Patch
      • Care and Feeding of the Tree
    • Testing
      • Running Tests
      • Adding Tests
      • Writing Mochitest Tests
  • Planning
    • Roadmap
    • Android Roadmap
    • Supported Standards
  • Add-on Development
    • Introduction
    • What's new?
      • Manifest Version 3
    • A "Hello World" Extension Tutorial
      • Using WebExtension APIs
      • Using a Background Page
      • Using Content Scripts
    • A Guide to Extensions
      • Supported Manifest Keys
      • Supported UI Elements
      • Supported WebExtension APIs
      • Thunderbird's WebExtension API Documentation
      • Thunderbird WebExtension Examples
      • Introducing Experiments
    • A Guide to Themes
    • Developer Community
    • Documentation & Resources
      • Tips and Tricks
    • Add-on Update Guides
      • Update for Thunderbird 128
      • Update for Thunderbird 115
        • Adapt to Changes in Thunderbird 103-115
      • Update for Thunderbird 102
        • Adapt to Changes in Thunderbird 92-102
      • Update for Thunderbird 91
        • Adapt to Changes in Thunderbird 79-91
      • Update for Thunderbird 78
        • Adapt to Changes in Thunderbird 69-78
      • Update for Thunderbird 68
        • Adapt to Changes in Thunderbird 61-68
      • How to convert legacy extensions?
        • Convert wrapped WebExtensions to modern WebExtensions
        • Convert legacy WebExtensions to modern WebExtensions
        • Convert legacy overlay extension to legacy WebExtension
        • Convert legacy bootstrapped extension to legacy WebExtension
  • Releases
    • Thunderbird Channels
    • Release Cadence
    • Uplifting Fixes
    • Feature Flags
    • Tracking Fixes for Releases
    • Contributing to Release Notes
Powered by GitBook
On this page
  • Hardware Requirements
  • Build Prerequisites
  • Build Configuration
  • Building
  • Make Your Build Faster
  • Running Thunderbird
  • Update and Build Again
  • Rebuilding
  • Rebuilding Specific Parts

Was this helpful?

Edit on GitHub
Export as PDF
  1. Contributing to Thunderbird

Building Thunderbird

How to build and run Thunderbird.

PreviousSetting Up A Build EnvironmentNextWindows Build Prerequisites

Last updated 1 month ago

Was this helpful?

Hardware Requirements

  • At least 4 GB of RAM. 8 GB or more is recommended. While you can build Thunderbird on older hardware it can take quite a bit of time to compile on slower machines with less RAM.

  • 30 GB of free space. The Thunderbird build can use up to 30-40GB of disk space to complete depending on your operating system.

  • Good internet connection for the initial source download.

Build Prerequisites

Depending on your Operating System you will need to carry out a different process to prepare your machine. So first complete the instructions for your OS and then continue following these build instructions.

Build Configuration

To build Thunderbird, you need a file named mozconfig in the root directory of the mozilla-central checkout that contains the option comm/mail enabled. If you do not already have this file, then you can create it with this line by doing this in the source/ directory:

echo 'ac_add_options --enable-project=comm/mail' > mozconfig

If you omit this line, the build system will build Firefox instead.

Other build configuration options can be added to this file, although it's recommended that you only use options that you fully understand. Here are come recommended options to use and why:

  • To create a debug build instead of a release build: ac_add_options --enable-debug

  • To speed up subsequent builds by caching compilation results for both C++ and Rust: ac_add_options --with-ccache=sccache

  • To enable some additional checks we have enabled in the CI: ac_add_options --enable-clang-plugin

  • To enable debug symbols: ac_add_options --enable-debug-symbols

  • To enable autoclobber: mk_add_options AUTOCLOBBER=1

Each of these ac_add_options entries needs to be on its own line.

Building

./mach build

Building can take a significant amount of time, depending on your system, OS, and chosen build options. Linux builds on a fast box may take under 15 minutes, but Windows builds on a slow box may take several hours.

Make Your Build Faster

Running Thunderbird

To run your build, you can use:

./mach run

There are various command line parameters you can add, e.g. to specify a profile.

Various temporary files, libraries, and the Thunderbird executable will be found in your object directory (under comm-central/), which is prefixed with obj-. The exact name depends on your system and OS. For example, a Mac user may get an object directory name of obj-x86_64-apple-darwin10.7.3/.

The Thunderbird executable in particular, and its dependencies are located under the dist/bin folder under the object directory. To run the executable from your comm-central working directory:

  • Windows: obj-.../dist/bin/thunderbird.exe

  • Linux: obj-.../dist/bin/thunderbird

  • macOS: obj-.../dist/Daily.app/Contents/MacOS/thunderbird

Update and Build Again

To pull down the latest changes, in the mozilla directory run the following commands:

hg pull -u
cd comm
hg pull -u
cd ..

or to do it via one command:

hg pull -u; (cd comm; hg pull -u)

Rebuilding

To build after changes you can simply run:

./mach build

Rebuilding Specific Parts

If you have made many changes, but only want to rebuild specific parts, you may run the following commands.

C or C++ Files:

./mach build binaries

JavaScript or XUL Files (Windows Only):

./mach build path/to/dir

Replace path/to/dir with the directory with the files changed.

This is the tricky bit since you need to specify the directory that installs the files, which may be a parent directory of the changed file's directory. For example, to just rebuild the Lightning calendar extension:

./mach build comm/calendar/lightning

For more info on configuration options, see the page . Note that if you use a MOZ_OBJDIR it cannot be a sibling folder to your source directory. Use an absolute path to be sure!

Before you start, make sure that the version you checked out is not busted. For hg tip, you should see green Bs on

After you have met the for your OS, the build is started in the source directory with:

mach is our command-line tool to streamline common developer tasks. See the article for more.

Follow this guide to rely on and other .

Then just run the ./mach build command detailed in the instructions above. This will only recompile files that changed, but it may still take a long time.

Windows Build Prerequisites
Linux Build Prerequisites
macOS Build Prerequisites
Configuring build options
https://treeherder.mozilla.org/#/jobs?repo=comm-central
mach
sccache
Tips for making builds faster
build prerequisites
Building