diff options
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | DEPS | 20 | ||||
-rwxr-xr-x | android_webview/tools/webview_licenses.py | 4 | ||||
-rw-r--r-- | build/common.gypi | 2 | ||||
-rwxr-xr-x | build/linux/install-arm-sysroot.py | 103 | ||||
-rwxr-xr-x | chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py | 79 |
6 files changed, 73 insertions, 139 deletions
@@ -43,7 +43,6 @@ Thumbs.db v8.log /_out /android_emulator_sdk -/arm-sysroot /ash/ash_unittests_run.xml /base/base_unittests_run.xml /breakpad/src/ @@ -93,8 +92,7 @@ v8.log /chrome/common/extensions/api/api.xml /chrome/common/extensions/api/ledger/ /chrome/Hammer -/chrome/installer/linux/debian_wheezy_amd64-sysroot/ -/chrome/installer/linux/debian_wheezy_i386-sysroot/ +/chrome/installer/linux/debian_wheezy_*-sysroot/ /chrome/installer/linux/internal /chrome/installer/mac/internal /chrome/installer/mac/third_party/xz/xz @@ -547,16 +547,6 @@ hooks = [ ], }, { - # Downloads an ARM sysroot image to src/arm-sysroot. This image updates - # at about the same rate that the chrome build deps change. - # This script is a no-op except for linux users who have - # target_arch=arm in their GYP_DEFINES. - 'name': 'sysroot', - 'pattern': '.', - 'action': ['python', 'src/build/linux/install-arm-sysroot.py', - '--linux-only'], - }, - { # Downloads the Debian Wheezy sysroot to chrome/installer/linux if needed. # This sysroot updates at about the same rate that the chrome build deps # change. This script is a no-op except for linux users who are doing @@ -580,6 +570,16 @@ hooks = [ '--arch=i386'], }, { + # Same as above, but for ARM Linux. + 'name': 'sysroot', + 'pattern': '.', + 'action': [ + 'python', + 'src/chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py', + '--linux-only', + '--arch=arm'], + }, + { # Update the Windows toolchain if necessary. 'name': 'win_toolchain', 'pattern': '.', diff --git a/android_webview/tools/webview_licenses.py b/android_webview/tools/webview_licenses.py index 3b4e006..01b2715 100755 --- a/android_webview/tools/webview_licenses.py +++ b/android_webview/tools/webview_licenses.py @@ -152,7 +152,9 @@ def _CheckLicenseHeaders(excluded_dirs_list, whitelisted_files): excluded_dirs_list.append('tools/histograms') # Swarming tools, doesn't exist in the snapshot excluded_dirs_list.append('tools/swarming_client') - # Arm sysroot tools, doesn't exist in the snapshot + # ARM sysroot, doesn't exist in the snapshot + excluded_dirs_list.append('chrome/installer/linux/debian_wheezy_arm-sysroot') + # Old location (TODO(sbc): Remove this once it no longer exists on any bots) excluded_dirs_list.append('arm-sysroot') # Data is not part of open source chromium, but are included on some bots. excluded_dirs_list.append('data') diff --git a/build/common.gypi b/build/common.gypi index 0ad62ee..8f9cb38 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -903,7 +903,7 @@ 'use_allocator%': 'none', # sysroot needs to be an absolute path otherwise it generates # incorrect results when passed to pkg-config - 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/arm-sysroot', + 'sysroot%': '<!(cd <(DEPTH) && pwd -P)/chrome/installer/linux/debian_wheezy_arm-sysroot', }], # OS=="linux" and target_arch=="arm" and chromeos==0 ['OS=="linux" and branding=="Chrome" and buildtype=="Official" and chromeos==0', { diff --git a/build/linux/install-arm-sysroot.py b/build/linux/install-arm-sysroot.py index 4d593cc..495fc75 100755 --- a/build/linux/install-arm-sysroot.py +++ b/build/linux/install-arm-sysroot.py @@ -3,103 +3,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -"""Script to install ARM root 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. - -Steps to rebuild the arm sysroot image: - -- cd $SRC/native_client -- ./tools/trusted_cross_toolchains/trusted-toolchain-creator.armel.precise.sh \ - UpdatePackageLists -- ./tools/trusted_cross_toolchains/trusted-toolchain-creator.armel.precise.sh \ - BuildJail $SRC/out/arm-sysroot.tar.gz -- gsutil cp -a public-read $SRC/out/arm-sysroot.tar.gz \ - nativeclient-archive2/toolchain/$NACL_REV/sysroot-arm-trusted.tgz -""" - -# TODO(sbc): merge this script into: -# chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py - -import hashlib -import os -import shutil -import subprocess import sys - -SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -URL_PREFIX = 'https://storage.googleapis.com' -URL_PATH = 'chrome-linux-sysroot/toolchain' -REVISION = 285950 -TARBALL = 'debian_wheezy_arm_sysroot.tgz' -TARBALL_SHA1SUM = 'fc2f54db168887c5190c4c6686c869bedf668b4e' - - -def get_sha1(filename): - sha1 = hashlib.sha1() - with open(filename, 'rb') as f: - while True: - # Read in 1mb chunks, so it doesn't all have to be loaded into memory. - chunk = f.read(1024*1024) - if not chunk: - break - sha1.update(chunk) - return sha1.hexdigest() - - -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/%s/%s" % (URL_PREFIX, URL_PATH, REVISION, TARBALL) - - 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, TARBALL) - curl = ['curl', '--fail', '-L', url, '-o', tarball] - if os.isatty(sys.stdout.fileno()): - curl.append('--progress') - else: - curl.append('--silent') - subprocess.check_call(curl) - sha1sum = get_sha1(tarball) - if sha1sum != TARBALL_SHA1SUM: - print 'Tarball sha1sum is wrong.' - print 'Expected %s, actual: %s' % (TARBALL_SHA1SUM, sha1sum) - return 1 - 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:])) +msg = '''\ +ERROR: This script has merged with install-debian.wheezy.sysroot.py. +Please use that instead (with --arch=arm). +''' +sys.stderr.write(msg) diff --git a/chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py b/chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py index 35b5a94..91c168a 100755 --- a/chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py +++ b/chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py @@ -26,15 +26,20 @@ import sys SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -URL_PREFIX = 'https://commondatastorage.googleapis.com' +URL_PREFIX = 'http://storage.googleapis.com' URL_PATH = 'chrome-linux-sysroot/toolchain' -REVISION = 264817 +REVISION_AMD64 = 264817 +REVISION_I386 = 264817 +REVISION_ARM = 285950 TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz' TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz' +TARBALL_ARM = 'debian_wheezy_arm_sysroot.tgz' TARBALL_AMD64_SHA1SUM = '74b7231e12aaf45c5c5489d9aebb56bd6abb3653' TARBALL_I386_SHA1SUM = 'fe3d284926839683b00641bc66c9023f872ea4b4' +TARBALL_ARM_SHA1SUM = 'fc2f54db168887c5190c4c6686c869bedf668b4e' SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot' SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot' +SYSROOT_DIR_ARM = 'debian_wheezy_arm-sysroot' def get_sha1(filename): @@ -50,7 +55,7 @@ def get_sha1(filename): def main(args): - if options.arch not in ['amd64', 'i386']: + if options.arch not in ['amd64', 'i386', 'arm']: print 'Unknown architecture: %s' % options.arch return 1 @@ -60,27 +65,33 @@ def main(args): if not sys.platform.startswith('linux'): return 0 - # Only install the sysroot for an Official Chrome Linux build. - defined = ['branding=Chrome', 'buildtype=Official'] - undefined = ['chromeos=1'] gyp_defines = os.environ.get('GYP_DEFINES', '') - for option in defined: - if option not in gyp_defines: - return 0 - for option in undefined: - if option in gyp_defines: - return 0 + + # Only install the sysroot for an Official Chrome Linux build, except + # for ARM where we always use a sysroot. + if options.arch != 'arm': + defined = ['branding=Chrome', 'buildtype=Official'] + undefined = ['chromeos=1'] + for option in defined: + if option not in gyp_defines: + return 0 + for option in undefined: + if option in gyp_defines: + return 0 # Check for optional target_arch and only install for that architecture. # If target_arch is not specified, then only install for the host # architecture. - host_arch = '' + target_arch = '' if 'target_arch=x64' in gyp_defines: - host_arch = 'amd64' + target_arch = 'amd64' elif 'target_arch=ia32' in gyp_defines: - host_arch = 'i386' + target_arch = 'i386' + elif 'target_arch=arm' in gyp_defines: + target_arch = 'arm' else: - # Figure out host arch using build/detect_host_arch.py. + # Figure out host arch using build/detect_host_arch.py and + # set target_arch to host arch SRC_DIR = os.path.abspath( os.path.join(SCRIPT_DIR, '..', '..', '..', '..')) sys.path.append(os.path.join(SRC_DIR, 'build')) @@ -88,10 +99,13 @@ def main(args): detected_host_arch = detect_host_arch.HostArch() if detected_host_arch == 'x64': - host_arch = 'amd64' + target_arch = 'amd64' elif detected_host_arch == 'ia32': - host_arch = 'i386' - if host_arch != options.arch: + target_arch = 'i386' + elif detected_host_arch == 'arm': + target_arch = 'arm' + + if target_arch != options.arch: return 0 # The sysroot directory should match the one specified in build/common.gypi. @@ -102,11 +116,22 @@ def main(args): sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64) tarball_filename = TARBALL_AMD64 tarball_sha1sum = TARBALL_AMD64_SHA1SUM - else: + revision = REVISION_AMD64 + elif options.arch == 'arm': + sysroot = os.path.join(linux_dir, SYSROOT_DIR_ARM) + tarball_filename = TARBALL_ARM + tarball_sha1sum = TARBALL_ARM_SHA1SUM + revision = REVISION_ARM + elif options.arch == 'i386': sysroot = os.path.join(linux_dir, SYSROOT_DIR_I386) tarball_filename = TARBALL_I386 tarball_sha1sum = TARBALL_I386_SHA1SUM - url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, REVISION, tarball_filename) + revision = REVISION_I386 + else: + assert(false) + + + url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename) stamp = os.path.join(sysroot, '.stamp') if os.path.exists(stamp): @@ -121,7 +146,10 @@ def main(args): shutil.rmtree(sysroot) os.mkdir(sysroot) tarball = os.path.join(sysroot, tarball_filename) - subprocess.check_call(['curl', '-L', url, '-o', tarball]) + print 'Downloading %s' % url + sys.stdout.flush() + sys.stderr.flush() + subprocess.check_call(['curl', '--fail', '-L', url, '-o', tarball]) sha1sum = get_sha1(tarball) if sha1sum != tarball_sha1sum: print 'Tarball sha1sum is wrong.' @@ -137,10 +165,9 @@ def main(args): if __name__ == '__main__': parser = optparse.OptionParser('usage: %prog [OPTIONS]') - parser.add_option('', '--linux-only', dest='linux_only', action='store_true', + parser.add_option('--linux-only', action='store_true', default=False, help='Only install sysroot for official ' 'Linux builds') - parser.add_option('', '--arch', dest='arch', - help='Sysroot architecture, i386 or amd64') + parser.add_option('--arch', help='Sysroot architecture: i386, amd64 or arm') options, args = parser.parse_args() - sys.exit(main(options)) + sys.exit(main(args)) |