From db07edcf3bf585d54fadab497f7f6ffc3d5703d1 Mon Sep 17 00:00:00 2001 From: Ted Mielczarek Date: Thu, 3 Dec 2015 12:31:22 -0500 Subject: [PATCH] Modify Breakpad build scripts to pull Breakpad from its new git repository, and also add a `breakpad-taskcluster.sh` script that can be used to drive a Breakpad build in Taskcluster (initiated manually, for now). --- scripts/breakpad-taskcluster.sh | 78 +++++++++++++++++++++++++++++++++ scripts/build-breakpad.sh | 40 ++++++++--------- 2 files changed, 97 insertions(+), 21 deletions(-) create mode 100644 scripts/breakpad-taskcluster.sh diff --git a/scripts/breakpad-taskcluster.sh b/scripts/breakpad-taskcluster.sh new file mode 100644 index 0000000000..1c29d6e4ff --- /dev/null +++ b/scripts/breakpad-taskcluster.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# This script can be used to build a new breakpad.tar.gz for Socorro +# under Taskcluster. It is not currently used in an automated fashion, +# you must manually submit a task to get a new build. The simplest way +# is to paste the contents of the following here document into +# the task-creator tool: https://tools.taskcluster.net/task-creator/ +# +# This task will update a Taskcluster index if it succeeds, such that +# the most recent tarball can be fetched from: +# https://index.taskcluster.net/v1/task/project.socorro.breakpad.v1.builds.linux64.latest/artifacts/public/breakpad.tar.gz +# +# You must be a member of the `socorro` project in Taskcluster for this +# task to work properly. +: <<'EOF' +{ + "created": "2016-04-09T00:49:49.410Z", + "deadline": "2016-04-09T01:49:49.410Z", + "provisionerId": "aws-provisioner-v1", + "workerType": "emulator-jb", + "retries": 0, + "expires": "2017-04-08T22:33:21.202Z", + "routes": [ + "index.project.socorro.breakpad.v1.builds.linux64.latest", + ], + "scopes": [ + "queue:route:index.project.socorro.breakpad.v1.builds.linux64.latest" + ], + "payload": { + "image": "taskcluster/desktop-build:0.1.11", + "command": [ + "/bin/sh", + "-c", + "curl \"https://raw.githubusercontent.com/${SOCORRO_FORK:=mozilla/socorro}/${SOCORRO_BRANCH:=master}/scripts/breakpad-taskcluster.sh\" | bash" + ], + "artifacts": { + "public/breakpad.tar.gz": { + "type": "file", + "path": "/home/worker/breakpad.tar.gz", + } + }, + "maxRunTime": 7200 + }, + "metadata": { + "name": "Build Breakpad", + "description": "Build Breakpad for Socorro consumption", + "owner": "ted@mielczarek.org", + "source": "http://tools.taskcluster.net/task-creator/" + } +} +EOF + +set -v -e -x + +# This script runs in the desktop-build image, but its default python is +# ancient. It does have Python 2.7 installed. +if [[ `python -V 2>&1` = *2.6* ]]; then + mkdir -p bin + ln -s /usr/bin/python2.7 bin/python + export PATH=`pwd`/bin:$PATH +fi + +# Its GCC is also ancient, use the tooltool GCC that Firefox uses. +wget https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py +wget https://hg.mozilla.org/mozilla-central/raw-file/default/browser/config/tooltool-manifests/linux64/releng.manifest +python tooltool.py -m releng.manifest fetch gcc.tar.xz +export CC=`pwd`/gcc/bin/gcc +export CXX=`pwd`/gcc/bin/g++ +export PATH=`pwd`/gcc/bin:$PATH + +# Defer to the build-breakpad.sh script to do the actual build once the +# environment is set up. +curl "https://raw.githubusercontent.com/${SOCORRO_FORK:=mozilla/socorro}/${SOCORRO_BRANCH:=master}/scripts/build-breakpad.sh" > build-breakpad.sh +bash build-breakpad.sh diff --git a/scripts/build-breakpad.sh b/scripts/build-breakpad.sh index 33517b114e..b9bb542ec3 100755 --- a/scripts/build-breakpad.sh +++ b/scripts/build-breakpad.sh @@ -4,42 +4,40 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# Jenkins build script for building Breakpad +# Build script for building Breakpad +# Generally run in Taskcluster, but split out to a separate script +# so it can be run for local builds if necessary without assuming +# the Taskcluster environment. # any failures in this script should cause the build to fail -set -e +set -v -e -x + +export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) + +git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git +export PATH=`pwd`/depot_tools:$PATH # Checkout and build Breakpad echo "PREFIX: ${PREFIX:=`pwd`/build/breakpad}" -svn co http://google-breakpad.googlecode.com/svn/trunk google-breakpad -cd google-breakpad +mkdir breakpad +cd breakpad +fetch breakpad +cd src mkdir -p ${PREFIX} -rsync -a --exclude="*.svn" ./src ${PREFIX}/ +rsync -a --exclude="*.git" ./src ${PREFIX}/ ./configure --prefix=${PREFIX} make install if test -z "${SKIP_CHECK}"; then - #FIXME: Breakpad tests hang on Jenkins CI + #FIXME: get this working again #make check true fi -svn info | grep Revision | cut -d' ' -f 2 > ${PREFIX}/revision.txt -cd .. - -# Clone and build exploitable -if test -d exploitable; then - hg -R exploitable pull -u -else - hg clone http://hg.mozilla.org/users/tmielczarek_mozilla.com/exploitable/ -fi -cd exploitable -make BREAKPAD_SRCDIR=../google-breakpad BREAKPAD_OBJDIR=../google-breakpad -cp exploitable ${PREFIX}/bin -cd .. +git rev-parse master > ${PREFIX}/revision.txt +cd ../.. -cp google-breakpad/src/third_party/libdisasm/libdisasm.a ${PREFIX}/lib/ +cp breakpad/src/src/third_party/libdisasm/libdisasm.a ${PREFIX}/lib/ # Optionally package everything up if test -z "${SKIP_TAR}"; then - echo "Creating breakpad.tar.gz" tar -C ${PREFIX}/.. --mode 755 --owner 0 --group 0 -zcf breakpad.tar.gz `basename ${PREFIX}` fi