User:Ehsan/How to build-clang

From MozillaWiki
Jump to: navigation, search

This explains how to build clang on a pristine desktop-build image:

mkdir -p /home/worker/workspace/build
cd /home/worker/workspace/build
git clone src
git clone
cd src
../build-tooltool/ -m browser/config/tooltool-manifests/linux64/releng.manifest fetch
cd build/unix/build-clang
vi # Change the centOS6 global variable to true
./ -c clang-trunk.json

After the refactorings, the following new tools are needed:

git clone git:// && cd ninja
git checkout release
./ --bootstrap
cp ninja /usr/local/bin/ninja
cp ninja /usr/local/bin/ninja-build

The builds can run on TaskCluster using a payload like this:

	"created": "2015-10-14T20:00:24.775Z",
	"deadline": "2015-10-15T21:00:24.775Z",
	"provisionerId": "aws-provisioner-v1",
	"workerType": "opt-linux64",
	"retries": 5,
	"expires": "2016-10-12T02:17:01.554Z",
	"payload": {
		"maxRunTime": 36000,
		"image": "taskcluster/desktop-build:0.1.11",
		"artifacts": {
			"public/clang.tar.xz": {
				"path": "/home/worker/workspace/artifacts/clang.tar.xz",
				"expires": "2016-10-12T02:17:01.554913Z",
				"type": "file"
		"command": [
			"cd /home/worker/ && ./bin/ && ./workspace/build/src/testing/taskcluster/scripts/misc/"
		"env": {
			"GECKO_HEAD_REV": "3cb54681feb4",
	"metadata": {
		"owner": "",
		"source": "",
		"name": "Build Clang (Linux64)",
		"description": "Build Clang"
	"tags": {
		"createdForUser": ""
	"extra": {
		"index": {
			"rank": 92444

Note that you probably want to use the "Update Timestamps" button on TaskCreator and then change the "deadline" to be a day after "created" (the default one hour deadline is insufficient to build clang.)