bug 1354216 - fix cctools-port build scripts. r?mshal draft
authorTed Mielczarek <ted@mielczarek.org>
Mon, 10 Apr 2017 15:38:24 -0400
changeset 559905 53ffebc183225c016bc96477bca9470943c69602
parent 559749 b1364675bdf5dffe63fd60373034293de0b513d5
child 623557 2f22064ddda9313341243ab946db17261a3c23c1
push id53267
push usertmielczarek@mozilla.com
push dateMon, 10 Apr 2017 19:56:48 +0000
reviewersmshal
bugs1354216
milestone55.0a1
bug 1354216 - fix cctools-port build scripts. r?mshal The cctools-port build scripts were pulling and building the master branch of the cctools-port repo, which means they'd build whatever was there when they get triggered. I think this was copied from my build-cctools script which did the same thing, so it's my fault in the end! This patch pins a revision in the script so we'll build the same thing until we explicitly update. I also fixed the scripts to use git instead of tc-vcs, since tc-vcs prints misleading error messages, and nothing else uses that anymore. Finally, I removed the build-cctools script, since all the builds are using cctools-port now so it doesn't serve any useful purpose. MozReview-Commit-ID: 5myqHS4duor
taskcluster/scripts/misc/build-cctools-port-macosx.sh
taskcluster/scripts/misc/build-cctools-port.sh
taskcluster/scripts/misc/build-cctools.sh
taskcluster/scripts/misc/build-libdmg-hfsplus.sh
--- a/taskcluster/scripts/misc/build-cctools-port-macosx.sh
+++ b/taskcluster/scripts/misc/build-cctools-port-macosx.sh
@@ -4,33 +4,34 @@ set -x -e -v
 # This script is for building cctools (Apple's binutils) for Mac OS X on
 # Linux using ctools-port (https://github.com/tpoechtrager/cctools-port).
 
 WORKSPACE=$HOME/workspace
 UPLOAD_DIR=$WORKSPACE/artifacts
 
 # Repository info
 : CROSSTOOL_PORT_REPOSITORY    ${CROSSTOOL_PORT_REPOSITORY:=https://github.com/tpoechtrager/cctools-port}
-: CROSSTOOL_PORT_REV           ${CROSSTOOL_PORT_REV:=master}
+: CROSSTOOL_PORT_REV           ${CROSSTOOL_PORT_REV:=8e9c3f2506b51cf56725eaa60b6e90e240e249ca}
 
 # Set some crosstools-port directories
 CROSSTOOLS_SOURCE_DIR=$WORKSPACE/crosstools-port
 CROSSTOOLS_CCTOOLS_DIR=$CROSSTOOLS_SOURCE_DIR/cctools
 CROSSTOOLS_BUILD_DIR=/tmp/cctools
 CLANG_DIR=$WORKSPACE/clang
 CCTOOLS_DIR=$WORKSPACE/cctools
 MACOSX_SDK_DIR=$WORKSPACE/MacOSX10.10.sdk
 
 TARGET_TRIPLE=x86_64-apple-darwin11
 
 # Create our directories
 mkdir -p $CROSSTOOLS_BUILD_DIR
 
-tc-vcs checkout --force-clone $CROSSTOOLS_SOURCE_DIR $CROSSTOOL_PORT_REPOSITORY $CROSSTOOL_PORT_REPOSITORY $CROSSTOOL_PORT_REV
+git clone --no-checkout $CROSSTOOL_PORT_REPOSITORY $CROSSTOOLS_SOURCE_DIR
 cd $CROSSTOOLS_SOURCE_DIR
+git checkout $CROSSTOOL_PORT_REV
 echo "Building from commit hash `git rev-parse $CROSSTOOL_PORT_REV`..."
 
 # Fetch clang from tooltool
 cd $WORKSPACE
 wget -O tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py
 chmod +x tooltool.py
 : TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
 export TOOLTOOL_CACHE
--- a/taskcluster/scripts/misc/build-cctools-port.sh
+++ b/taskcluster/scripts/misc/build-cctools-port.sh
@@ -4,29 +4,30 @@ set -x -e -v
 # This script is for building cctools (Apple's binutils) for Linux using
 # cctools-port (https://github.com/tpoechtrager/cctools-port).
 
 WORKSPACE=$HOME/workspace
 UPLOAD_DIR=$WORKSPACE/artifacts
 
 # Repository info
 : CROSSTOOL_PORT_REPOSITORY    ${CROSSTOOL_PORT_REPOSITORY:=https://github.com/tpoechtrager/cctools-port}
-: CROSSTOOL_PORT_REV           ${CROSSTOOL_PORT_REV:=master}
+: CROSSTOOL_PORT_REV           ${CROSSTOOL_PORT_REV:=8e9c3f2506b51cf56725eaa60b6e90e240e249ca}
 
 # Set some crosstools-port directories
 CROSSTOOLS_SOURCE_DIR=$WORKSPACE/crosstools-port
 CROSSTOOLS_CCTOOLS_DIR=$CROSSTOOLS_SOURCE_DIR/cctools
 CROSSTOOLS_BUILD_DIR=$WORKSPACE/cctools
 CLANG_DIR=$WORKSPACE/clang
 
 # Create our directories
 mkdir -p $CROSSTOOLS_BUILD_DIR
 
-tc-vcs checkout --force-clone $CROSSTOOLS_SOURCE_DIR $CROSSTOOL_PORT_REPOSITORY $CROSSTOOL_PORT_REPOSITORY $CROSSTOOL_PORT_REV
+git clone --no-checkout $CROSSTOOL_PORT_REPOSITORY $CROSSTOOLS_SOURCE_DIR
 cd $CROSSTOOLS_SOURCE_DIR
+git checkout $CROSSTOOL_PORT_REV
 echo "Building from commit hash `git rev-parse $CROSSTOOL_PORT_REV`..."
 
 # Fetch clang from tooltool
 cd $WORKSPACE
 wget -O tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py
 chmod +x tooltool.py
 : TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
 export TOOLTOOL_CACHE
deleted file mode 100755
--- a/taskcluster/scripts/misc/build-cctools.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-set -x -e -v
-
-# This script is for building cctools (Apple's binutils) for Linux using
-# crosstool-ng (https://github.com/diorcety/crosstool-ng).
-
-WORKSPACE=$HOME/workspace
-UPLOAD_DIR=$WORKSPACE/artifacts
-
-# Repository info
-: CROSSTOOL_NG_REPOSITORY    ${CROSSTOOL_NG_REPOSITORY:=https://github.com/diorcety/crosstool-ng}
-: CROSSTOOL_NG_REV           ${CROSSTOOL_NG_REV:=master}
-
-# hacky
-ln -s `which gcc` ~/bin/x86_64-linux-gnu-gcc
-export PATH=$PATH:~/bin
-
-# Set some crosstools-ng directories
-CT_TOP_DIR=$WORKSPACE/crosstool-ng-build
-CT_PREFIX_DIR=$WORKSPACE/cctools
-CT_SRC_DIR=$CT_TOP_DIR/src
-CT_TARBALLS_DIR=$CT_TOP_DIR
-CT_WORK_DIR=$CT_SRC_DIR
-CT_LIB_DIR=$WORKSPACE/crosstool-ng
-CT_BUILD_DIR=$CT_TOP_DIR/build
-CT_LLVM_DIR=$WORKSPACE/clang
-CT_BUILDTOOLS_PREFIX_DIR=$CT_PREFIX_DIR
-
-# Create our directories
-rm -rf $CT_TOP_DIR
-mkdir $CT_TOP_DIR
-rm -rf $CT_PREFIX_DIR
-mkdir $CT_PREFIX_DIR
-mkdir -p $CT_SRC_DIR
-
-# Clone the crosstool-ng repo
-tc-vcs checkout $CT_LIB_DIR $CROSSTOOL_NG_REPOSITORY $CROSSTOOL_NG_REPOSITORY $CROSSTOOL_NG_REV
-
-# Fetch clang from tooltool
-cd $WORKSPACE
-wget -O tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py
-chmod +x tooltool.py
-: TOOLTOOL_CACHE                ${TOOLTOOL_CACHE:=/home/worker/tooltool-cache}
-export TOOLTOOL_CACHE
-
-wget ${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/browser/config/tooltool-manifests/linux64/clang.manifest
-
-python tooltool.py -v --manifest=clang.manifest fetch
-
-# Copy clang into the crosstools-ng srcdir
-cp -Rp $CT_LLVM_DIR $CT_SRC_DIR
-
-# Configure crosstools-ng
-sed=sed
-CT_CONNECT_TIMEOUT=5
-CT_BINUTILS_VERSION=809
-CT_PATCH_ORDER=bundled
-CT_BUILD=x86_64-linux-gnu
-CT_HOST=x86_64-linux-gnu
-CT_TARGET=x86_64-apple-darwin10
-CT_LLVM_FULLNAME=clang
-
-cd $CT_TOP_DIR
-
-# gets a bit too verbose here
-set +x
-
-. $CT_LIB_DIR/scripts/functions
-. $CT_LIB_DIR/scripts/build/binutils/cctools.sh
-
-# Build cctools
-do_binutils_get
-do_binutils_extract
-do_binutils_for_host
-
-set -x
-
-strip $CT_PREFIX_DIR/bin/*
-
-# Put a tarball in the artifacts dir
-mkdir -p $UPLOAD_DIR
-tar czf $UPLOAD_DIR/cctools.tar.gz -C $WORKSPACE `basename $CT_PREFIX_DIR`
--- a/taskcluster/scripts/misc/build-libdmg-hfsplus.sh
+++ b/taskcluster/scripts/misc/build-libdmg-hfsplus.sh
@@ -13,18 +13,20 @@ UPLOAD_DIR=$WORKSPACE/artifacts
 # backport some patches.
 : LIBDMG_REPOSITORY    ${LIBDMG_REPOSITORY:=https://github.com/mozilla/libdmg-hfsplus}
 # The `mozilla` branch contains our fork.
 : LIBDMG_REV           ${LIBDMG_REV:=mozilla}
 
 mkdir -p $UPLOAD_DIR $STAGE
 
 cd $WORKSPACE
-tc-vcs checkout --force-clone libdmg-hfsplus $LIBDMG_REPOSITORY $LIBDMG_REPOSITORY $LIBDMG_REV
+git clone --no-checkout $LIBDMG_REPOSITORY libdmg-hfsplus
 cd libdmg-hfsplus
+git checkout $LIBDMG_REV
+
 # Make a source archive
 git archive ${LIBDMG_REV} | xz > $UPLOAD_DIR/libdmg-hfsplus.tar.xz
 cmake .
 make -j$(getconf _NPROCESSORS_ONLN)
 
 # We only need the dmg and hfsplus tools.
 strip dmg/dmg hfs/hfsplus
 cp dmg/dmg hfs/hfsplus $STAGE