From 8e3c42b1ee981643b9dc78b67b7da0a7b470dc37 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Mon, 31 Jul 2017 14:57:20 -0400 Subject: [PATCH] add a Win/Clang build bot BUG=skia:2679 CQ_INCLUDE_TRYBOTS=skia.primary:Build-Win-Clang-x86_64-Release Change-Id: I861366ae1340abcc67e87041904d08337b465bbe Reviewed-on: https://skia-review.googlesource.com/28864 Reviewed-by: Eric Boren --- bin/fetch-clang-win | 40 -------------- infra/bots/gen_tasks.go | 3 ++ infra/bots/jobs.json | 1 + .../Build-Win-Clang-x86_64-Release.json | 54 +++++++++++++++++++ .../recipe_modules/flavor/examples/full.py | 1 + infra/bots/recipe_modules/flavor/gn_flavor.py | 2 + infra/bots/tasks.json | 40 ++++++++++++++ 7 files changed, 101 insertions(+), 40 deletions(-) delete mode 100644 bin/fetch-clang-win create mode 100644 infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release.json diff --git a/bin/fetch-clang-win b/bin/fetch-clang-win deleted file mode 100644 index 06ff07b12c..0000000000 --- a/bin/fetch-clang-win +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2017 Google Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -VERSION = '308728-3' -MD5 = '8bec8c34da5d256e27638383667489e5' - -import hashlib -import os -import shutil -import tarfile -import urllib2 - -os.chdir(os.path.dirname(__file__)) - -if (not os.path.exists('clang_win/md5.txt') - or open('clang_win/md5.txt').read().strip() != MD5): - - # Clear out everything and start fresh. - shutil.rmtree('clang_win', ignore_errors=True) - os.mkdir('clang_win') - os.chdir('clang_win') - - # Grab the current Clang package. - with open(VERSION + '.tgz', 'wb') as tgz: - url = 'https://commondatastorage.googleapis.com/chromium-browser-clang' - tgz.write(urllib2.urlopen(url + '/Win/clang-' + VERSION + '.tgz').read()) - - # Extract it. - tarfile.open(VERSION + '.tgz').extractall() - - # Write out its hash to md5.txt so that next time is quicker. - h = hashlib.md5() - with open(VERSION + '.tgz', 'rb') as tgz: - h.update(tgz.read()) - with open('md5.txt', 'w') as md5: - md5.write(h.hexdigest()) diff --git a/infra/bots/gen_tasks.go b/infra/bots/gen_tasks.go index f19bb568bd..e31497f729 100644 --- a/infra/bots/gen_tasks.go +++ b/infra/bots/gen_tasks.go @@ -469,6 +469,9 @@ func compile(b *specs.TasksCfgBuilder, name string, parts map[string]string) str } } else if strings.Contains(name, "Win") { pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("win_toolchain")) + if strings.Contains(name, "Clang") { + pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("clang_win")) + } if strings.Contains(name, "Vulkan") { pkgs = append(pkgs, b.MustGetCipdPackageFromAsset("win_vulkan_sdk")) } diff --git a/infra/bots/jobs.json b/infra/bots/jobs.json index 47f713d001..8c15db4051 100644 --- a/infra/bots/jobs.json +++ b/infra/bots/jobs.json @@ -59,6 +59,7 @@ "Build-Mac-Clang-x86_64-Release", "Build-Mac-Clang-x86_64-Release-CommandBuffer", "Build-Win-Clang-arm64-Release-Android", + "Build-Win-Clang-x86_64-Release", "Build-Win-MSVC-x86-Debug", "Build-Win-MSVC-x86-Debug-ANGLE", "Build-Win-MSVC-x86-Debug-Exceptions", diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release.json b/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release.json new file mode 100644 index 0000000000..cb088a1f4c --- /dev/null +++ b/infra/bots/recipe_modules/flavor/examples/full.expected/Build-Win-Clang-x86_64-Release.json @@ -0,0 +1,54 @@ +[ + { + "cmd": [ + "python", + "-u", + "[CUSTOM_C:\\_B_WORK]/skia/bin/fetch-gn" + ], + "cwd": "[CUSTOM_C:\\_B_WORK]/skia", + "env": { + "BUILDTYPE": "Release_x64", + "CHROME_HEADLESS": "1", + "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[CUSTOM_C:\\_B_WORK]/skia/out/Build-Win-Clang-x86_64-Release" + }, + "infra_step": true, + "name": "fetch-gn" + }, + { + "cmd": [ + "[CUSTOM_C:\\_B_WORK]/skia/bin/gn.exe", + "gen", + "[CUSTOM_C:\\_B_WORK]/skia/out/Build-Win-Clang-x86_64-Release/Release_x64", + "--args=cc=\"clang\" clang_win=\"[START_DIR]/clang_win\" cxx=\"clang++\" is_debug=false target_cpu=\"x86_64\" windk=\"[START_DIR]/t/depot_tools/win_toolchain/vs_files/d3cb0e37bdd120ad0ac4650b674b09e81be45616\"" + ], + "cwd": "[CUSTOM_C:\\_B_WORK]/skia", + "env": { + "BUILDTYPE": "Release_x64", + "CHROME_HEADLESS": "1", + "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[CUSTOM_C:\\_B_WORK]/skia/out/Build-Win-Clang-x86_64-Release" + }, + "name": "gn gen" + }, + { + "cmd": [ + "ninja.exe", + "-C", + "[CUSTOM_C:\\_B_WORK]/skia/out/Build-Win-Clang-x86_64-Release/Release_x64" + ], + "cwd": "[CUSTOM_C:\\_B_WORK]/skia", + "env": { + "BUILDTYPE": "Release_x64", + "CHROME_HEADLESS": "1", + "PATH": ":RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[CUSTOM_C:\\_B_WORK]/skia/out/Build-Win-Clang-x86_64-Release" + }, + "name": "ninja" + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +] \ No newline at end of file diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py index 59fba853f4..739fbb792d 100644 --- a/infra/bots/recipe_modules/flavor/examples/full.py +++ b/infra/bots/recipe_modules/flavor/examples/full.py @@ -69,6 +69,7 @@ TEST_BUILDERS = [ 'Build-Ubuntu-GCC-x86_64-Release-PDFium', 'Build-Ubuntu-GCC-x86_64-Release-PDFium_SkiaPaths', 'Build-Win-Clang-arm64-Release-Android', + 'Build-Win-Clang-x86_64-Release', 'Build-Win-MSVC-x86_64-Debug-GDI', 'Build-Win-MSVC-x86_64-Debug-NoGPU', 'Build-Win-MSVC-x86_64-Release-Exceptions', diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py index 20d23ac40e..04afa7ca48 100644 --- a/infra/bots/recipe_modules/flavor/gn_flavor.py +++ b/infra/bots/recipe_modules/flavor/gn_flavor.py @@ -109,6 +109,8 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils): args['skia_use_metal'] = 'true' if 'CheckGeneratedFiles' in extra_config: args['skia_compile_processors'] = 'true' + if compiler == 'Clang' and 'Win' in os: + args['clang_win'] = '"%s"' % self.m.vars.slave_dir.join('clang_win') for (k,v) in { 'cc': cc, diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json index 11cdea55a0..8f586dcc7b 100644 --- a/infra/bots/tasks.json +++ b/infra/bots/tasks.json @@ -365,6 +365,12 @@ "Build-Win-Clang-arm64-Release-Android" ] }, + "Build-Win-Clang-x86_64-Release": { + "priority": 0.8, + "tasks": [ + "Build-Win-Clang-x86_64-Release" + ] + }, "Build-Win-MSVC-x86-Debug": { "priority": 0.8, "tasks": [ @@ -3983,6 +3989,40 @@ "isolate": "compile_skia.isolate", "priority": 0.8 }, + "Build-Win-Clang-x86_64-Release": { + "cipd_packages": [ + { + "name": "skia/bots/win_toolchain", + "path": "t", + "version": "version:6" + }, + { + "name": "skia/bots/clang_win", + "path": "clang_win", + "version": "version:0" + } + ], + "dimensions": [ + "gpu:none", + "os:Windows-2008ServerR2-SP1", + "pool:Skia" + ], + "extra_args": [ + "--workdir", + "../../..", + "compile", + "repository=<(REPO)", + "buildername=Build-Win-Clang-x86_64-Release", + "swarm_out_dir=${ISOLATED_OUTDIR}", + "revision=<(REVISION)", + "patch_repo=<(PATCH_REPO)", + "patch_storage=<(PATCH_STORAGE)", + "patch_issue=<(ISSUE)", + "patch_set=<(PATCHSET)" + ], + "isolate": "compile_skia.isolate", + "priority": 0.8 + }, "Build-Win-MSVC-x86-Debug": { "cipd_packages": [ {