Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move the build prequisites in a designated space #135

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
## Contributing to Thunderbird <a href="#thunderbird-development" id="thunderbird-development"></a>

* [Getting Started](thunderbird-development/getting-started.md)
* [Prerequisites for the build](thunderbird-development/prerequisites-build/README.md)
* [Windows Build Prerequisites](thunderbird-development/prerequisites-build/windows-build-prerequisites.md)
* [Linux Build Prerequisites](thunderbird-development/prerequisites-build/linux-build-prerequisites.md)
* [macOS Build Prerequisites](thunderbird-development/prerequisites-build/macos-build-prerequisites.md)
* [Building Thunderbird](thunderbird-development/building-thunderbird/README.md)
* [Windows Build Prerequisites](thunderbird-development/building-thunderbird/windows-build-prerequisites.md)
* [Linux Build Prerequisites](thunderbird-development/building-thunderbird/linux-build-prerequisites.md)
* [macOS Build Prerequisites](thunderbird-development/building-thunderbird/macos-build-prerequisites.md)
* [Artifact Builds](thunderbird-development/building-thunderbird/artifact-builds.md)
* [Codebase Overview](thunderbird-development/codebase-overview/README.md)
* [Address Book](thunderbird-development/codebase-overview/address-book.md)
Expand Down
39 changes: 9 additions & 30 deletions thunderbird-development/building-thunderbird/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,35 @@ description: How to build and run Thunderbird.

# Building Thunderbird

## Hardware Requirements
## Prerequisites

* 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.
* Good internet connection for the initial source download.
Ensure that your [Prerequisites for the build](thunderbird-development/prerequisites-build/README.md) are met.

## Build Prerequisites
You should have done the following:

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

* [Windows Build Prerequisites](windows-build-prerequisites.md)
* [Linux Build Prerequisites](linux-build-prerequisites.md)
* [macOS Build Prerequisites](macos-build-prerequisites.md)

## Build Configuration

To build Thunderbird, you need to create a file named `mozconfig` to the root directory of the mozilla-central checkout that contains the option `comm/mail` enabled. You can create a file with this line by doing this in the `source/` directory:

```
echo 'ac_add_options --enable-application=comm/mail' > mozconfig
```

**If you omit this lines, the build system will build Firefox instead**. Other build configuration options can be added to this file, although it's **strongly recommended** that you only use options that you fully understand. For example, to create a debug build instead of a release build, that file would also contain the line:

```
echo 'ac_add_options --enable-debug' >> mozconfig
```

_Each of these ac\_add\_options entries needs to be on its own line._

For more on configuration options, see the page [Configuring build options](https://developer.mozilla.org/en/Configuring\_Build\_Options). Note that if you use an MOZ\_OBJDIR it cannot be a sibling folder to your source directory. Use an absolute path to be sure!
* Installed tools for ./mach bootstrap depending on your OS
* Finished ./mach bootstrap in `Firefox for Desktop` mode
* The [Build Configuration](thunderbird-development/prerequisites-build/README.md) in a seperate `source/mozconfig` file so that Thunderbird is build and not Firefox

## Building

{% hint style="warning" %}
Before you start, make sure that the version you checked out is not busted. For `hg` tip, you should see green Bs on [https://treeherder.mozilla.org/#/jobs?repo=comm-central](https://treeherder.mozilla.org/#/jobs?repo=comm-central)
{% endhint %}

After you met the [build prerequisites](./#build-prerequisites) for your OS the build is started in the `source` directory with:
The build is started in the `source` directory with:

```
./mach build
```

mach is our command-line tool to streamline common developer tasks. See the [mach](https://developer.mozilla.org/en-US/docs/Mozilla/Developer\_guide/mach) article for more.
mach is our command-line tool to streamline common developer tasks. See the [mach](https://firefox-source-docs.mozilla.org/mach/index.html) article for more.

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

Follow this guide to rely on [sccache](https://firefox-source-docs.mozilla.org/setup/configuring\_build\_options.html?highlight=sccache#sccache) and other [Tips for making builds faster](https://firefox-source-docs.mozilla.org/build/buildsystem/slow.html#why-the-build-system-is-slow).
Follow this guide to rely on [sccache](https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html#sccache) and other [Tips for making builds faster](https://firefox-source-docs.mozilla.org/build/buildsystem/slow.html).

## Running Thunderbird

Expand Down
Original file line number Diff line number Diff line change
@@ -1,82 +1,5 @@
---
description: >-
This page has all the information you need to get your GNU/Linux development
environment set up and ready to hack on Thunderbird.
description: "This page has moved"
---

# Linux Build Prerequisites

This guide assumes you already followed the [Getting Started](../getting-started.md) documentation and you already downloaded `mozilla-central` and `comm-central` source code.

## 64-bit version

You need a 64 bit version of Linux in order to build Thunderbird. You can check which version you're running by typing this command in your terminal:

```text
uname -m
```

if this command returns `x86_64` you can proceed.

## Python

You’ll need `Python 3.6` installed.

You can check with `python --version` to see if you have it already. If not, you can install it with your distribution’s package manager. Make sure your system is up to date!

## 30 GB of free space

The Thunderbird build will take up to 30 GB of disk space in order to complete. Be sure to have enough free space and a fast internet connection to avoid interruptions.

## Bootstrap your system

Access the location where you downloaded the `mozilla-central` source code, most likely `source/` and trigger this command:

```text
./mach bootstrap
```

You will be asked to choose from the following list of options

```text
Please choose the version of Firefox you want to build:
1. Firefox for Desktop Artifact Mode
2. Firefox for Desktop
3. GeckoView/Firefox for Android Artifact Mode
4. GeckoView/Firefox for Android
```

Please choose option 2 to proceed with a successful build.

This action will install all the libraries and dependencies necessary to build Thunderbird locally.

### Missing libraries

It could happen that some libraries will not be installed by the `bootstrap` command, specifically those related to the `Rust` programming language. Check whether these packages are available in your system by running these commands in your terminal:

* `which rustc`
* `which cargo`

If one or both commands return an empty output, you need to install them manually:

* Install Rust and cargo \(the Rust package manager\): `curl https://sh.rustup.rs -sSf | sh`
* Install cbindgen \(tool that generates C bindings from Rust code\): `cargo install cbindgen`

{% hint style="info" %}
If you get a `command not found` error while running `cargo`, but the command `which cargo` returns the location of the that package, it means you need to update your `PATH` inside your `.bashrc` file to include the `cargo` location:

```text
export PATH=$HOME/.cargo/bin:$PATH
```
{% endhint %}

{% hint style="warning" %}
If you still are unable to find rustc and cargo via the ˋwhichˋ command after installing them, you may need to restart your session \(log out and back into your user account, or restart your computer\) to be able to see them.
{% endhint %}

## You're all set

Got back to the [Building Thunderbird](./#build-configuration) page and continue following the guide.

{% page-ref page="./" %}

[Linux Build Prerequisites](../prerequisites-build/linux-build-prerequisites.md)
Original file line number Diff line number Diff line change
@@ -1,76 +1,5 @@
---
description: >-
This page has all the information you need to get your macOS development
environment set up and ready to hack on Thunderbird.
description: "This page has moved"
---

# macOS Build Prerequisites

This guide assumes you already followed the [Getting Started](../getting-started.md) documentation and you already downloaded `mozilla-central` and `comm-central` source code.

## Install Xcode

`Xcode` is a prerequisite to build Firefox an you will need administrator permissions on your machine to install it. You can verify that you have these permission in `System Preferences -> Users & Groups`.\)

{% hint style="info" %}
`Xcode` is pretty large and it could take up to 1 hour to complete the download and installation process
{% endhint %}

## Install macOS SDK headers

After installing `Xcode` you will find the SDK header at this location

```text
cd /Library/Developer/CommandLineTools/SDKs/
```

Launch the `MacOSX{your-version}.sdk` \(eg. `MacOSX10.14.sdk`\) by double clicking on it and follow the installation instructions.

## Bootstrap your system

Access the location where you downloaded the `mozilla-central` source code, most likely `source/` and trigger this command:

```text
./mach bootstrap
```

You will be asked to choose from the following list of options

```text
Please choose the version of Firefox you want to build:
1. Firefox for Desktop Artifact Mode
2. Firefox for Desktop
3. GeckoView/Firefox for Android Artifact Mode
4. GeckoView/Firefox for Android
```

Please choose option 2 to proceed with a successful build.

This action will install all the libraries and dependencies necessary to build Thunderbird locally.

### Missing libraries

It could happen that some libraries will not be installed by the `bootstrap` command, specifically `Rust` and `Go`. Check if these packages are available in your system by running these commands in your terminal:

* `which rustc`
* `which cargo`

If one or both commands return an empty output, you need to install them manually. We recommend using [HomeBrew](https://brew.sh/) to download and install these packages in your system. After that, follow these steps:

* Install Rust: `brew install rust`
* Install C bindings: `cargo install cbindgen`

{% hint style="info" %}
If you get a `command not found` error while running `cargo`, but the command `which cargo` returns the location of the that package, it means you need to update your `PATH` inside your `.bashrc` file to include the `cargo` location:

```text
export PATH=$HOME/.cargo/bin:$PATH
```
{% endhint %}

## You're all set

Got back to the [Building Thunderbird](./#build-configuration) page and continue following the guide:

{% page-ref page="./" %}

[macOS Build Prerequisites](../prerequisites-build/macos-build-prerequisites.md)
Original file line number Diff line number Diff line change
@@ -1,85 +1,5 @@
---
description: >-
This page has all the information you need to get your Windows development
environment set up and ready to hack on Thunderbird.
description: "This page has moved"
---

# Windows Build Prerequisites

## The Basics

### 64-bit Windows

You will need to be running a 64-bit version of Windows in order to build Thunderbird. To check this in Windows 10, open the start menu and click on the gear icon on the left-hand side of the menu. This will open up the "settings" window. Click on the "System" option and then scroll down to "About". Click on the "About" option and on the new screen next to "System Type" you should see: "**64-bit operating system"**

![How System type appears in the About Settings page.](../../.gitbook/assets/windows-version-screen.png)

### **Visual Studio**

In order to get the necessary libraries in order to build Thunderbird, you will need to install Visual Studio - an IDE from Microsoft. [Download the free community edition here](https://visualstudio.microsoft.com/downloads/).

During installation make sure the following workloads are checked:

* "Desktop development with C++"
* "Game development with C++"

### MozillaBuild Package

Finally, download the [MozillaBuild Package](https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe) from Mozilla. Accept the default settings, in particular the default installation directory: `c:\mozilla-build\`. On some versions of Windows an error dialog will give you the option to ‘reinstall with the correct settings’ - you should agree and proceed.

{% hint style="info" %}
Once this is done, creating a shortcut to `c:\mozilla-build\start-shell.bat` on your desktop will make your life easier.
{% endhint %}

{% hint style="success" %}
**NOTE: You will need to run the start-shell.bat to open up the shell and perform the commands listed in other parts of this guide.**
{% endhint %}

### Getting the Code

Once you have run start-shell.bat, you will need to grab the source code if you haven't already.

Get the latest Mozilla source code from Mozilla's `mozilla-central` Mercurial code repository, and check it out into a local directory `source` \(or however you want to call it\). Then, get the latest Thunderbird source code from Mozilla's `comm-central` Mercurial code repository. It now needs to be placed **inside** the Mozilla source code, in a directory named `comm/` \(this is inverse from Thunderbird 59 and earlier\):

```bash
hg clone https://hg.mozilla.org/mozilla-central source/
cd source/
hg clone https://hg.mozilla.org/comm-central comm/
```

### Mach Bootstrap

In the `source` directory run the following command to get additional dependencies needed to install Thunderbird:

```bash
./mach bootstrap
```

You will be presented with the following options:

```text
Please choose the version of Firefox you want to build:
1. Firefox for Desktop Artifact Mode
2. Firefox for Desktop
3. GeckoView/Firefox for Android Artifact Mode
4. GeckoView/Firefox for Android
```

Please choose option 2 to proceed with a successful build.

This action will install all the remaining libraries and dependencies necessary to build Thunderbird locally.

{% hint style="danger" %}
**Make sure to restart after installing all the requirements, or Thunderbird might encounter a build error.**
{% endhint %}

### Building Thunderbird

Now that you have the prerequisites for Windows, make sure you have the source code via the commands on the Getting Started page:

{% page-ref page="../getting-started.md" %}

Then you can follow the instructions on the Building Thunderbird page:

{% page-ref page="./" %}

[Windows Build Prerequisites](../prerequisites-build/windows-build-prerequisites.md)
6 changes: 3 additions & 3 deletions thunderbird-development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Information for how to install Mercurial is available [via the download page on
## Get the Source

{% hint style="warning" %}
The source code requires 3.6GB of free space or more and additionally 5GB or more for default build.
The source code requires 3.6GB of free space or more and additionally 30GB or more for default build.
{% endhint %}

{% hint style="danger" %}
**For Windows Users:** If you are using Windows, you will want to follow instructions on the Windows Build Prerequisities page before getting the source and building Thunderbird.
{% endhint %}

{% content-ref url="building-thunderbird/windows-build-prerequisites.md" %}
[windows-build-prerequisites.md](building-thunderbird/windows-build-prerequisites.md)
{% content-ref url="prerequisites-build/windows-build-prerequisites.md" %}
[windows-build-prerequisites.md](prerequisites-build/windows-build-prerequisites.md)
{% endcontent-ref %}

Get the latest Mozilla source code from Mozilla's `mozilla-central` Mercurial code repository, and check it out into a local directory `source` (or however you want to call it). Then, get the latest Thunderbird source code from Mozilla's `comm-central` Mercurial code repository. It now needs to be placed **inside** the Mozilla source code, in a directory named `comm/`:
Expand Down
46 changes: 46 additions & 0 deletions thunderbird-development/prerequisites-build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
description: Prepare build of Thunderbird.
---

# Prerequisites for the build

## 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.
* Good internet connection for the initial source download.

## 30 GB of free space

The Thunderbird build will take up to 30 GB of disk space in order to complete. Be sure to have enough free space and a fast internet connection to avoid interruptions.

## Build Prerequisites

Depending on your Operating System you will need to carry out a different process to prepare your machine. So firstly complete the instructions for your OS and then continue following the setup with the [Build Configuration](./#build-configuration).

* [Windows Build Prerequisites](windows-build-prerequisites.md)
* [Linux Build Prerequisites](linux-build-prerequisites.md)
* [macOS Build Prerequisites](macos-build-prerequisites.md)

## Build Configuration

To build Thunderbird, you need to create a file named `mozconfig` to the root directory of the mozilla-central checkout that contains the option `comm/mail` enabled. You can create a file with this line by doing this in the `source/` directory:

```
echo 'ac_add_options --enable-application=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 **strongly recommended** that you only use options that you fully understand. For example, to create a debug build instead of a release build, that file would also contain the line:

```
echo 'ac_add_options --enable-debug' >> mozconfig
```

_Each of these ac\_add\_options entries needs to be on its own line._

For more on configuration options, see the page [Configuring build options](https://firefox-source-docs.mozilla.org/setup/configuring_build_options.html). Note that if you use an MOZ\_OBJDIR it cannot be a sibling folder to your source directory. Use an absolute path to be sure!

## You're all set

Go ahead to the [Building Thunderbird](thunderbird-development/building-thunderbird/README.md) page and continue following the guide.

{% page-ref page="./" %}
Loading