taskcluster/scripts/misc/build-minidump-stackwalk.sh
author Mike Hommey <mh+mozilla@glandium.org>
Fri, 11 Jan 2019 22:29:35 +0000
changeset 453577 a58fad772b6f
permissions -rw-r--r--
Bug 1391408 - Build minidump_stackwalk as a toolchain. r=froydnj This produces the same executables (produced for the same platforms) as those currently pulled from tooltool (modulo timestamps, maybe changes since last manifest change, etc.). Unfortunately, as of currently, the Windows variant needs to be cross-built with mingw because it doesn't compile without some POSIX APIs that MSVC/Windows SDK don't provide. One thing that is left out of this change is whether to be completely accurate with the toolchain cache hash (requiring a large list of files as resources, and making those built very frequently), whether we'd rely on manual updates, or if we should go with completely uncached tasks. This can be left for a followup, the tasks not being hooked up to be actually used by other tasks yet. Differential Revision: https://phabricator.services.mozilla.com/D16302

#!/bin/bash
set -x -e -v

# This script is for building minidump_stackwalk

WORKSPACE=$HOME/workspace
UPLOAD_DIR=$HOME/artifacts
COMPRESS_EXT=xz

cd $WORKSPACE/build/src

. taskcluster/scripts/misc/tooltool-download.sh

export MOZ_OBJDIR=obj-minidump

echo ac_add_options --enable-project=tools/crashreporter > .mozconfig

MINIDUMP_STACKWALK=minidump_stackwalk

case "$1" in
macosx64)
    TOOLCHAINS="cctools rustc clang"
    echo ac_add_options --target=x86_64-apple-darwin11 >> .mozconfig
    echo ac_add_options --with-macos-sdk=$WORKSPACE/build/src/MacOSX10.11.sdk >> .mozconfig
    ;;
mingw32)
    TOOLCHAINS="binutils rustc clang"
    echo ac_add_options --target=i686-w64-mingw32 >> .mozconfig
    echo export CC=i686-w64-mingw32-clang >> .mozconfig
    echo export HOST_CC=clang >> .mozconfig
    MINIDUMP_STACKWALK=minidump_stackwalk.exe
    ;;
*)
    TOOLCHAINS="binutils rustc clang"
    ;;
esac

for t in $TOOLCHAINS; do
    PATH="$WORKSPACE/build/src/$t/bin:$PATH"
done

./mach build -v

mkdir minidump_stackwalk
cp $MOZ_OBJDIR/dist/bin/$MINIDUMP_STACKWALK minidump_stackwalk/

tar -acf minidump_stackwalk.tar.$COMPRESS_EXT minidump_stackwalk/
mkdir -p $UPLOAD_DIR
cp minidump_stackwalk.tar.$COMPRESS_EXT $UPLOAD_DIR