Skip to content

Commit

Permalink
Update XCode
Browse files Browse the repository at this point in the history
Chromium now requires the 10.15 SDK
(https://bugs.chromium.org/p/chromium/issues/detail?id=1023913), which
breaks the CommandBuffer bot because it's trying to compile with XCode
10.3, which provides the 10.14 SDK.

What's worse, due to reasons I don't fully understand, after failing to
compile CommandBuffer due to the dependence on the 10.15 SDK, the ninja
out dir is poisoned for future compiles that don't depend on the 10.15
SDK.

Also includes a code snippet from
https://skia-review.googlesource.com/c/skia/+/264429 to find the xSAN
dylibs.

Change-Id: I3cd7661a5ea984ea6899e7a5e8cf878581538d9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272736
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
  • Loading branch information
dogben committed Feb 23, 2020
1 parent d1c90e1 commit 9980661
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 47 deletions.
36 changes: 17 additions & 19 deletions infra/bots/recipe_modules/build/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@
from . import util


# XCode build is listed in parentheses after the version at
# https://developer.apple.com/news/releases/, or on Wikipedia here:
# https://en.wikipedia.org/wiki/Xcode#Version_comparison_table
# Use lowercase letters.
# When updating XCODE_BUILD_VERSION, you will also need to update
# XCODE_CLANG_VERSION.
XCODE_BUILD_VERSION = '10g8'
# Wikipedia lists the Clang version here:
# https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
XCODE_CLANG_VERSION = '10.0.1'


def build_command_buffer(api, chrome_dir, skia_dir, out):
api.run(api.python, 'build command_buffer',
script=skia_dir.join('tools', 'build_command_buffer.py'),
Expand Down Expand Up @@ -103,6 +91,11 @@ def compile_fn(api, checkout_root, out_dir):
env = {}

if os == 'Mac':
# XCode build is listed in parentheses after the version at
# https://developer.apple.com/news/releases/, or on Wikipedia here:
# https://en.wikipedia.org/wiki/Xcode#Version_comparison_table
# Use lowercase letters.
XCODE_BUILD_VERSION = '11c29'
extra_cflags.append(
'-DDUMMY_xcode_build_version=%s' % XCODE_BUILD_VERSION)
mac_toolchain_cmd = api.vars.slave_dir.join(
Expand Down Expand Up @@ -365,13 +358,18 @@ def copy_build_products(api, src, dst):
util.DEFAULT_BUILD_PRODUCTS)

if os == 'Mac' and any('SAN' in t for t in extra_tokens):
# Hardcoding this path because it should only change when we upgrade to a
# new Xcode.
lib_dir = api.vars.cache_dir.join(
'Xcode.app', 'Contents', 'Developer', 'Toolchains',
'XcodeDefault.xctoolchain', 'usr', 'lib', 'clang', XCODE_CLANG_VERSION,
'lib', 'darwin')
dylibs = api.file.glob_paths('find xSAN dylibs', lib_dir,
# The XSAN dylibs are in
# Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib
# /clang/11.0.0/lib/darwin, where 11.0.0 could change in future versions.
xcode_clang_ver_dirs = api.file.listdir(
'find XCode Clang version',
api.vars.cache_dir.join(
'Xcode.app', 'Contents', 'Developer', 'Toolchains',
'XcodeDefault.xctoolchain', 'usr', 'lib', 'clang'),
test_data=['11.0.0'])
assert len(xcode_clang_ver_dirs) == 1
dylib_dir = xcode_clang_ver_dirs[0].join('lib', 'darwin')
dylibs = api.file.glob_paths('find xSAN dylibs', dylib_dir,
'libclang_rt.*san_osx_dynamic.dylib',
test_data=[
'libclang_rt.asan_osx_dynamic.dylib',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -13,7 +13,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-arm-Debug-iOS/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\", \"-O1\"] skia_ios_identity=\".*GS9WA.*\" skia_ios_profile=\"[START_DIR]/provisioning_profile_ios/Upstream_Testing_Provisioning_Profile.mobileprovision\" target_cpu=\"arm\" target_os=\"ios\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_ios_identity=\".*GS9WA.*\" skia_ios_profile=\"[START_DIR]/provisioning_profile_ios/Upstream_Testing_Provisioning_Profile.mobileprovision\" target_cpu=\"arm\" target_os=\"ios\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -13,7 +13,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-arm64-Debug-iOS/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\", \"-O1\"] skia_ios_identity=\".*GS9WA.*\" skia_ios_profile=\"[START_DIR]/provisioning_profile_ios/Upstream_Testing_Provisioning_Profile.mobileprovision\" target_cpu=\"arm64\" target_os=\"ios\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_ios_identity=\".*GS9WA.*\" skia_ios_profile=\"[START_DIR]/provisioning_profile_ios/Upstream_Testing_Provisioning_Profile.mobileprovision\" target_cpu=\"arm64\" target_os=\"ios\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -13,7 +13,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Debug-ASAN/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\", \"-O1\"] sanitize=\"ASAN\" skia_enable_spirv_validation=false target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] sanitize=\"ASAN\" skia_enable_spirv_validation=false target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down Expand Up @@ -157,6 +157,23 @@
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
"vpython",
"-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"listdir",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang"
],
"infra_step": true,
"name": "find XCode Clang version",
"~followup_annotations": [
"@@@STEP_LOG_LINE@listdir@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0@@@",
"@@@STEP_LOG_END@listdir@@@"
]
},
{
"cmd": [
"vpython",
Expand All @@ -165,15 +182,15 @@
"--json-output",
"/path/to/tmp/json",
"glob",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin",
"libclang_rt.*san_osx_dynamic.dylib"
],
"infra_step": true,
"name": "find xSAN dylibs",
"~followup_annotations": [
"@@@STEP_LOG_LINE@glob@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib@@@",
"@@@STEP_LOG_LINE@glob@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib@@@",
"@@@STEP_LOG_LINE@glob@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib@@@",
"@@@STEP_LOG_LINE@glob@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib@@@",
"@@@STEP_LOG_LINE@glob@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib@@@",
"@@@STEP_LOG_LINE@glob@[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib@@@",
"@@@STEP_LOG_END@glob@@@"
]
},
Expand All @@ -185,7 +202,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib",
"[START_DIR]/[SWARM_OUT_DIR]/out/Debug"
],
"infra_step": true,
Expand All @@ -199,7 +216,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib",
"[START_DIR]/[SWARM_OUT_DIR]/out/Debug"
],
"infra_step": true,
Expand All @@ -213,7 +230,7 @@
"--json-output",
"/path/to/tmp/json",
"copy",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib",
"[START_DIR]/cache/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib",
"[START_DIR]/[SWARM_OUT_DIR]/out/Debug"
],
"infra_step": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -13,7 +13,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -91,7 +91,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Debug-CommandBuffer/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\", \"-O1\"] skia_gl_standard=\"\" target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_gl_standard=\"\" target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -13,7 +13,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Debug-Metal/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\", \"-O1\"] skia_use_metal=true target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_use_metal=true target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -13,7 +13,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -70,7 +70,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan/Release",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_moltenvk_path=\"[START_DIR]/moltenvk\" skia_use_vulkan=true target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\"] is_debug=false skia_enable_vulkan_debug_layers=true skia_moltenvk_path=\"[START_DIR]/moltenvk\" skia_use_vulkan=true target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"cmd": [],
"name": "ensure xcode",
"~followup_annotations": [
"@@@STEP_TEXT@Ensuring Xcode version 10g8 in [START_DIR]/cache/Xcode.app@@@"
"@@@STEP_TEXT@Ensuring Xcode version 11c29 in [START_DIR]/cache/Xcode.app@@@"
]
},
{
Expand All @@ -166,7 +166,7 @@
"-kind",
"ios",
"-xcode-version",
"10g8",
"11c29",
"-output-dir",
"[START_DIR]/cache/Xcode.app"
],
Expand Down Expand Up @@ -244,7 +244,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-x86_64-Debug-CommandBuffer/Debug",
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=10g8\", \"-O1\"] skia_gl_standard=\"\" target_cpu=\"x86_64\" werror=true"
"--args=cc=\"clang\" cc_wrapper=\"[START_DIR]/ccache_mac/bin/ccache\" cxx=\"clang++\" extra_cflags=[\"-DDUMMY_xcode_build_version=11c29\", \"-O1\"] skia_gl_standard=\"\" target_cpu=\"x86_64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {
Expand Down

0 comments on commit 9980661

Please sign in to comment.