Commit 35012792 authored by erikchen's avatar erikchen Committed by Commit Bot

mac: Roll hermetic toolchain to Xcode 8.3.2.

Xcode 8.3.2 requires macOS 10.12+. This version of Xcode 8.3.2 has both the
10.10 and 10.12 SDKs, and builds will continue to use the 10.10 SDK.

To support machines running macOS versions < 10.12, but don't require building
targets, this CL also:
  * Does not download the hermetic toolchain if the macOS version does not
    support the toolchain version.
  * Does not allow building targets with the default hermetic toolchain if the
    macOS version does not support the toolchain version.

BUG=624049

Review-Url: https://codereview.chromium.org/2950933003
Cr-Original-Commit-Position: refs/heads/master@{#481225}
Committed: https://chromium.googlesource.com/chromium/src/+/2f19b143e444c920e643feda583e9ceb72d29c8e
Review-Url: https://codereview.chromium.org/2950933003
Cr-Commit-Position: refs/heads/master@{#481692}
parent 0070d414
......@@ -3,8 +3,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints "1" if Chrome targets should be built with hermetic xcode. Otherwise
prints "0".
"""
Prints "1" if Chrome targets should be built with hermetic Xcode.
Prints "2" if Chrome targets should be built with hermetic Xcode, but the OS
version does not meet the minimum requirements of the hermetic version of Xcode.
Otherwise prints "0".
Usage:
python should_use_hermetic_xcode.py <target_os>
......@@ -13,6 +16,12 @@ Usage:
import os
import sys
_THIS_DIR_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
_BUILD_PATH = os.path.join(_THIS_DIR_PATH, os.pardir)
sys.path.insert(0, _BUILD_PATH)
import mac_toolchain
def _IsCorpMachine():
return os.path.isdir('/Library/GoogleCorpSupport/')
......@@ -21,6 +30,8 @@ def _IsCorpMachine():
def main():
allow_corp = sys.argv[1] == 'mac' and _IsCorpMachine()
if os.environ.get('FORCE_MAC_TOOLCHAIN') or allow_corp:
if not mac_toolchain.PlatformMeetsHermeticXcodeRequirements(sys.argv[1]):
return "2"
return "1"
else:
return "0"
......
......@@ -14,6 +14,7 @@ date:
"""
import os
import platform
import plistlib
import shutil
import subprocess
......@@ -24,10 +25,14 @@ import tempfile
import urllib2
# This can be changed after running /build/package_mac_toolchain.py.
MAC_TOOLCHAIN_VERSION = '5B1008'
MAC_TOOLCHAIN_VERSION = '8E2002'
MAC_TOOLCHAIN_SUB_REVISION = 3
MAC_TOOLCHAIN_VERSION = '%s-%s' % (MAC_TOOLCHAIN_VERSION,
MAC_TOOLCHAIN_SUB_REVISION)
# The toolchain will not be downloaded if the minimum OS version is not met.
# 16 is the major version number for macOS 10.12.
MAC_MINIMUM_OS_VERSION = 16
IOS_TOOLCHAIN_VERSION = '8C1002'
IOS_TOOLCHAIN_SUB_REVISION = 1
IOS_TOOLCHAIN_VERSION = '%s-%s' % (IOS_TOOLCHAIN_VERSION,
......@@ -44,6 +49,13 @@ TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, '%s_files', 'Xcode.app')
STAMP_FILE = os.path.join(BASE_DIR, '%s_files', 'toolchain_build_revision')
TOOLCHAIN_URL = 'gs://chrome-mac-sdk/'
def PlatformMeetsHermeticXcodeRequirements(target_os):
if target_os == 'ios':
return True
return int(platform.release().split('.')[0]) >= MAC_MINIMUM_OS_VERSION
def GetPlatforms():
default_target_os = ["mac"]
try:
......@@ -232,6 +244,10 @@ def main():
return 0
for target_os in GetPlatforms():
if not PlatformMeetsHermeticXcodeRequirements(target_os):
print 'OS version does not support toolchain.'
continue
if target_os == 'ios':
default_version = IOS_TOOLCHAIN_VERSION
toolchain_filename = 'ios-toolchain-%s.tgz'
......
......@@ -58,5 +58,8 @@ if (use_system_xcode == "") {
_result = exec_script("//build/mac/should_use_hermetic_xcode.py",
[ target_os ],
"value")
assert(_result != 2,
"Do not allow building targets with the default" +
"hermetic toolchain if the minimum OS version is not met.")
use_system_xcode = _result == 0
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment