Remove direct references to hermetic mac toolchain.
This ensures that the hermetic toolchain is only used if use_system_xcode is false. This CL also causes two changes: * svn is assumed to be installed on the system. It is not pulled from the hermetic toolchain. * mac_sdk_build was used to populate the SDK version in the Info.plist. This was being populated with a different version than the SDK being used to build Chrome, which is incorrect. BUG=651267 Review-Url: https://codereview.chromium.org/2412353003 Cr-Original-Commit-Position: refs/heads/master@{#425170} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 6218c34684254f1c090bf501f6c46b0a69b63ec5
This commit is contained in:
Родитель
f9e6643a25
Коммит
2a71e4cead
|
@ -3,6 +3,7 @@
|
|||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/chrome_build.gni")
|
||||
import("//build/toolchain/toolchain.gni")
|
||||
|
||||
# See https://bugs.chromium.org/p/webrtc/issues/detail?id=5453.
|
||||
# We can drop the rtc_require_mac_10_7_deployment flag when Chromium
|
||||
|
@ -38,6 +39,12 @@ declare_args() {
|
|||
_verify_sdk = is_chrome_branded && is_official_build && target_os != "ios"
|
||||
|
||||
find_sdk_args = [ "--print_sdk_path" ]
|
||||
if (!use_system_xcode) {
|
||||
find_sdk_args += [
|
||||
"--developer_dir",
|
||||
hermetic_xcode_path,
|
||||
]
|
||||
}
|
||||
if (_verify_sdk) {
|
||||
find_sdk_args += [
|
||||
"--verify",
|
||||
|
@ -58,8 +65,16 @@ if (mac_sdk_path == "") {
|
|||
}
|
||||
|
||||
script_name = "//build/config/mac/sdk_info.py"
|
||||
_mac_sdk_result = exec_script(script_name, [ mac_sdk_name ], "scope")
|
||||
mac_sdk_build = _mac_sdk_result.sdk_build
|
||||
sdk_info_args = []
|
||||
if (!use_system_xcode) {
|
||||
sdk_info_args += [
|
||||
"--developer_dir",
|
||||
hermetic_xcode_path,
|
||||
]
|
||||
}
|
||||
sdk_info_args += [ mac_sdk_name ]
|
||||
|
||||
_mac_sdk_result = exec_script(script_name, sdk_info_args, "scope")
|
||||
xcode_version = _mac_sdk_result.xcode_version
|
||||
xcode_build = _mac_sdk_result.xcode_build
|
||||
machine_os_build = _mac_sdk_result.machine_os_build
|
||||
|
|
|
@ -43,7 +43,7 @@ template("mac_info_plist") {
|
|||
extra_substitutions = invoker.extra_substitutions
|
||||
}
|
||||
extra_substitutions += [
|
||||
"MAC_SDK_BUILD=$mac_sdk_build",
|
||||
"MAC_SDK_BUILD=$mac_sdk_version",
|
||||
"MAC_SDK_NAME=$mac_sdk_name$mac_sdk_version",
|
||||
]
|
||||
plist_templates = [
|
||||
|
|
|
@ -2,13 +2,11 @@
|
|||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||
import mac_toolchain
|
||||
|
||||
# This script prints information about the build system, the operating
|
||||
# system and the iOS or Mac SDK (depending on the platform "iphonesimulator",
|
||||
# "iphoneos" or "macosx" generally).
|
||||
|
@ -54,19 +52,22 @@ def FillSDKPathAndVersion(settings, platform, xcode_version):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--developer_dir", required=False)
|
||||
args, unknownargs = parser.parse_known_args()
|
||||
if args.developer_dir:
|
||||
os.environ['DEVELOPER_DIR'] = args.developer_dir
|
||||
|
||||
if len(unknownargs) != 1:
|
||||
sys.stderr.write(
|
||||
'usage: %s [iphoneos|iphonesimulator|macosx]\n' %
|
||||
os.path.basename(sys.argv[0]))
|
||||
sys.exit(1)
|
||||
|
||||
# Try using the toolchain in mac_files.
|
||||
mac_toolchain.SetToolchainEnvironment()
|
||||
|
||||
settings = {}
|
||||
FillMachineOSBuild(settings)
|
||||
FillXcodeVersion(settings)
|
||||
FillSDKPathAndVersion(settings, sys.argv[1], settings['xcode_version'])
|
||||
FillSDKPathAndVersion(settings, unknownargs[0], settings['xcode_version'])
|
||||
|
||||
for key in sorted(settings):
|
||||
print '%s="%s"' % (key, settings[key])
|
||||
|
|
|
@ -9,7 +9,6 @@ make sure settings are consistent between them, all setup should happen here.
|
|||
"""
|
||||
|
||||
import gyp_helper
|
||||
import mac_toolchain
|
||||
import os
|
||||
import sys
|
||||
import vs_toolchain
|
||||
|
@ -29,4 +28,3 @@ def SetEnvironment():
|
|||
os.environ['GYP_GENERATORS'] = 'ninja'
|
||||
|
||||
vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs()
|
||||
mac_toolchain.SetToolchainEnvironment()
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
# found in the LICENSE file.
|
||||
|
||||
"""Prints the lowest locally available SDK version greater than or equal to a
|
||||
given minimum sdk version to standard output.
|
||||
given minimum sdk version to standard output. If --developer_dir is passed, then
|
||||
the script will use the Xcode toolchain located at DEVELOPER_DIR.
|
||||
|
||||
Usage:
|
||||
python find_sdk.py 10.6 # Ignores SDKs < 10.6
|
||||
python find_sdk.py [--developer_dir DEVELOPER_DIR] 10.6 # Ignores SDKs < 10.6
|
||||
"""
|
||||
|
||||
import os
|
||||
|
@ -15,9 +16,6 @@ import re
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
|
||||
import mac_toolchain
|
||||
|
||||
from optparse import OptionParser
|
||||
|
||||
|
||||
|
@ -37,13 +35,14 @@ def main():
|
|||
parser.add_option("--print_sdk_path",
|
||||
action="store_true", dest="print_sdk_path", default=False,
|
||||
help="Additionaly print the path the SDK (appears first).")
|
||||
parser.add_option("--developer_dir", help='Path to Xcode.')
|
||||
options, args = parser.parse_args()
|
||||
if len(args) != 1:
|
||||
parser.error('Please specify a minimum SDK version')
|
||||
min_sdk_version = args[0]
|
||||
|
||||
# Try using the toolchain in mac_files.
|
||||
mac_toolchain.SetToolchainEnvironment()
|
||||
if options.developer_dir:
|
||||
os.environ['DEVELOPER_DIR'] = options.developer_dir
|
||||
|
||||
job = subprocess.Popen(['xcode-select', '-print-path'],
|
||||
stdout=subprocess.PIPE,
|
||||
|
|
|
@ -39,19 +39,6 @@ STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision')
|
|||
TOOLCHAIN_URL = 'gs://chrome-mac-sdk/'
|
||||
|
||||
|
||||
def GetToolchainDirectory():
|
||||
if sys.platform == 'darwin' and not UseLocalMacSDK():
|
||||
return TOOLCHAIN_BUILD_DIR
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def SetToolchainEnvironment():
|
||||
mac_toolchain_dir = GetToolchainDirectory()
|
||||
if mac_toolchain_dir:
|
||||
os.environ['DEVELOPER_DIR'] = mac_toolchain_dir
|
||||
|
||||
|
||||
def ReadStampFile():
|
||||
"""Return the contents of the stamp file, or '' if it doesn't exist."""
|
||||
try:
|
||||
|
@ -151,7 +138,7 @@ def AcceptLicense():
|
|||
subprocess.check_call(['sudo', '/usr/bin/xcode-select', '-s', old_path])
|
||||
|
||||
|
||||
def UseLocalMacSDK():
|
||||
def _UseLocalMacSDK():
|
||||
force_pull = os.environ.has_key('FORCE_MAC_TOOLCHAIN')
|
||||
|
||||
# Don't update the toolchain if there's already one installed outside of the
|
||||
|
@ -167,8 +154,7 @@ def main():
|
|||
if sys.platform != 'darwin':
|
||||
return 0
|
||||
|
||||
# TODO(justincohen): Add support for GN per crbug.com/570091
|
||||
if UseLocalMacSDK():
|
||||
if _UseLocalMacSDK():
|
||||
print 'Using local toolchain.'
|
||||
return 0
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче