From 91951472bf06e82ab472d8aad62b4be17a9b3033 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 8 Mar 2016 20:35:32 +0530 Subject: [PATCH] use sysroot by default on linux --- script/bootstrap.py | 30 ++++++++---------------------- script/install-sysroot.py | 33 ++++++++++++--------------------- script/update.py | 6 ------ toolchain.gypi | 2 +- 4 files changed, 21 insertions(+), 50 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index b09bc015d70..b0a528f760a 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -44,7 +44,7 @@ def main(): args.libcc_static_library_path) if PLATFORM == 'linux': - download_sysroot(args.target_arch, args.sysroot_url, args.sysroot_sha1sum) + download_sysroot(args.target_arch) create_chrome_version_h() touch_config_gypi() @@ -79,10 +79,6 @@ def parse_args(): help='The shared library path of libchromiumcontent.') parser.add_argument('--libcc_static_library_path', required=False, help='The static library path of libchromiumcontent.') - parser.add_argument('--sysroot_url', required=False, - help='The URL to download sysroot image.') - parser.add_argument('--sysroot_sha1sum', required=False, - help='SHA1 hash of the sysroot image tarball.') return parser.parse_args() @@ -167,23 +163,13 @@ def update_clang(): execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'update-clang.sh')]) -def download_sysroot(target_arch, url, sha1sum): - if url or target_arch in ['ia32', 'arm']: - os.environ['USE_SYSROOT'] = '1' - sysroot_script = os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py') - if target_arch == 'ia32': - target_arch = 'i386' - if target_arch == 'x64': - target_arch = 'amd64' - args = [ - '--arch', target_arch - ] - if url: - args += ['--url', url] - if sha1sum: - args += ['--revision', sha1sum] - execute_stdout([sysroot_script] + args) - +def download_sysroot(target_arch): + if target_arch == 'ia32': + target_arch = 'i386' + if target_arch == 'x64': + target_arch = 'amd64' + execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py'), + '--arch', target_arch]) def create_chrome_version_h(): version_file = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', diff --git a/script/install-sysroot.py b/script/install-sysroot.py index 6c7b8adc62d..16df6f7b9e5 100755 --- a/script/install-sysroot.py +++ b/script/install-sysroot.py @@ -30,15 +30,15 @@ from lib.util import get_host_arch SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) URL_PREFIX = 'https://github.com' URL_PATH = 'atom/debian-sysroot-image-creator/releases/download' -REVISION_AMD64 = 264817 -REVISION_I386 = 'v0.2.0' -REVISION_ARM = 'v0.1.0' +REVISION_AMD64 = 'v0.3.0' +REVISION_I386 = 'v0.3.0' +REVISION_ARM = 'v0.3.0' 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 = 'f5b2ceaeb3f7e6bc2058733585fe877d002b5fa7' -TARBALL_ARM_SHA1SUM = '72e668c57b8591e108759584942ddb6f6cee1322' +TARBALL_AMD64_SHA1SUM = '3dc6f553c3f4e54166ac1264b7754cddc01942e4' +TARBALL_I386_SHA1SUM = '62d2490de201f73b3774868f7ab82b2a48acf3c0' +TARBALL_ARM_SHA1SUM = '1110793341e7a3c12adfe5e53138d692a22c99bc' SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot' SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot' SYSROOT_DIR_ARM = 'debian_wheezy_arm-sysroot' @@ -134,11 +134,7 @@ def main(): print 'Unknown architecture: %s' % target_arch assert(False) - if options.url: - url = options.url - tarball_sha1sum = options.revision - else: - url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename) + url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename) stamp = os.path.join(sysroot, '.stamp') if os.path.exists(stamp): @@ -157,12 +153,11 @@ def main(): sys.stdout.flush() sys.stderr.flush() subprocess.check_call(['curl', '--fail', '-L', url, '-o', tarball]) - if tarball_sha1sum: - sha1sum = GetSha1(tarball) - if sha1sum != tarball_sha1sum: - print 'Tarball sha1sum is wrong.' - print 'Expected %s, actual: %s' % (tarball_sha1sum, sha1sum) - return 1 + sha1sum = GetSha1(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) @@ -178,9 +173,5 @@ if __name__ == '__main__': 'Linux builds') parser.add_option('--arch', type='choice', choices=valid_archs, help='Sysroot architecture: %s' % ', '.join(valid_archs)) - parser.add_option('--url', default=None, - help='The URL to download sysroot image.') - parser.add_option('--revision', default=None, - help='SHA1 hash of the sysroot image tarball.') options, _ = parser.parse_args() sys.exit(main()) diff --git a/script/update.py b/script/update.py index 2388f16515c..e91e8401cbf 100755 --- a/script/update.py +++ b/script/update.py @@ -60,18 +60,12 @@ def run_gyp(target_arch, component): mas_build = 1 else: mas_build = 0 - # Whether to use sysroot image. - if os.environ.has_key('USE_SYSROOT'): - use_sysroot = 1 - else: - use_sysroot = 0 defines = [ '-Dlibchromiumcontent_component={0}'.format(component), '-Dtarget_arch={0}'.format(target_arch), '-Dhost_arch={0}'.format(get_host_arch()), '-Dlibrary=static_library', '-Dmas_build={0}'.format(mas_build), - '-Duse_sysroot={0}'.format(use_sysroot) ] return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.', 'atom.gyp', '-Icommon.gypi'] + defines, env=env) diff --git a/toolchain.gypi b/toolchain.gypi index 7215cb8c542..42c2987dc68 100644 --- a/toolchain.gypi +++ b/toolchain.gypi @@ -113,7 +113,7 @@ }], # Setup sysroot environment. - ['OS=="linux" and target_arch in ["arm", "ia32", "x64"] and use_sysroot', { + ['OS=="linux" and target_arch in ["arm", "ia32", "x64"]', { 'variables': { 'conditions': [ ['target_arch=="arm"', {