From 8e4bff5b449753997b2e5e4a2a1fac3511c91380 Mon Sep 17 00:00:00 2001 From: jianli Date: Thu, 25 Aug 2016 17:19:54 -0700 Subject: [PATCH] Revert of Desktop Chrome OS: Build with precise sysroot (patchset #2 id:40001 of https://codereview.chromium.org/2272273002/ ) Reason for revert: Caused webview_licenses failure: https://build.chromium.org/p/chromium.linux/builders/Android%20Tests/builds/31063 Original issue's description: > Desktop Chrome OS: Build with precise sysroot > > Build and link against the Ubuntu Precise amd64 sysroot on Desktop > Chrome OS instead of always using the system libraries. > > BUG=638394 > > Committed: https://crrev.com/c575bbcd130b38994e36b0a97bfe5ceea954a643 > Cr-Commit-Position: refs/heads/master@{#414564} TBR=dpranke@chromium.org,thomasanderson@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=638394 Review-Url: https://codereview.chromium.org/2285563002 Cr-Original-Commit-Position: refs/heads/master@{#414594} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: faa5e808ff90870b5b5b35c65e931eec5d6285cc --- config/sysroot.gni | 35 +++--- linux/sysroot_scripts/install-sysroot.py | 136 ++++++++++------------- 2 files changed, 69 insertions(+), 102 deletions(-) diff --git a/config/sysroot.gni b/config/sysroot.gni index 7fed8b3ee..b815d2ac6 100644 --- a/config/sysroot.gni +++ b/config/sysroot.gni @@ -44,31 +44,22 @@ if (is_linux && target_sysroot_dir != "") { } else { sysroot = "" } -} else if (is_linux && use_sysroot) { +} else if (is_linux && !is_chromeos && use_sysroot) { # By default build against a sysroot image downloaded from Cloud Storage # during gclient runhooks. - if (is_chromeos) { - # Regular ChromeOS builds use custom sysroots, but desktop ChromeOS (where - # we're building linux desktop binaries but using the ChromeOS UI and - # functionality where possible) needs to run on the buliders, which are - # running precise. The precise build has a different set of dependencies - # from the wheezy build, so we cannot use the wheezy sysroot. - sysroot = "//build/linux/ubuntu_precise_amd64-sysroot" + if (current_cpu == "x64") { + sysroot = "//build/linux/debian_wheezy_amd64-sysroot" + } else if (current_cpu == "x86") { + sysroot = "//build/linux/debian_wheezy_i386-sysroot" + } else if (current_cpu == "mipsel") { + sysroot = "//build/linux/debian_wheezy_mips-sysroot" + } else if (current_cpu == "arm") { + sysroot = "//build/linux/debian_wheezy_arm-sysroot" + } else if (current_cpu == "arm64") { + sysroot = "//build/linux/debian_jessie_arm64-sysroot" } else { - if (current_cpu == "x64") { - sysroot = "//build/linux/debian_wheezy_amd64-sysroot" - } else if (current_cpu == "x86") { - sysroot = "//build/linux/debian_wheezy_i386-sysroot" - } else if (current_cpu == "mipsel") { - sysroot = "//build/linux/debian_wheezy_mips-sysroot" - } else if (current_cpu == "arm") { - sysroot = "//build/linux/debian_wheezy_arm-sysroot" - } else if (current_cpu == "arm64") { - sysroot = "//build/linux/debian_jessie_arm64-sysroot" - } else { - # Any other builds don't use a sysroot. - sysroot = "" - } + # Any other builds don't use a sysroot. + sysroot = "" } if (sysroot != "") { diff --git a/linux/sysroot_scripts/install-sysroot.py b/linux/sysroot_scripts/install-sysroot.py index 3e842a47c..9622176bf 100755 --- a/linux/sysroot_scripts/install-sysroot.py +++ b/linux/sysroot_scripts/install-sysroot.py @@ -35,45 +35,26 @@ import gyp_environment URL_PREFIX = 'https://commondatastorage.googleapis.com' URL_PATH = 'chrome-linux-sysroot/toolchain' - -SYSROOTS = { - ('Wheezy', 'amd64'): { - 'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba', - 'Tarball' : 'debian_wheezy_amd64_sysroot.tgz', - 'Sha1Sum' : 'a7f3df28b02799fbd7675c2ab24f1924c104c0ee', - 'SysrootDir' : 'debian_wheezy_amd64-sysroot' - }, - ('Wheezy', 'arm'): { - 'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba', - 'Tarball' : 'debian_wheezy_arm_sysroot.tgz', - 'Sha1Sum' : '2df01b8173a363977daf04e176b8c7dba5b0b933', - 'SysrootDir' : 'debian_wheezy_arm-sysroot' - }, - ('Wheezy', 'i386'): { - 'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba', - 'Tarball' : 'debian_wheezy_i386_sysroot.tgz', - 'Sha1Sum' : 'e2c7131fa5f711de28c37fd9442e77d32abfb3ff', - 'SysrootDir' : 'debian_wheezy_i386-sysroot' - }, - ('Wheezy', 'mips'): { - 'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba', - 'Tarball' : 'debian_wheezy_mips_sysroot.tgz', - 'Sha1Sum' : '22fe7b45b144691aeb515083025f0fceb131d724', - 'SysrootDir' : 'debian_wheezy_mips-sysroot' - }, - ('Jessie', 'arm64'): { - 'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba', - 'Tarball' : 'debian_jessie_arm64_sysroot.tgz', - 'Sha1Sum' : 'df9270e00c258e6cd80f8172b1bfa39aafc4756f', - 'SysrootDir' : 'debian_jessie_arm64-sysroot' - }, - ('Precise', 'amd64'): { - 'Revision' : '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba', - 'Tarball' : 'ubuntu_precise_amd64_sysroot.tgz', - 'Sha1Sum' : '67985675e64e1d3cf6574088f36f89092ae9e86b', - 'SysrootDir' : 'ubuntu_precise_amd64-sysroot' - } -} +REVISION_AMD64 = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba' +REVISION_ARM = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba' +REVISION_ARM64 = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba' +REVISION_I386 = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba' +REVISION_MIPS = '24f935a3d8cdfcdfbabd23928a42304b1ffc52ba' +TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz' +TARBALL_ARM = 'debian_wheezy_arm_sysroot.tgz' +TARBALL_ARM64 = 'debian_jessie_arm64_sysroot.tgz' +TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz' +TARBALL_MIPS = 'debian_wheezy_mips_sysroot.tgz' +TARBALL_AMD64_SHA1SUM = 'a7f3df28b02799fbd7675c2ab24f1924c104c0ee' +TARBALL_ARM_SHA1SUM = '2df01b8173a363977daf04e176b8c7dba5b0b933' +TARBALL_ARM64_SHA1SUM = 'df9270e00c258e6cd80f8172b1bfa39aafc4756f' +TARBALL_I386_SHA1SUM = 'e2c7131fa5f711de28c37fd9442e77d32abfb3ff' +TARBALL_MIPS_SHA1SUM = '22fe7b45b144691aeb515083025f0fceb131d724' +SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot' +SYSROOT_DIR_ARM = 'debian_wheezy_arm-sysroot' +SYSROOT_DIR_ARM64 = 'debian_jessie_arm64-sysroot' +SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot' +SYSROOT_DIR_MIPS = 'debian_wheezy_mips-sysroot' valid_archs = ('arm', 'arm64', 'i386', 'amd64', 'mips') @@ -104,8 +85,6 @@ def DetectHostArch(): return 'i386' elif detected_host_arch == 'arm': return 'arm' - elif detected_host_arch == 'arm64': - return 'arm64' elif detected_host_arch == 'mips': return 'mips' @@ -143,23 +122,12 @@ def InstallDefaultSysroots(): This includes at least the sysroot for host architecture, and the 32-bit sysroot for building the v8 snapshot image. It can also include the cross compile sysroot for ARM/MIPS if cross compiling environment can be detected. - - Another reason we're installing this by default is so that developers can - compile and run on our supported platforms without having to worry about - flipping things back and forth and whether the sysroots have been downloaded - or not. """ host_arch = DetectHostArch() - InstallDefaultSysrootForArch(host_arch) + InstallSysroot(host_arch) if host_arch == 'amd64': - InstallDefaultSysrootForArch('i386') - - # Desktop Chromium OS builds require the precise sysroot. - # TODO(thomasanderson): only download this when the GN arg target_os - # == 'chromeos', when the functionality to perform the check becomes - # available. - InstallSysroot('Precise', 'amd64') + InstallSysroot('i386') # Finally, if we can detect a non-standard target_arch such as ARM or # MIPS, then install the sysroot too. @@ -167,7 +135,7 @@ def InstallDefaultSysroots(): # architecture. target_arch = DetectTargetArch() if target_arch and target_arch not in (host_arch, 'i386'): - InstallDefaultSysrootForArch(target_arch) + InstallSysroot(target_arch) def main(args): @@ -187,37 +155,45 @@ def main(args): if not options.arch: print 'You much specify either --arch or --running-as-hook' return 1 - InstallDefaultSysrootForArch(options.arch) + InstallSysroot(options.arch) return 0 -def InstallDefaultSysrootForArch(target_arch): - if target_arch == 'amd64': - InstallSysroot('Wheezy', 'amd64') - elif target_arch == 'arm': - InstallSysroot('Wheezy', 'arm') - elif target_arch == 'arm64': - InstallSysroot('Jessie', 'arm64') - elif target_arch == 'i386': - InstallSysroot('Wheezy', 'i386') - elif target_arch == 'mips': - InstallSysroot('Wheezy', 'mips') - else: - raise Error('Unknown architecture: %s' % target_arch) -def InstallSysroot(target_platform, target_arch): +def InstallSysroot(target_arch): # The sysroot directory should match the one specified in build/common.gypi. # TODO(thestig) Consider putting this else where to avoid having to recreate # it on every build. linux_dir = os.path.dirname(SCRIPT_DIR) - - if (target_platform, target_arch) not in SYSROOTS: - raise Error('No sysroot for: %s %s' % (target_platform, target_arch)) - sysroot_dict = SYSROOTS[(target_platform, target_arch)] - revision = sysroot_dict['Revision'] - tarball_filename = sysroot_dict['Tarball'] - tarball_sha1sum = sysroot_dict['Sha1Sum'] - sysroot = os.path.join(linux_dir, sysroot_dict['SysrootDir']) + debian_release = 'Wheezy' + if target_arch == 'amd64': + sysroot = os.path.join(linux_dir, SYSROOT_DIR_AMD64) + tarball_filename = TARBALL_AMD64 + tarball_sha1sum = TARBALL_AMD64_SHA1SUM + revision = REVISION_AMD64 + elif target_arch == 'arm': + sysroot = os.path.join(linux_dir, SYSROOT_DIR_ARM) + tarball_filename = TARBALL_ARM + tarball_sha1sum = TARBALL_ARM_SHA1SUM + revision = REVISION_ARM + elif target_arch == 'arm64': + debian_release = 'Jessie' + sysroot = os.path.join(linux_dir, SYSROOT_DIR_ARM64) + tarball_filename = TARBALL_ARM64 + tarball_sha1sum = TARBALL_ARM64_SHA1SUM + revision = REVISION_ARM64 + elif target_arch == 'i386': + sysroot = os.path.join(linux_dir, SYSROOT_DIR_I386) + tarball_filename = TARBALL_I386 + tarball_sha1sum = TARBALL_I386_SHA1SUM + revision = REVISION_I386 + elif target_arch == 'mips': + sysroot = os.path.join(linux_dir, SYSROOT_DIR_MIPS) + tarball_filename = TARBALL_MIPS + tarball_sha1sum = TARBALL_MIPS_SHA1SUM + revision = REVISION_MIPS + else: + raise Error('Unknown architecture: %s' % target_arch) url = '%s/%s/%s/%s' % (URL_PREFIX, URL_PATH, revision, tarball_filename) @@ -226,11 +202,11 @@ def InstallSysroot(target_platform, target_arch): with open(stamp) as s: if s.read() == url: print 'Debian %s %s root image already up to date: %s' % \ - (target_platform, target_arch, sysroot) + (debian_release, target_arch, sysroot) return print 'Installing Debian %s %s root image: %s' % \ - (target_platform, target_arch, sysroot) + (debian_release, target_arch, sysroot) if os.path.isdir(sysroot): shutil.rmtree(sysroot) os.mkdir(sysroot)