ReleaseEngineering/How To/Clang update

From MozillaWiki
Jump to navigation Jump to search

Intro

Clang packages use tooltool to deploy itself run time. The binaries are hosted on relengweb1.dmz.scl3.mozilla.com (use your LDAP account) and accessible from http://runtime-binaries.pvt.build.mozilla.org/tooltool/.

Clang build is made by http://hg.mozilla.org/mozilla-central/file/tip/build/unix/build-clang/build-clang.py script. You may want to use this script to discover the recent used version of clang.

Compilation

MacOS X builders have everything installed to build clang.

Linux64 (Centos 6.2) needs the following packages installed:

yum install make gcc gcc-c++ mercurial subversion patch \
 http://puppetagain.pub.build.mozilla.org/data/repos/yum/releng/public/CentOS/6/x86_64/gcc472_0moz1-4.7.2-0moz1.x86_64.rpm \
 http://puppetagain.pub.build.mozilla.org/data/repos/yum/releng/public/CentOS/6/x86_64/mozilla-python27-2.7.3-1.el6.x86_64.rpm

Linux32 (Centos 6.2) needs the following packages installed:

yum install make gcc gcc-c++ mercurial subversion patch \
  http://puppetagain.pub.build.mozilla.org/data/repos/yum/releng/public/CentOS/6/i386/gcc472_0moz1-4.7.2-0moz1.i686.rpm \
  http://puppetagain.pub.build.mozilla.org/data/repos/yum/releng/public/CentOS/6/i386/mozilla-python27-2.7.3-1.el6.i686.rpm

Alternatively you can use vagrant with the following box images (TODO: move the files somewhere else):

Passwords for root and vagrant users are "vagrant". You can create your vagrant VMs similar to this:

vagrant init clang-vm $URL_from_above
vagrant up
# ignore timeout warnings
vagrant ssh
# use "vagrant" as a pasword

To build clang clone mozilla-central and run the build script:

hg clone https://hg.mozilla.org/mozilla-central
cd mozilla-central/build/unix/build-clang
# adjust revision in build-clang.py if needed
time /tools/python27/bin/python2.7 build-clang.py -c clang-trunk.json
# go and drink something

Once the build is finished you can find 2 not tracked files (hg st) in the current directory. clang.manifest should be attached to the bug and $SHA512 should be uploaded to the tooltool server (see below).

How to add a new version

  • Manifests should be attached to the bug by a developer
  • ssh to relengwebadm.private.scl3.mozilla.com
  • Download files
mkdir ~/tooltool
cd ~/tooltool
rm -i *
# get latest setup.sh if its manifest was changed
wget https://hg.mozilla.org/mozilla-central/raw-file/default/build/unix/build-clang/setup.sh
# download new clang packages
wget http://people.mozilla.org/~user/clang-linux.tar.bz2
wget http://people.mozilla.org/~user/clang-linux64.tar.bz2
wget http://people.mozilla.org/~user/clang-osx.tar.bz2
# Fix permissions
chmod 644 *
  • Copy files to the tooltool directory. Use the "digest" field from the generated manifests as target file name:
for f in clang-*.tar.bz2; do
  ls -l $f
  sudo cp -vi $f /var/www/html/runtime-binaries/tooltool/sha512/$(sha512sum $f | cut -f1 -d " ")
done
  • repeat the same step for setup.sh if needed

See Also