2015-07-23 09:10:00 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
srcdir=$PWD/src
|
|
|
|
objdir=${MOZ_OBJDIR-objdir}
|
|
|
|
|
|
|
|
# If the objdir is a relative path, it is relative to the srcdir.
|
|
|
|
case "$objdir" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
objdir="$srcdir/$objdir"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ ! -d $objdir ]; then
|
|
|
|
mkdir $objdir
|
|
|
|
fi
|
|
|
|
cd $objdir
|
|
|
|
|
|
|
|
if [ "`uname -m`" = "x86_64" ]; then
|
|
|
|
_arch=64
|
|
|
|
else
|
|
|
|
_arch=32
|
|
|
|
fi
|
|
|
|
|
2015-07-30 04:26:58 +03:00
|
|
|
TOOLTOOL_MANIFEST=browser/config/tooltool-manifests/linux${_arch}/releng.manifest
|
2015-07-23 09:22:16 +03:00
|
|
|
TOOLTOOL_SERVER=https://api.pub.build.mozilla.org/tooltool/
|
2017-04-12 11:45:52 +03:00
|
|
|
(cd $srcdir; ./mach artifact toolchain -v --tooltool-url $TOOLTOOL_SERVER --tooltool-manifest $TOOLTOOL_MANIFEST ${TOOLTOOL_CACHE:+ --cache-dir ${TOOLTOOL_CACHE}}) || exit 2
|
2015-07-23 09:22:16 +03:00
|
|
|
|
2015-07-23 09:10:00 +03:00
|
|
|
# Note: an exit code of 2 turns the job red on TBPL.
|
|
|
|
MOZCONFIG=$srcdir/browser/config/mozconfigs/linux${_arch}/valgrind make -f $srcdir/client.mk configure || exit 2
|
|
|
|
make -j4 || exit 2
|
|
|
|
make package || exit 2
|
|
|
|
|
|
|
|
# We need to set MOZBUILD_STATE_PATH so that |mach| skips its first-run
|
|
|
|
# initialization step and actually runs the |valgrind-test| command.
|
|
|
|
export MOZBUILD_STATE_PATH=.
|
|
|
|
|
|
|
|
# |mach valgrind-test|'s exit code will be 1 (which turns the job orange on
|
|
|
|
# TBPL) if Valgrind finds errors, and 2 (which turns the job red) if something
|
|
|
|
# else goes wrong, such as Valgrind crashing.
|
|
|
|
python2.7 $srcdir/mach valgrind-test
|
|
|
|
exit $?
|