diff options
author | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-08 21:04:20 +0000 |
---|---|---|
committer | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-08 21:04:20 +0000 |
commit | d7b4ad214f232f2c22b3d534838153121ea5f5d7 (patch) | |
tree | b106d0bd1d9d44e6d931c12b21db843b8b36fd7e /build | |
parent | ea54aa743e594b99049acb8dbb639d0c168624fe (diff) | |
download | chromium_src-d7b4ad214f232f2c22b3d534838153121ea5f5d7.zip chromium_src-d7b4ad214f232f2c22b3d534838153121ea5f5d7.tar.gz chromium_src-d7b4ad214f232f2c22b3d534838153121ea5f5d7.tar.bz2 |
Download arm sysroot as part of gclient hooks.
install-arm-sysroot.py is now seperated out from
install-build-deps.sh so that it can be invoked
independently by the gclient hooks.
This addresses a couple of different issues with
configuring the arm buildbots. Firstly it means
that they will always have an up-to-date arm
sysroot installed. Secondly, it means the script
is always run as the user (and not as root) which
mean the expanded files that the correct ownership.
BUG=
Review URL: https://chromiumcodereview.appspot.com/11468014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/install-build-deps.sh | 36 | ||||
-rwxr-xr-x | build/linux/install-arm-sysroot.py | 65 |
2 files changed, 65 insertions, 36 deletions
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index 1fabb9c..730c0d1 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -250,42 +250,6 @@ else exit 100 fi -# Install arm root image -if test "$do_inst_arm" = "1"; then - # As well as the arm toolchain packages we also need a recent arm root - # image to build against (using --sysroot). We could construct this - # from scratch based on the current state or precise/arm but for - # consistency we currently use a pre-built root image which was constructed - # for building trusted NaCl code. - CHROME_ROOT="$(dirname ${BASH_SOURCE[0]})" - CHROME_ROOT="$(dirname ${CHROME_ROOT})" - SYSROOT="${CHROME_ROOT}/arm-sysroot" - TC_URL_PREFIX=https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain - TC_REV=8001 - TC_URL=${TC_URL_PREFIX}/${TC_REV}/naclsdk_linux_arm-trusted.tgz - - INSTALL_ROOT="yes" - STAMP="${SYSROOT}/.stamp" - if [ -f "${STAMP}" ]; then - if [ "${TC_URL}" = $(cat ${STAMP}) ]; then - INSTALL_ROOT="no" - fi - fi - - if [ $INSTALL_ROOT = "no" ]; then - echo "ARM root image already up-to-date." - else - echo "Installing ARM root image." - mkdir -p ${SYSROOT} - tarball=${SYSROOT}/naclsdk_linux_arm-trusted.tgz - set -x - curl -L ${TC_URL} -o ${tarball} - tar xf ${tarball} -C ${SYSROOT} - rm ${tarball} - echo -n "${TC_URL}" > "${STAMP}" - fi -fi - # Install 32bit backwards compatibility support for 64bit systems if [ "$(uname -m)" = "x86_64" ]; then if test "$do_inst_lib32" != "1" diff --git a/build/linux/install-arm-sysroot.py b/build/linux/install-arm-sysroot.py new file mode 100755 index 0000000..b8b4f0a --- /dev/null +++ b/build/linux/install-arm-sysroot.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Script to install arm choot image for cross building of arm chrome on linux. +# This script can be run manually but is more often run as part of gclient +# hooks. When run from hooks this script should be a no-op on non-linux +# platforms. + +# The sysroot image could be constructed from scratch based on the current +# state or precise/arm but for consistency we currently use a pre-built root +# image which was originally designed for building trusted NaCl code. The image +# will normally need to be rebuilt every time chrome's build dependancies are +# changed. + +import os +import shutil +import subprocess +import sys + + +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +URL_PREFIX = 'https://commondatastorage.googleapis.com/nativeclient-archive2/toolchain' +REVISION = 8002 + + +def main(args): + if '--linux-only' in args: + # This argument is passed when run from the gclient hooks. + # In this case we return early on non-linux platforms + # or if GYP_DEFINES doesn't include target_arch=arm + if not sys.platform.startswith('linux'): + return 0 + + if "target_arch=arm" not in os.environ.get('GYP_DEFINES', ''): + return 0 + + src_root = os.path.dirname(os.path.dirname(SCRIPT_DIR)) + sysroot = os.path.join(src_root, 'arm-sysroot') + url = "%s/%s/naclsdk_linux_arm-trusted.tgz" % (URL_PREFIX, REVISION) + + stamp = os.path.join(sysroot, ".stamp") + if os.path.exists(stamp): + with open(stamp) as s: + if s.read() == url: + print "ARM root image already up-to-date: %s" % sysroot + return 0 + + print "Installing ARM root image: %s" % sysroot + if os.path.isdir(sysroot): + shutil.rmtree(sysroot) + os.mkdir(sysroot) + tarball = os.path.join(sysroot, 'naclsdk_linux_arm-trusted.tgz') + subprocess.check_call(['curl', '-L', url, '-o', tarball]) + subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) + os.remove(tarball) + + with open(stamp, 'w') as s: + s.write(url) + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) |