diff --git a/infra/bots/recipe_modules/build/default.py b/infra/bots/recipe_modules/build/default.py index ef4ee22fe6e03..708a5158464a7 100644 --- a/infra/bots/recipe_modules/build/default.py +++ b/infra/bots/recipe_modules/build/default.py @@ -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'), @@ -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( @@ -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', diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm-Debug-iOS.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm-Debug-iOS.json index 03ed14cabd59d..d02da6556cb66 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm-Debug-iOS.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm-Debug-iOS.json @@ -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@@@" ] }, { @@ -13,7 +13,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": { diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json index b1d0ffb0b7a26..2d879ddc3550a 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-arm64-Debug-iOS.json @@ -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@@@" ] }, { @@ -13,7 +13,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": { diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-ASAN.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-ASAN.json index ab80a5957e60b..ce230869b589a 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-ASAN.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-ASAN.json @@ -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@@@" ] }, { @@ -13,7 +13,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": { @@ -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", @@ -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@@@" ] }, @@ -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, @@ -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, @@ -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, diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json index f9298803b389e..6da90d3c230d4 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json @@ -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@@@" ] }, { @@ -13,7 +13,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": { diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json index 4aa4c30ff1181..3faab040da330 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Debug-Metal.json @@ -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@@@" ] }, { @@ -13,7 +13,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": { diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json index d0c602fdc0c68..f2858631a060a 100644 --- a/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Mac-Clang-x86_64-Release-MoltenVK_Vulkan.json @@ -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@@@" ] }, { @@ -13,7 +13,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": { diff --git a/infra/bots/recipes/sync_and_compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json b/infra/bots/recipes/sync_and_compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json index 7e0ffa6dcde7d..d6c17e58d5902 100644 --- a/infra/bots/recipes/sync_and_compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json +++ b/infra/bots/recipes/sync_and_compile.expected/Build-Mac-Clang-x86_64-Debug-CommandBuffer.json @@ -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@@@" ] }, { @@ -166,7 +166,7 @@ "-kind", "ios", "-xcode-version", - "10g8", + "11c29", "-output-dir", "[START_DIR]/cache/Xcode.app" ], @@ -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": {