OLD | NEW |
| (Empty) |
1 #!/usr/bin/python | |
2 | |
3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | |
4 # for details. All rights reserved. Use of this source code is governed by a | |
5 # BSD-style license that can be found in the LICENSE file. | |
6 | |
7 """ | |
8 Buildbot steps for building Dart SDK with Fletch-specific patches. | |
9 """ | |
10 import os | |
11 import sys | |
12 # We run this as third_party/fletch/tools/bots/sdk_fletch_patched.py | |
13 sys.path.insert(0, os.path.join('tools', 'bots')) | |
14 | |
15 import bot | |
16 import bot_utils | |
17 import re | |
18 | |
19 utils = bot_utils.GetUtils() | |
20 | |
21 PATCHED_BUILDER = r'dart-sdk-fletch-patched-(linux|mac)-(x64|arm)' | |
22 | |
23 def BuildConfig(name, is_buildbot): | |
24 """Returns info for the current buildbot.""" | |
25 pattern = re.match(PATCHED_BUILDER, name) | |
26 if pattern: | |
27 system = pattern.group(1) | |
28 arch = pattern.group(2) | |
29 if system == 'mac': system = 'macos' | |
30 return bot.BuildInfo('none', 'none', 'release', system, arch=arch) | |
31 return None | |
32 | |
33 | |
34 def Archive(gcs_name, vm_path, link_name): | |
35 download_link = 'https://storage.googleapis.com/%s' % gcs_name | |
36 gcs_path = 'gs://%s' % gcs_name | |
37 gsutil = bot_utils.GSUtil() | |
38 gsutil.upload(vm_path, gcs_path) | |
39 print '@@@STEP_LINK@download %s@%s@@@' % (link_name, download_link) | |
40 sys.stdout.flush() | |
41 | |
42 | |
43 def BuildSteps(build_info): | |
44 with bot.BuildStep('Upload VM to GCS'): | |
45 # The build binary in the sdk is stripped, the one in build_root is not. | |
46 # We archive the unstripped binaries in case we need to debug a vm crash. | |
47 sdk_bin_path = utils.GetBuildSdkBin(build_info.system, | |
48 build_info.mode, | |
49 build_info.arch) | |
50 build_root = utils.GetBuildRoot(build_info.system, | |
51 build_info.mode, | |
52 build_info.arch) | |
53 revision = utils.GetGitRevision() | |
54 archive_path = 'fletch-archive/patched_dart_sdks/%s/' % revision | |
55 stripped_name = '%sdart-vm-%s-%s' % (archive_path, build_info.arch, | |
56 build_info.system) | |
57 unstripped_name = '%sdart-vm-%s-%s-symbols' % (archive_path, | |
58 build_info.arch, | |
59 build_info.system) | |
60 | |
61 unstripped_vm = os.path.join(build_root, 'dart') | |
62 stripped_vm = os.path.join(sdk_bin_path, 'dart') | |
63 Archive(stripped_name, stripped_vm, 'stripped') | |
64 Archive(unstripped_name, unstripped_vm, 'unstripped') | |
65 | |
66 if __name__ == '__main__': | |
67 bot.RunBot(BuildConfig, BuildSteps) | |
OLD | NEW |